nareshpatchipulusu / auto-update-apk-client

Automatically exported from code.google.com/p/auto-update-apk-client
0 stars 0 forks source link

allow time based updates #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We need our app to only update in off hours. We would like to specify this time 
on the auto update server.

1) upload an apk
2) specify a time range 
3) app checks for updates and does not see there is one available unless it is 
checking durring the time range specified.

Original issue reported on code.google.com by d...@codesushi.com on 25 May 2012 at 7:23

GoogleCodeExporter commented 9 years ago
This is a nice idea I'm being pondering for a while now.

However, there's a slight problem I still haven't decided how to solve.

If the schedule is decided by the server, and the update time range is 
relatively small (1-2hours), the application has to check for updates quite 
frequently, like every 30minutes, which is too frequent in my opinion.

But if the time range is decided by the application, the application can check 
for updates once a day and still be able to get into any tight schedule.

Moreover, if your application is deployed all over the world, and you want to 
get updates only during the night time (local time), it would be quite 
difficult with the time range settings decided by the server.

So, here's a question: wouldn't it be better to embed the update schedule into 
the application and not into the server settings? Is there any scenario, where 
this approach would not work?

Original comment by lenik.terenin on 26 May 2012 at 12:02

GoogleCodeExporter commented 9 years ago
If we don't know the time(s) when we deploy the application that we would like 
to have the update happen, we would need your service to be able to inform the 
client in some way when it needs to check.  One way we could do this would be 
to have the app download the APK and only do the actual install at the 
designated time. Our app needs to check for updates every few hours in order to 
account for the urgent updates we have while we're deployed in the field.

Original comment by d...@codesushi.com on 29 May 2012 at 2:18

GoogleCodeExporter commented 9 years ago
To be honest I like both ideas.  I could see scnearios for both.  codesushi has 
a good point but personally I am more inclined to embed the time in the 
application.  This should prob be 2 separate issues.

Original comment by bric...@gmail.com on 29 May 2012 at 7:32

GoogleCodeExporter commented 9 years ago
What if the server could provide the time that the software needs to actually 
be installed... so the download happens and sits there waiting... then a thread 
wakes up at the appointed time and does the install? It might be the next 
day... or maybe right now.

Original comment by d...@codesushi.com on 13 Jun 2012 at 11:18

GoogleCodeExporter commented 9 years ago
Two new methods were added:

public void clearSchedule()
public void addSchedule(int start, int end)

the former one clears the schedule (which is the same as 00:00~24:00), and 
second adds an interval in hours to the current schedule. Parameters start and 
end are the limits of the update interval in hours. For example, 
addSchedule(10,15) allows updates to be run from 10am to 3pm of local time.

You may add several intervals, for example, addSchedule(23,24) and 
addSchedule(0,5) will allow updates to be run from 11pm to 5am.

Original comment by lenik.terenin on 19 Jun 2012 at 8:11

GoogleCodeExporter commented 9 years ago
Issue 12 has been merged into this issue.

Original comment by lenik.terenin on 19 Jun 2012 at 8:20