Android launching an application from a remote server

I want to run an Android application from a remote server, I see that in J2ME there is a class called PushRegistry, this class solves this problem in ME, but in android I can not do it.

Thanks in advance

+4
source share
2 answers

In Android 2.2 (and later presumably) you can use Cloud to Device Messaging (C2DM) for this.

If you do not have version 2.2, you will need to poll the server from the device to see if it should start. You can do this through a Service , but it would probably be better to use AlarmManager to schedule a poll. You do not want to poll too often, as you will use data, battery, etc.

+4
source

A very easy way to do this is to use the Java Timer class. The TimerTask can start every minute or two and perform an HTTP Get to check for commands from the server. Once the command has been found, you can create an Intent inside TimerTask and use startActivity or startService to launch your Android application.

0
source

All Articles