Reputation: 55
I'm trying to make an app Android which can : - Broadcast a file in a local network wifi. - Receiver the file which is broadcasted by the other mobile.
I don't have much experience. So, I hope that you guys can give me some solutions.
These other question : Which API of Android can solve this problem? The maximum volume of file that I can send?
Thank you so much!
Upvotes: 0
Views: 478
Reputation: 784
please follow this http://developer.android.com/guide/topics/connectivity/wifip2p.html.
That allows you to discover devices on wifi with you, then send data to them via normal sockets.
There is a wifi-direct sample app with the SDK.
please use this code to attach file with intent
File sd = Environment.getExternalStorageDirectory();
File fileDir= new File(sd, "dir_path");
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileDir.getAbsolutePath() + "/"
+ FILE_TXT
intent.setAction("set_your_Action_here");
sendBroadcast(intent);// broadcast your text file.
Upvotes: 1