문제

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!

도움이 되었습니까?

해결책

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.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top