Mar 5, 2013 Replies: 241 New Automated FTP Library UPDATED 3-24-2014 - Version 1.06 changes the display scale and should look better on the larger display of a tablet. A sample project is now included which shows how to use this library. The sample code requires B4A 3.2+. You can open and view the code with older versions but it will not run because of the newer layout files. UPDATED 1-24-2014 - Version 1.05 adds a new function for checking for files or folders. It also contains a few other small fixes. The new command works for Files or Folders. If the last parameter is set to TRUE, it will look for folders, if the last parameter is set to FALSE it will look for files. Because the code runs in the background and is modeless you must have a callback sub in the calling module. Code samples below: Code: 'Call the command like this: FTP.FileOrFolderExist("plane.jpg" , "test/files", False) Code: 'Callback sub in calling module: Sub FTP_FileExist(Found As Boolean) If Found Then Log("True") Else Log("False") End Sub UPDATED 4-2-2013 - Version 1.02 Corrects an issue where PassiveMode was not working and also corrects an issue where UploadFileSet would not work from File.DirInternal. Automates the process of sending and receiving files using FTP with Wildcards & File Masks. Version 1.02 is attached. Please post/report back any issues you find, etc. This library has progress bars for Each File and overall progress. It handles wildcards and multi file types at the same time. Issue one command and transfer multiple files and multiple types! Change the colors, text size and words of all objects on the Progress Dialog to fit the look of your app. Also works in Stealth Mode! REQUIRES: B4A 2.5 + Copy the FTP_Auto.jar & FTP_Auto.xml files to the Extra Libraries folder. FTP_Auto Close Completes the current Que with any files left to process and then closes the connection. CloseNow Closes the connection and all other files in the Que are ignored and the process is terminated. DeleteFile (DeletePathAndFile As String) Deletes a single file from the server. Example: DeleteFile("public/pictures/airplane1.jpg") DeleteFileSet (VerifyBeforeDelete As Boolean) Delete the lastest FileSet in memory from the server. If you used a Mask to download a set of files, this function will delelete all files in that last set. NOTICE: use with care. DownLoadFile (LocalPath As String, ServerPath As String, FileName As String, Delete_FromServer As Boolean) Downloads a selected file from the FTP server and optionally deletes the file after successful download Example: DownLoadFile("/mnt/sdcard/pictures/", "public/downloads/", "airplane.jpg", False) DownloadFileSet (LocalPath As String, Files_Path_And_Mask() As String, Delete_FromServer As Boolean) Retrieves a list of files from the server matching the Mask(s) passed to Files_Path_And_Mask() array. You should include the full server path in the Mask. It will then download these files to the Folder passed in LocalPath. Files_Path_And_Mask() can contain one entry or however many is needed. Example: DownloadFileSet(File.DirInternal, Array As String("SM*.txt", "public/pictures/pla*.jpg"), False) IsInitialized As Boolean Tests whether the object has been initialized. Initialize (Activity As Activity, CalledFrom As Object, FTP_Site As String, UserName As String, PassWord As String, PortNumber As Int, ShowMessages As Boolean, UsePassiveMode As Boolean) As String Initializes the object for use. If True is passed for ShowMessages, additional messages will be displayed throughout the process. Use the keywords "Activity" and "Me" For the first two parameters. Example: Initialize(Activity, Me, "ftp.yourdomain.com", "userName", "PassWord", "Port", True, False) LastDownloadStats ( As ) As String Shows a popup window with the detials of the latest Download(s). LastProcessSuccessful As Boolean Returns True if the last Upload or Download process was successful, otherwise returns False. LastUploadStats ( As ) As String Show a popup window with details of the latest Upload(s). MakeDir (DirectoryName As String) Makes a directory on the FTP server. Does nothing if the directory already exist. If you want to make a directory in the root of the server and then a directory under it, you must issue the command twice. Example: MakeDir("test") MakeDir("test/datafolder") RemoveDir (DirectoryName As String) Removes selected directory from the FTP server SetColors (HeadingColor As Int, TotalProgressColor As Int, FileTextColor As Int, PanelBackgroundColor As Int, FrameColor As Int) Used to set colors of each Item in the status dialog. NOTE: Passing 0 for any argument with leave that item unchanged SetCompletedDownloadDialog (ShowCompletedDialog As Boolean, DialogText As String) If ShowCompletedDialog=True, it will show a dialog after the download process is completed. SetCompletedUploadDialog (ShowCompletedDialog As Boolean, DialogText As String) If ShowCompletedDialog=True, it will show a dialog after the upload process is completed. SetProcessCompleteOn (ProcessCompleteOn As Boolean) Use this function to determine by code when the Upload or Download is finished. The calling Activity must contain a sub named FTP_ProcessComplete. If your calling Activity includes this sub and you set this function to True, then the sub will be called as soon as the process has completed. EXAMPLE: 'Add this sub to calling Activity Sub FTP_ProcessComplete 'Your code here... End Sub SetStealthOn (UseStealth As Boolean) If set to True, no progress box will be displayed during the file transfer. If False the progress dialog will show during the file transfers. The default is False. SetStickyOn (MakeSticky As Boolean) If set to True, the progress box will stay on the screen until the user taps the Done button, otherwise the progress box will close as soon as the transfer is complete. The default is False. SetText (HeaderDownLoadText As String, HeaderUploadText As String, TotalProgressText As String, FileProgressText As String, ButtonCancelText As String, ButtonDoneText As String) Used to set the Text of the Item's status display. NOTE: May be used for different language, etc. SetTextSize (HeaderTextSize As Int, TotalProgressTextSize As Int, FileProgressTextSize As Int, CancelAndDoneTextSize As Int) Used to set the Text size of the Item's Text in the status dialog. NOTE: Passing 0 for any argument with leave that item unchanged UpLoadFile (LocalPath As String, ServerPath As String, FileToSend As String) Uploads a single file passed in FileToSend Example: UpLoadFile("/mnt/sdcard/pictures", "uploads/pictures", "vacation.jpg") UploadFileSet (ServerPath As String, Files_Path_And_Mask() As String, DeleteFileFromLocalDevice As Boolean) Retrieves a list of files from the local device. The Files_Path_And_Mask() array should contain the full path to the local devices files. It will then upload these files to the server. Files_Path_And_Mask() array can contain one entry or however many is needed. Example: UploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA*.jpg", "/mnt/sdcard/backups/contact*.dat"), False) WiFi_IsConnected As Boolean Check if Wifi is connected Returns True if connected otherwise returns False Permissions: ◦android.permission.ACCESS_WIFI_STATE ◦android.permission.INTERNET Attachments Automated FTP Version 1.05.zip Automated FTP Version 1.05.zip 14.8 KB · Views: 1,561 Automated FTP Version 1.06.zip Automated FTP Version 1.06.zip 14.3 KB · Views: 2,151 FTP_Auto_Sample_Code_1.06.zip FTP_Auto_Sample_Code_1.06.zip 322.9 KB · Views: 2,353 Last edited: Mar 24, 2014 Click to expand...
New Automated FTP Library UPDATED 3-24-2014 - Version 1.06 changes the display scale and should look better on the larger display of a tablet. A sample project is now included which shows how to use this library. The sample code requires B4A 3.2+. You can open and view the code with older versions but it will not run because of the newer layout files. UPDATED 1-24-2014 - Version 1.05 adds a new function for checking for files or folders. It also contains a few other small fixes. The new command works for Files or Folders. If the last parameter is set to TRUE, it will look for folders, if the last parameter is set to FALSE it will look for files. Because the code runs in the background and is modeless you must have a callback sub in the calling module. Code samples below: Code: 'Call the command like this: FTP.FileOrFolderExist("plane.jpg" , "test/files", False) Code: 'Callback sub in calling module: Sub FTP_FileExist(Found As Boolean) If Found Then Log("True") Else Log("False") End Sub UPDATED 4-2-2013 - Version 1.02 Corrects an issue where PassiveMode was not working and also corrects an issue where UploadFileSet would not work from File.DirInternal. Automates the process of sending and receiving files using FTP with Wildcards & File Masks. Version 1.02 is attached. Please post/report back any issues you find, etc. This library has progress bars for Each File and overall progress. It handles wildcards and multi file types at the same time. Issue one command and transfer multiple files and multiple types! Change the colors, text size and words of all objects on the Progress Dialog to fit the look of your app. Also works in Stealth Mode! REQUIRES: B4A 2.5 + Copy the FTP_Auto.jar & FTP_Auto.xml files to the Extra Libraries folder. FTP_Auto Close Completes the current Que with any files left to process and then closes the connection. CloseNow Closes the connection and all other files in the Que are ignored and the process is terminated. DeleteFile (DeletePathAndFile As String) Deletes a single file from the server. Example: DeleteFile("public/pictures/airplane1.jpg") DeleteFileSet (VerifyBeforeDelete As Boolean) Delete the lastest FileSet in memory from the server. If you used a Mask to download a set of files, this function will delelete all files in that last set. NOTICE: use with care. DownLoadFile (LocalPath As String, ServerPath As String, FileName As String, Delete_FromServer As Boolean) Downloads a selected file from the FTP server and optionally deletes the file after successful download Example: DownLoadFile("/mnt/sdcard/pictures/", "public/downloads/", "airplane.jpg", False) DownloadFileSet (LocalPath As String, Files_Path_And_Mask() As String, Delete_FromServer As Boolean) Retrieves a list of files from the server matching the Mask(s) passed to Files_Path_And_Mask() array. You should include the full server path in the Mask. It will then download these files to the Folder passed in LocalPath. Files_Path_And_Mask() can contain one entry or however many is needed. Example: DownloadFileSet(File.DirInternal, Array As String("SM*.txt", "public/pictures/pla*.jpg"), False) IsInitialized As Boolean Tests whether the object has been initialized. Initialize (Activity As Activity, CalledFrom As Object, FTP_Site As String, UserName As String, PassWord As String, PortNumber As Int, ShowMessages As Boolean, UsePassiveMode As Boolean) As String Initializes the object for use. If True is passed for ShowMessages, additional messages will be displayed throughout the process. Use the keywords "Activity" and "Me" For the first two parameters. Example: Initialize(Activity, Me, "ftp.yourdomain.com", "userName", "PassWord", "Port", True, False) LastDownloadStats ( As ) As String Shows a popup window with the detials of the latest Download(s). LastProcessSuccessful As Boolean Returns True if the last Upload or Download process was successful, otherwise returns False. LastUploadStats ( As ) As String Show a popup window with details of the latest Upload(s). MakeDir (DirectoryName As String) Makes a directory on the FTP server. Does nothing if the directory already exist. If you want to make a directory in the root of the server and then a directory under it, you must issue the command twice. Example: MakeDir("test") MakeDir("test/datafolder") RemoveDir (DirectoryName As String) Removes selected directory from the FTP server SetColors (HeadingColor As Int, TotalProgressColor As Int, FileTextColor As Int, PanelBackgroundColor As Int, FrameColor As Int) Used to set colors of each Item in the status dialog. NOTE: Passing 0 for any argument with leave that item unchanged SetCompletedDownloadDialog (ShowCompletedDialog As Boolean, DialogText As String) If ShowCompletedDialog=True, it will show a dialog after the download process is completed. SetCompletedUploadDialog (ShowCompletedDialog As Boolean, DialogText As String) If ShowCompletedDialog=True, it will show a dialog after the upload process is completed. SetProcessCompleteOn (ProcessCompleteOn As Boolean) Use this function to determine by code when the Upload or Download is finished. The calling Activity must contain a sub named FTP_ProcessComplete. If your calling Activity includes this sub and you set this function to True, then the sub will be called as soon as the process has completed. EXAMPLE: 'Add this sub to calling Activity Sub FTP_ProcessComplete 'Your code here... End Sub SetStealthOn (UseStealth As Boolean) If set to True, no progress box will be displayed during the file transfer. If False the progress dialog will show during the file transfers. The default is False. SetStickyOn (MakeSticky As Boolean) If set to True, the progress box will stay on the screen until the user taps the Done button, otherwise the progress box will close as soon as the transfer is complete. The default is False. SetText (HeaderDownLoadText As String, HeaderUploadText As String, TotalProgressText As String, FileProgressText As String, ButtonCancelText As String, ButtonDoneText As String) Used to set the Text of the Item's status display. NOTE: May be used for different language, etc. SetTextSize (HeaderTextSize As Int, TotalProgressTextSize As Int, FileProgressTextSize As Int, CancelAndDoneTextSize As Int) Used to set the Text size of the Item's Text in the status dialog. NOTE: Passing 0 for any argument with leave that item unchanged UpLoadFile (LocalPath As String, ServerPath As String, FileToSend As String) Uploads a single file passed in FileToSend Example: UpLoadFile("/mnt/sdcard/pictures", "uploads/pictures", "vacation.jpg") UploadFileSet (ServerPath As String, Files_Path_And_Mask() As String, DeleteFileFromLocalDevice As Boolean) Retrieves a list of files from the local device. The Files_Path_And_Mask() array should contain the full path to the local devices files. It will then upload these files to the server. Files_Path_And_Mask() array can contain one entry or however many is needed. Example: UploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA*.jpg", "/mnt/sdcard/backups/contact*.dat"), False) WiFi_IsConnected As Boolean Check if Wifi is connected Returns True if connected otherwise returns False Permissions: ◦android.permission.ACCESS_WIFI_STATE ◦android.permission.INTERNET
D dcfax New Member Licensed User Longtime User Jun 6, 2013 #101 error if no "*" in filenames for FTP.UpLoadFile ? i can't use the uploadfileset with a simple list of files without "*" in the file names when i try : FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA*.jpg", "/mnt/sdcard/backups/contact*.dat"), False) ok, everythingis working good but when i try something like FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA52.jpg", "/mnt/sdcard/backups/contact01.dat"), False) i am getting an error : java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at ftp.auto.ftp_auto._vv1(ftp_auto.java:243) at ftp.auto.ftp_auto._vvvvvv0(ftp_auto.java:1518) at forver.dvd.main._button1_click(main.java:393) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:153) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:63) at android.view.View.performClick(View.java:4147) at android.view.View$PerformClick.run(View.java:17161) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:4788) 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:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556) at dalvik.system.NativeStart.main(Native Method) java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 and a few more testing show me that a get the same error while trying to put the "*" in the file extension : FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA0001.*pg"), False) an idea ? Last edited: Jun 6, 2013
error if no "*" in filenames for FTP.UpLoadFile ? i can't use the uploadfileset with a simple list of files without "*" in the file names when i try : FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA*.jpg", "/mnt/sdcard/backups/contact*.dat"), False) ok, everythingis working good but when i try something like FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA52.jpg", "/mnt/sdcard/backups/contact01.dat"), False) i am getting an error : java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at ftp.auto.ftp_auto._vv1(ftp_auto.java:243) at ftp.auto.ftp_auto._vvvvvv0(ftp_auto.java:1518) at forver.dvd.main._button1_click(main.java:393) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:153) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:63) at android.view.View.performClick(View.java:4147) at android.view.View$PerformClick.run(View.java:17161) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:4788) 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:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556) at dalvik.system.NativeStart.main(Native Method) java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 and a few more testing show me that a get the same error while trying to put the "*" in the file extension : FTP.UpLoadFileUploadFileSet("uploads/pictures/", Array As String("/mnt/pictures/VA0001.*pg"), False) an idea ?
dealsmonkey Active Member Licensed User Longtime User Jul 22, 2013 #102 Hi great library. I am able to upload to my ftp server no problem, however when I call the makedir command, I get the following error on the device. Any thought please, I am using version 1.02 Code: ftpauto.MakeDir("jobs") java.lang.NoSuchMethodError: anywheresoftware.b4a.net.FTPWrapper.SendCommand at ftp.auto.ftp_auto._vvvv2(ftp_auto.java:1150) at com.nejo.c2dm.frajobentry._uploadftp(frajobentry.java:3215) at com.nejo.c2dm.frajobentry._btnsync_click(frajobentry.java:901) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:153) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:63) at android.view.View.performClick(View.java:4204) at android.view.View$PerformClick.run(View.java:17355) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) ** Activity (frastartactivity) Create, isFirst = true **
Hi great library. I am able to upload to my ftp server no problem, however when I call the makedir command, I get the following error on the device. Any thought please, I am using version 1.02 Code: ftpauto.MakeDir("jobs") java.lang.NoSuchMethodError: anywheresoftware.b4a.net.FTPWrapper.SendCommand at ftp.auto.ftp_auto._vvvv2(ftp_auto.java:1150) at com.nejo.c2dm.frajobentry._uploadftp(frajobentry.java:3215) at com.nejo.c2dm.frajobentry._btnsync_click(frajobentry.java:901) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:153) at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:63) at android.view.View.performClick(View.java:4204) at android.view.View$PerformClick.run(View.java:17355) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) ** Activity (frastartactivity) Create, isFirst = true **
margret Well-Known Member Licensed User Longtime User Jul 22, 2013 #103 ftpauto.MakeDir("jobs") Click to expand... I have gone back and looked at the library code. I do not see anything that should cause this issue. What device are you using and what OS version is it running?
ftpauto.MakeDir("jobs") Click to expand... I have gone back and looked at the library code. I do not see anything that should cause this issue. What device are you using and what OS version is it running?
dealsmonkey Active Member Licensed User Longtime User Jul 22, 2013 #104 margret said: I have gone back and looked at the library code. I do not see anything that should cause this issue. What device are you using and what OS version is it running? Click to expand... Hi Margret, Using a Nexus 7 16Gb with OS 4.2.2 I will try the command on an "empty" project tomorrow and see if it still exists..
margret said: I have gone back and looked at the library code. I do not see anything that should cause this issue. What device are you using and what OS version is it running? Click to expand... Hi Margret, Using a Nexus 7 16Gb with OS 4.2.2 I will try the command on an "empty" project tomorrow and see if it still exists..
margret Well-Known Member Licensed User Longtime User Jul 22, 2013 #105 Also, try it with UsePassiveMode = True and then with UsePassiveMode = False in your Initialize call.
Also, try it with UsePassiveMode = True and then with UsePassiveMode = False in your Initialize call.
dealsmonkey Active Member Licensed User Longtime User Jul 22, 2013 #106 margret said: Also, try it with UsePassiveMode = True and then with UsePassiveMode = False in your Initialize call. Click to expand... Ok, I won't be back at my machine for 12 hours, but I'll try then
margret said: Also, try it with UsePassiveMode = True and then with UsePassiveMode = False in your Initialize call. Click to expand... Ok, I won't be back at my machine for 12 hours, but I'll try then
dealsmonkey Active Member Licensed User Longtime User Jul 23, 2013 #107 Hi Margret, tried with passive = true and false and also a clean project. still get the error : Code: aftp.MakeDir("new") java.lang.NoSuchMethodError: anywheresoftware.b4a.net.FTPWrapper.SendCommand at ftp.auto.ftp_auto._vvvv2(ftp_auto.java:1150) at b4a.example.main._activity_create(main.java:249) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at b4a.example.main.afterFirstLayout(main.java:89) at b4a.example.main.access$100(main.java:16) at b4a.example.main$WaitForLayout.run(main.java:74) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)
Hi Margret, tried with passive = true and false and also a clean project. still get the error : Code: aftp.MakeDir("new") java.lang.NoSuchMethodError: anywheresoftware.b4a.net.FTPWrapper.SendCommand at ftp.auto.ftp_auto._vvvv2(ftp_auto.java:1150) at b4a.example.main._activity_create(main.java:249) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169) at b4a.example.main.afterFirstLayout(main.java:89) at b4a.example.main.access$100(main.java:16) at b4a.example.main$WaitForLayout.run(main.java:74) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) 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:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)
margret Well-Known Member Licensed User Longtime User Jul 23, 2013 #108 OK, try the NET library and see if you get the same error. Unload my lib (uncheck it) and use the NET lib. Now try something like: Code: mFTP.SendCommand("MKD", "new") If you still get an error it must be related to 4.2.2 or the Nexus 7 device.
OK, try the NET library and see if you get the same error. Unload my lib (uncheck it) and use the NET lib. Now try something like: Code: mFTP.SendCommand("MKD", "new") If you still get an error it must be related to 4.2.2 or the Nexus 7 device.
dealsmonkey Active Member Licensed User Longtime User Jul 24, 2013 #109 Thanks again for the reply Margret. I am not at my machine today, so will not be able to do anything until tomorrow, UK Time ! I'll post my result when done.
Thanks again for the reply Margret. I am not at my machine today, so will not be able to do anything until tomorrow, UK Time ! I'll post my result when done.
dealsmonkey Active Member Licensed User Longtime User Jul 25, 2013 #110 margret said: OK, try the NET library and see if you get the same error. Unload my lib (uncheck it) and use the NET lib. Now try something like: Code: mFTP.SendCommand("MKD", "new") If you still get an error it must be related to 4.2.2 or the Nexus 7 device. Click to expand... When I try this I get the following error when compiling Code: B4A line: 1073 testftp.SendCommand(\ javac 1.6.0_21 src\com\nejo\c2dm\frajobentry.java:3281: cannot find symbol symbol : method SendCommand(anywheresoftware.b4a.BA,java.lang.String,java.lang.String) location: class anywheresoftware.b4a.net.FTPWrapper mostCurrent._testftp.SendCommand(processBA,"MKD","testfolder");
margret said: OK, try the NET library and see if you get the same error. Unload my lib (uncheck it) and use the NET lib. Now try something like: Code: mFTP.SendCommand("MKD", "new") If you still get an error it must be related to 4.2.2 or the Nexus 7 device. Click to expand... When I try this I get the following error when compiling Code: B4A line: 1073 testftp.SendCommand(\ javac 1.6.0_21 src\com\nejo\c2dm\frajobentry.java:3281: cannot find symbol symbol : method SendCommand(anywheresoftware.b4a.BA,java.lang.String,java.lang.String) location: class anywheresoftware.b4a.net.FTPWrapper mostCurrent._testftp.SendCommand(processBA,"MKD","testfolder");
margret Well-Known Member Licensed User Longtime User Jul 25, 2013 #111 What version of the NET lib do you have and did you Initialize the FTP object before the SendCommand?
What version of the NET lib do you have and did you Initialize the FTP object before the SendCommand?
dealsmonkey Active Member Licensed User Longtime User Jul 26, 2013 #112 margret said: What version of the NET lib do you have and did you Initialize the FTP object before the SendCommand? Click to expand... Version 1.35 and yes. This error came up when compiling to send to the device !
margret said: What version of the NET lib do you have and did you Initialize the FTP object before the SendCommand? Click to expand... Version 1.35 and yes. This error came up when compiling to send to the device !
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2013 #113 It seems like you are using an old jar file of Net library.
dealsmonkey Active Member Licensed User Longtime User Aug 2, 2013 #114 Hi Margret, Sorry for the delay in getting back on my issue. It was all MY fault !! I had copied the new net 1.35 library to my "Add Lib" folder instead of my "Lib" folder, so was still accessing the old net.jar !! Better get my noob hat out of the cupboard !!
Hi Margret, Sorry for the delay in getting back on my issue. It was all MY fault !! I had copied the new net 1.35 library to my "Add Lib" folder instead of my "Lib" folder, so was still accessing the old net.jar !! Better get my noob hat out of the cupboard !!
P Planet Member Licensed User Longtime User Aug 20, 2013 #116 hello margret thanks for the library, you think to add SendCommand in a future release?
margret Well-Known Member Licensed User Longtime User Aug 20, 2013 #117 Planet said: hello margret thanks for the library, you think to add SendCommand in a future release? Click to expand... Hello, I will add this to the lib soon.
Planet said: hello margret thanks for the library, you think to add SendCommand in a future release? Click to expand... Hello, I will add this to the lib soon.
dealsmonkey Active Member Licensed User Longtime User Aug 20, 2013 #118 Hi Margret, is it possible to increase the size of the upload progress box ? On my Nexus 7, the button is cut off half way down. I can upload a screen grab if needed. Ps. Great lib by the way, works like a charm
Hi Margret, is it possible to increase the size of the upload progress box ? On my Nexus 7, the button is cut off half way down. I can upload a screen grab if needed. Ps. Great lib by the way, works like a charm
margret Well-Known Member Licensed User Longtime User Aug 21, 2013 #119 dealsmonkey said: Hi Margret, is it possible to increase the size of the upload progress box ? On my Nexus 7, the button is cut off half way down. I can upload a screen grab if needed. Ps. Great lib by the way, works like a charm Click to expand... Yes, if you would, please post a screen grab so I can better understand what it's doing.
dealsmonkey said: Hi Margret, is it possible to increase the size of the upload progress box ? On my Nexus 7, the button is cut off half way down. I can upload a screen grab if needed. Ps. Great lib by the way, works like a charm Click to expand... Yes, if you would, please post a screen grab so I can better understand what it's doing.
dealsmonkey Active Member Licensed User Longtime User Aug 23, 2013 #120 margret said: Yes, if you would, please post a screen grab so I can better understand what it's doing. Click to expand... Sorry for the delay in doing this ! Attached is a screen shot. As you can see the progress box is relatively small and the button is cut off.. Attachments device-2013-08-23-165142.png 311.6 KB · Views: 556
margret said: Yes, if you would, please post a screen grab so I can better understand what it's doing. Click to expand... Sorry for the delay in doing this ! Attached is a screen shot. As you can see the progress box is relatively small and the button is cut off..