How I can send a file from my server to an Android app?
I need to send a file to an Android application from my server. I have the user's IP address saved in a database from the last time he was online. Does Android have something like listener over the internet so I can send a request (from myserver with the IP) to check if is it the user I am looking for or if the IP has changed?
You may want to look into the Android Cloud to Device Messaging Framework. You could use this to tell your app on the Android device that there's new content to fetch from the server, for example.
IP Addresses on mobile devices are pretty ephemeral. In addition, to save on battery power, a lot of phones turn off the wifi antenna when it isn't being used. And of course, internet connections are always spotty on mobile devices. Because of this, it's usually a lot simpler for the device to ask the server "is there a file for me?". A good way to do this on Android is to use the AlarmManager and have the device periodically check to see if there is a file that it should download - maybe once or twice a day.
Get list view item info through context menu
Android 9-patch scaling affected by the density folder that it resides in
connecting to socket using asynctask android
Use Plugin in PhoneGap/Cordova 2.9.0 for mDNS/ZeroConf/Bonjour
HttpResponse is not getting the JSON returned by the server
Casting a Menu Item in XML to a Spinner (Actionbar appcompat)
Updating an existing Android app in Eclipse?
How to check an app is installed on a specific phone
What's “msgid” and “xliff” in strings.xml file?
How can I create a YuvImage in android
NDK can't load library
Eclipse import SVN project as Android project
Null pointer exception when using layout inflate in android
Value <br of type java.lang.String cannot be converted to JSONObject on android
Connecting to existing Google Chromecast Session from Android (for generic remote control)
Create shortcut with data