B4A Library New Net library - Android FTP, SMTP and POP3

Status
Not open for further replies.

JATAIDE

Member
Licensed User
Longtime User
WHEN I use the net library v 1.53, there is no error in the compilation of the program, but in execution it crashes.
can you help me
Tablet Samsung 10
b4A v 2.52

thank you
 

JATAIDE

Member
Licensed User
Longtime User
Yes. But only if you post the error message from the logs.


error message

~i:** Activity (main) Resume **
~i:** Activity (main) Pause, UserClosed = false **
main_process_globals (java line: 2802)
java.lang.NoClassDefFoundError: anywheresoftware.b4a.net.FTPWrapper
at trans.capiart.sa.main._process_globals(main.java:2802)
at trans.capiart.sa.main.initializeProcessGlobals(main.java:1101)
at trans.capiart.sa.main.afterFirstLayout(main.java:85)
at trans.capiart.sa.main.access$100(main.java:16)
at trans.capiart.sa.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:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)

thank you
 

JATAIDE

Member
Licensed User
Longtime User
Are you doing anything other than declaring the FTP object in Process_Globals?


yes i use other varibles for utilization of the program acess in the other modules


Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

Dim utilizador ,firmaescolhida, tipoescolhido, placaescolhida, MAQUINAS,metergasoleo,menu,valordoficheiro,filenam As String
Dim reverficheiro,metergasoleox,contacondutor As Int
Dim FTP As FTP

End Sub




now created another simple program just to check and the following error

program:


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)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("menu")

If FirstTime Then
FTP.Initialize("FTP", "xxxxxx.com", 21, "ccccccc.com", "xyz")
End If

FTP.UploadFile(File.DirRootExternal & "/Android/data/artur.capitao/malaxeurpdf/", "2005.pdf", True, "/home/ecalmodo/public_html/jataide")

End Sub




error:


Installing file.
~i:** Activity (main) Pause, UserClosed = false **
PackageAdded: package:b4a.example
main_process_globals (java line: 279)
java.lang.NoClassDefFoundError: anywheresoftware.b4a.net.FTPWrapper
at b4a.example.main._process_globals(main.java:279)
at b4a.example.main.initializeProcessGlobals(main.java:259)
at b4a.example.main.afterFirstLayout(main.java:85)
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:175)
at android.app.ActivityThread.main(ActivityThread.java:5279)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
~i:** Activity (main) Resume **

thank you one more time
 
Last edited:

JATAIDE

Member
Licensed User
Longtime User
Delete Net.jar from both the internal libraries folder and the additional libraries folder and copy it again.

Thank Erel, I just bought the entreprise version and the program already works witout crash, great version
 

GerdW

Member
Licensed User
Longtime User
Hello!

I'm B4A-Beginner and I'm full of praise for this work, not only for the programming-tool but also for the documentation around.
Now my question concerning FTP: I use the NET-Library. Downloading files and other functions work without problems, but the event-subs
"FTP_DownloadProgress" and "FTP_DownloadCompleted" are not included (provided) by the system (no reaction).

My Code:
  • Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
  • Log(ServerPath & ", Success=" & Success)
  • If Success = False Then Log(LastException.Message)
  • Msgbox("Download OK","") ' Zum Testen - For test purposes
  • End Sub

Is there anything to do, to accept these subs?

Thank you in advance
Gerd Walter
 

AscySoft

Active Member
Licensed User
Longtime User
Hi Erel and everyone
I want to send two different emails(not the same body, and not the same address and one without attachment) at once(one after another); how can I discover witch one of the emails has been sent correctly and witch one doesn't? I am having trouble with some large file being attached/ Does SMTP MessageSent could be change? Or does it display results in the same order as SMTP.Sent command was given?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is there anything to do, to accept these subs?
Where is the code that initializes the FTP object?

SMTP messages are sent one after another.
If you are only sending two messages then it is safe to assume that the order of MessageSent events is the same as the order of SMTP.Send calls.
However you can always send the next message from the event and have full control over the order (it will not be slower).
 

GerdW

Member
Licensed User
Longtime User
Where is the code that initializes the FTP object?

Hi Erel,

sorry, my question was obviously unnecessary. I just saw (after a restart of my system and of cours B4A) that now all works as it should do. I can't explain it, as I did'nt change anything.

Thank you for your effort,
 

AscySoft

Active Member
Licensed User
Longtime User
Last edited:

catyinwong

Active Member
Licensed User
Longtime User
"500 I won't open a connection to 192.168.0.102 (only to 14.199.234.149)"
What does it mean??
 

catyinwong

Active Member
Licensed User
Longtime User
Now I have set the passivemode to true. And then a new error popped up:
553 Can't open that file: No such file or directory

But the destination folder is already existing on the FTP server...
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…