Main BLOGGER
Google
WWW THIS BLOG
Friday, January 04, 2008
 
Android, xmpp sample app
1. Simulator's XMPP settings
       At first, run the emulator and registered gmail account
'pop.liu@gmail.com' by [Home / App / Dev Tools / XMPP Settings] and made sure the
item 'Stay connected to server' was checked.

2. Simulator's im.db
In order to send data message, you need to inform android that the jid
and resource name are 'data message capable'.

--- launch adb shell ( <SDK>/tools/adb.exe in Windows)
C:\android_sdk_windows_m3-rc37a\tools>adb shell
----launch sqlite3 to insert one record to the im.db
From an adb remote shell, you can use the sqlite3(http://www.sqlite.org/sqlite.html), command-line program to manage SQLite databases created by Android applications.
#cd /data/data/com.google.android.providers.im/databases
# sqlite3 im.db

sqlite3 im.db
SQLite version 3.5.0
Enter ".help" for instructions
sqlite> select * from xmppDataMessageCapable;
select * from xmppDataMessageCapable;
sqlite> insert into xmppDataMessageCapable (bare_jid,resource) values ('pop.liu@ gmail.com','localhost');
insert into xmppDataMessageCapable (bare_jid,resource) values ('pop.liu@gmail.com','localhost');
sqlite> select * from xmppDataMessageCapable;
select * from xmppDataMessageCapable;
1|pop.liu@gmail.com|localhost|
sqlite> .exit


3. run ApiDemos --> App/Service/Xmpp Data Message Sender
input "pop.liu@gmail.com" then click "Send Message"


--
Pop (Pu Liu)



<< Home

Powered by Blogger

Google
WWW THIS BLOG