A question about smack connect to openfire base on android

I 'm trying to develop a chinese chess on android platform,using XMPP protocol to deliver data.and there is a question,I could use the basic set of smack talk to spark by jsp or java app,to gtalk by java app,jsp,android app.but I could not use android app connect openfire as local server to spark,android platform will stopped the app’s process.I wanna know if there are some works that I don’t do,such as android’s initializtion.if could,

please show me a simple code about connect to openfire base on android,thx.and sorry for my poor english.