I am trying to make an app which needs to push pdf files into server from mobile and same time download those files from server in different mobiles when wifi available...so help me some start up...
Asked
Active
Viewed 426 times
1 Answers
0
You should give more information, but this is what I would do if I had the resource available via a URL on the server.
If you just want to view it on the device:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(some-url)));
If you want to download it and do something else with it then use Java sockets to connect to the server and get the file.
To know when WiFi has become available you need to register a BroadcastReceiver so that your activity gets notified when WiFi's connection state changes.
Here you have a post where the top answer shows an example of how to do that.

Community
- 1
- 1

Juan Andrés Diana
- 2,215
- 3
- 25
- 36
-
Thank You Juan..i got downloaded PDF from url into sd card...it will do by giving the url with particular pdf name..i want to download all the files available from server when wifi enables... – Prasad Jan 20 '13 at 08:30
-
You need to register a BroadcastReceiver to notify you that the connection state has changed. I'll edit my post. – Juan Andrés Diana Jan 20 '13 at 08:35