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

Status
Not open for further replies.

NeoTechni

Well-Known Member
Licensed User
Longtime User
You can encrypt the password.

I'm having trouble with the lib on my gmail account. POP refuses to initialize, but the other one does just fine
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
JAVA.LANG.RUNTIMEEXCEPTION: POP3 SHOULD FIRST BE INITIALIZED, even though I have initialized it

One containing the text "Error listing messages"
But it sends email just fine.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Yes, but when I get the error, I forcefully reinitialize it, and I still get that error.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I think I figured it out. I was being too aggressive with the CheckEmail routine.
 

Mahares

Expert
Licensed User
Longtime User
According to Erel, MailParser doesn't support all possible formats. Has anybody been able to get it to parse from email clients other than Gmail, particularly Outlook. If so, can you provide some tips or help.
Thanks
 

aggelos

Member
Licensed User
Longtime User
Hello,

I am using b4a 3.82 on nexus s 4.1.2

i can upload and download files but i cannot use the ftp.sendcommand

I have this code
B4X:
Dim FTP1 As FTP

FTP1.Initialize("FTP1",txtFTPserverhost.Text,txtFTPserverport.Text,txtFTPserveruser.Text,txtFTPserverpass.text)
FTP1.SendCommand("MKD" , "/ftptest")


when i press ALT+3 i get this message from b4a

B4X:
---------------------------
Basic4android
---------------------------
An error occurred.
B4A line: 459
FTP1.SendCommand(\
javac 1.7.0_25
src\eu\sitediary\client\showftpsync.java:442: error: cannot find symbol
mostCurrent._ftp1.SendCommand(processBA,"MKD","/ftptest");
  ^
  symbol:  method SendCommand(BA,String,String)
  location: variable _ftp1 of type FTPWrapper
---------------------------
ΟΚ   
---------------------------

help?
 

aggelos

Member
Licensed User
Longtime User
1.53 .downloaded yesterday

Am i missing a library dependancy?
I also downloaded and installed java 1.8. same error message

And i tried using an empty project with only core 3.80 and net 1.53 libs selected. same error
 

aggelos

Member
Licensed User
Longtime User
Thank you, there was a net.jar in the internal libraries folder from the old days 2011.
as soon i removed it everything runs ok.
 

aggelos

Member
Licensed User
Longtime User
If you need utf-8 support with your FTP use this code exactly after FTP1.initialize.....
Tested with English and Greek characters on Filezilla FTP server 0.9.48

B4X:
Dim r As Reflector
r.Target=FTP1
r.Target = r.GetField("client")
'Log("current encoding " & r.RunMethod("getControlEncoding"))
r.RunMethod2("setControlEncoding","UTF-8","java.lang.String")

I also use the following command but this depends on the FTP Server and most modern servers are already using UTF8
So you may not need this line.
FTP1.SendCommand("OPTS UTF-8 ON","")
 

touchsquid

Active Member
Licensed User
Longtime User
I have been trying to use the NET library 1.53 to upload files to my server. I can't even get a directory listing. It works fine with a browser or FTP app on my PC.

I tried with the following test web site which does not need credentials:

ftp://ftp.kernel.org/

The error returned in all cases is success = false and this error:
libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)

I am using a real Android 4.4.2 device, not the emulator. Any ideas would be appreciated.
Dim MyFTP as FTP
MyFTP.Initialize("FTP1", "ftp://ftp.kernel.org/", 21 , "", "")
MyFTP.List("/")
 

touchsquid

Active Member
Licensed User
Longtime User
I tried that too, still the same result. However I gave up on FTP and used an ASMX web service instead and it works fine.
 

rebuz

Member
Licensed User
Longtime User
I get an error by sending a Mail over SMTP. can i change the trustet level like:

cert.InitializeAcceptAll for smtp?


regards, Remo
 

rebuz

Member
Licensed User
Longtime User
Hi Erel,
Thx for watch my problem, her the Log


thx
regards Remo
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…