senps
senps

Reputation: 594

Contact Android device through a Server

Is there any way to send request from a server to an Android phone? Actually, I want to control an application (enable or disable some features of the application) in an Android phone by a server. Can I use the IP Address of the Android device?. Can anyone guide me. Thank you!.

Upvotes: 1

Views: 182

Answers (3)

Konstantin Pribluda
Konstantin Pribluda

Reputation: 12367

All push services are usually implemented as well concealed polling. Phones on 3G networks usually sit behind NAT proxies and are not visible to outside world. The same holds for most wlan networks - so either use C2DM, or write your own service polling config information from some server provided by you

Upvotes: 2

Serdar Dogruyol
Serdar Dogruyol

Reputation: 5157

If the above option is not suited for your case then you can create a simple service for your application and then attach to application.

The service can be a thread which sends requests to the server with some time intervals that you find suitable and can check if there is anything to check and to do for the application. And also can run in background.

Upvotes: 2

Ivan
Ivan

Reputation: 1796

Much simpler way is for phone to contact server and ask should features be enabled. You could also use something like this http://code.google.com/android/c2dm/ but I'm not sure if this is an overkill for your use case.

Upvotes: 3

Related Questions