WifiP2P
WifiP2P copied to clipboard
File transfer doesn't work!?
Dear Sir,
Thanks for the sharing! I have tried your code on my 2 Android 9 devices. Although the two devices can connect each other, the file transferring is unsuccessful?
I have also tried this code on Android 10 device. However, when I clicked "Choose Document" icon on the top right corner, the app quitted unexpectedly?
May I know if any tips for fixing this issue? Any suggestions will be highly appreciated!
Thanks!
Yes, I am also facing this same issue. The error occurs in doInBackground method in while loop. byte[] buf = new byte[512]; int len; while ((len = inputStream.read(buf)) != -1) { outputStream.write(buf, 0, len); total += len; int progress = (int) ((total * 100) / fileSize); publishProgress(progress); Log.e(TAG, "File sending progress:" + progress); }
遇到相同的问题,选择文件的时候应用崩溃。
2020-12-28 14:47:44.608 10433-10433/leavesc.hello.filetransfer E/libc: Access denied finding property "ro.vendor.df.effect.conflict" 2020-12-28 14:47:44.611 10433-10465/leavesc.hello.filetransfer E/Perf: Fail to get file list leavesc.hello.filetransfer 2020-12-28 14:47:44.611 10433-10465/leavesc.hello.filetransfer E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array 2020-12-28 14:47:44.611 10433-10465/leavesc.hello.filetransfer E/Perf: Fail to get file list oat 2020-12-28 14:47:44.611 10433-10465/leavesc.hello.filetransfer E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array