[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

Re: [android-developers] Re: Polling

2010-07-12 Thread David Turner
On Sun, Jul 11, 2010 at 9:05 PM, perumal316 wrote: > Hi, > > I tried using FileObserver but I am having problems importing > "android.os.FileObserver" > > But I am getting the following error: > > "The import conflicts with a type defined in the same file" > > Any idea how to resolve this? > > It

[android-developers] Re: Polling

2010-07-12 Thread perumal316
Hi All, Thanks for the help. I managed to solve it. The error occurred because my class name was also FileObserver. Regards, Perumal On Jul 13, 5:38 am, TreKing wrote: > On Sun, Jul 11, 2010 at 11:05 PM, perumal316 wrote: > > "The import conflicts with a type defined in the same file" > > > An

Re: [android-developers] Re: Polling

2010-07-12 Thread TreKing
On Sun, Jul 11, 2010 at 11:05 PM, perumal316 wrote: > "The import conflicts with a type defined in the same file" > > Any idea how to resolve this? > I'm sorry, but I don't think that error can be any clearer. What part of it don't you understand? ---

[android-developers] Re: Polling

2010-07-12 Thread Federico Paolinelli
Note also that your application must be running in order to get notified by the fileobserver. If the directory get changed while your app is down it won't get notified. You may consider to use a service or save the state of the directory in "onPause" method and compare it in "onResume". It depends

[android-developers] Re: Polling

2010-07-11 Thread perumal316
Hi, I tried using FileObserver but I am having problems importing "android.os.FileObserver" But I am getting the following error: "The import conflicts with a type defined in the same file" Any idea how to resolve this? Thanks In Advance, Perumal On Jul 12, 11:29 am, Romain Guy wrote: > To

[android-developers] Re: Polling internet, battery life Suggestion / Question?

2008-03-30 Thread Krishna(GK)
Peli, Sorry I have taken a while to reply. I see that you are planning to do this after the code submission date. Please do contact me if necessary to share ideas. I am not able devote enough time to Android to actually help you in the coding. The benefits of something like this are 1. The user

[android-developers] Re: Polling internet, battery life Suggestion / Question?

2008-03-26 Thread Peli
Your idea sounds very useful. Indeed, it could be an idea that would fit well into our project "OpenIntents". I already suggested it as an idea in our project group: http://groups.google.com/group/openintents/browse_frm/thread/7f34fe99bd23c25 linking back to this discussion here, so feel free to a