Auto refresh connection request

43 views
Skip to first unread message

kraman...@gmail.com

unread,
Feb 27, 2014, 12:59:08 AM2/27/14
to codenameone...@googlegroups.com
How would you go about making a connection request every 2 minutes? 

I'm brand new to Codename One, so it would be great to get some advice. 

Shai Almog

unread,
Feb 27, 2014, 2:05:41 AM2/27/14
to codenameone...@googlegroups.com, kraman...@gmail.com
I wouldn't. That would seriously drain battery life and if your app was pushed to the background the OS would kill it since it would drain the device battery.
You need to use push notification instead of polling.

If you choose to do polling you can use a thread or timer task to add a query to the NetworkManager queue but the caveat above obviously applies.

kraman...@gmail.com

unread,
Feb 27, 2014, 11:04:42 AM2/27/14
to codenameone...@googlegroups.com, kraman...@gmail.com
Thanks a lot Shai. For now I guess I'll just use the slide to refresh tutorial :)
Reply all
Reply to author
Forward
0 new messages