Android FTP Server

前端 未结 5 532
抹茶落季
抹茶落季 2020-12-28 23:43

I am using the following code to make the android device a ftp server (Android Internal storage). I am getting the exception of os.android.NetworkOnMainThread.

5条回答
  •  抹茶落季
    2020-12-29 00:06

    while(true){ incoming = s.accept(); ...} You cannot put that in OnStart(). That should be done in a thread. So ServerSocket s = null; should be a variable of you activity.

提交回复
热议问题