views:

22

answers:

1

I've got an app that retrieves data on a regular basis from the internet (3 times a week).

The data on the server is available via an XML api (which I built) and which works without any problem.

However, some of the users handsets are not on/connected when the call is made.

What is the best way to handle this lack of net connection failure?

Implement a net connection listener? Is this a bad idea?

I can always run the service at phone startup, but there are no guarantees that they will have a connection up and running at that point.

Slightly confused. Any help appreciated.

A: 

What is the best way to handle this lack of net connection failure?

I sincerely hope you are implementing this via AlarmManager, and your three-times-a-week implementation is a repeating alarm. In that case, schedule a one-off alarm for X minutes from now, and try again.

CommonsWare
Well, to be honest I hadn't (as yet) coded the scheduling bit - was going to pick up a bit of code later. However, will use AlarmManager now - and hadn't thought of doing it that way. Much easier than the way I was thinking about doing it.
padajo