[android-developers] Re: Polling at regular intervals in Android

2012-10-10 Thread John Coryat
I have to ask why you want to poll the server to find if a file is ready to download? Wouldn't it be a lot more efficient to have the server "tell" the app the file is ready via GCM? -John Coryat -- You received this message because you are subscribed to the Google Groups "Android Developers"

[android-developers] Re: Polling at regular intervals in Android

2012-10-10 Thread bob
Sounds like you will want to use NTP to synchronize them both to an atomic clock of your choosing. On Wednesday, October 10, 2012 4:32:47 AM UTC-5, Archana wrote: > > Ok thanks! Now I have client in 2 instances of emulators. How to I > synchronize the polling of the server between them? > >

[android-developers] Re: Polling at regular intervals in Android

2012-10-10 Thread Archana
Ok thanks! Now I have client in 2 instances of emulators. How to I synchronize the polling of the server between them? On Wednesday, October 10, 2012 9:38:42 AM UTC+3, skink wrote: > > > > Archana wrote: > > Hi, > > > > Please let me know if the following is okay: > > 1. Fire alarm for every

[android-developers] Re: Polling at regular intervals in Android

2012-10-09 Thread skink
Archana wrote: > Hi, > > Please let me know if the following is okay: > 1. Fire alarm for every 5 minutes using Alarm Manager > 2. Response- Start a service that polls server > 3. After polling, new alarm is set and service shuts down. > Should I also use WakeLock in my code? > https://github.com

[android-developers] Re: Polling at regular intervals in Android

2012-10-09 Thread Archana
Hi, Please let me know if the following is okay: 1. Fire alarm for every 5 minutes using Alarm Manager 2. Response- Start a service that polls server 3. After polling, new alarm is set and service shuts down. Should I also use WakeLock in my code? https://github.com/commonsguy/cwac-wakeful Thank

[android-developers] Re: Polling at regular intervals in Android

2012-10-09 Thread skink
Archana wrote: > Should I have the alarm manager as a service?(as I want the application to > be executed always)... > > Here is my service: > > public class PollService extends Service > { > private PendingIntent pendingIntent; > private AlarmManager alarmManager; > private Calendar calendar; >

[android-developers] Re: Polling at regular intervals in Android

2012-10-09 Thread Archana
Should I have the alarm manager as a service?(as I want the application to be executed always)... Here is my service: public class PollService extends Service { private PendingIntent pendingIntent; private AlarmManager alarmManager; private Calendar calendar; @Override public IBinder onBind(I

[android-developers] Re: Polling at regular intervals in Android

2012-10-09 Thread skink
Archana wrote: > Can you please let me know how to use Alarm Manager as service? > > sure, google for: android alarmmanager example pskink -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-dev

[android-developers] Re: Polling at regular intervals in Android

2012-10-09 Thread Archana
Can you please let me know how to use Alarm Manager as service? On Tuesday, October 9, 2012 11:09:52 AM UTC+3, skink wrote: > > > > Archana wrote: > > Hi, I have 2 nanoHTTPD servers running in 2 instances of the emulator. > The > > clients in both emulators should periodically poll to find if f

[android-developers] Re: Polling at regular intervals in Android

2012-10-09 Thread skink
Archana wrote: > Hi, I have 2 nanoHTTPD servers running in 2 instances of the emulator. The > clients in both emulators should periodically poll to find if file got > updated in server(every 5 minutes may be). Please let me know how to > implement this(as I am relatively new to Android)? Should