hi,
my b4a version is v 2.00, i'am trying to upload text files to a windows FTP server, it compiles fine
but when i deploy it to a emulator or a real device the program throws up an error "unfortunately the program has stopped" and exits.
please check the code and log below.
here is the code i've used.
and the log errors.
my b4a version is v 2.00, i'am trying to upload text files to a windows FTP server, it compiles fine
but when i deploy it to a emulator or a real device the program throws up an error "unfortunately the program has stopped" and exits.
please check the code and log below.
here is the code i've used.
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim FTP As FTP
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("up")
Activity.Title="HOME"
If FirstTime Then
FTP.Initialize("FTP","172.17.1.71",21,"ftpuser","ftp123")
FTP.List("/")
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Log(ServerPath)
If Success = False Then
Log(LastException)
Else
For i = 0 To Folders.Length - 1
Log(Folders(i).Name)
Next
For i = 0 To Files.Length - 1
Log(Files(i).Name & ", " & Files(i).Size & ", " & DateTime.Date(Files(i).Timestamp))
Next
End If
End Sub
and the log errors.
B4X:
LogCat connected to: emulator-5554
problem reading network stats
java.lang.IllegalStateException: problem parsing idx 1
at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:300)
at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1282)
at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:831)
at com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:743)
at com.android.server.net.NetworkStatsService.updateIfaces(NetworkStatsService.java:721)
at com.android.server.net.NetworkStatsService.access$000(NetworkStatsService.java:128)
at com.android.server.net.NetworkStatsService$8.handleMessage(NetworkStatsService.java:1633)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:406)
at java.io.FileInputStream.<init>(FileInputStream.java:78)
at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:269)
... 9 more
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:390)
... 11 more
problem reading network stats
java.lang.IllegalStateException: problem parsing idx 1
at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:300)
at com.android.server.NetworkManagementService.getNetworkStatsUidDetail(NetworkManagementService.java:1282)
at com.android.server.net.NetworkStatsService.performPollLocked(NetworkStatsService.java:831)
at com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:743)
at com.android.server.net.NetworkStatsService.updateIfaces(NetworkStatsService.java:721)
at com.android.server.net.NetworkStatsService.access$000(NetworkStatsService.java:128)
at com.android.server.net.NetworkStatsService$1.onReceive(NetworkStatsService.java:612)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:406)
at java.io.FileInputStream.<init>(FileInputStream.java:78)
at com.android.internal.net.NetworkStatsFactory.readNetworkStatsDetail(NetworkStatsFactory.java:269)
... 11 more
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:390)
... 13 more
main_process_globals (java line: 365)
java.lang.NoClassDefFoundError: anywheresoftware.b4a.net.FTPWrapper
at ftp.upload.main._process_globals(main.java:365)
at ftp.upload.main.initializeProcessGlobals(main.java:335)
at ftp.upload.main.afterFirstLayout(main.java:80)
at ftp.upload.main.access$100(main.java:16)
at ftp.upload.main$WaitForLayout.run(main.java:72)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)