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

Discussion in 'Additional libraries, classes and official updates' started by Erel, Aug 17, 2011.

Thread Status:
Not open for further replies.
  1. Hubert Brandel

    Hubert Brandel Active Member Licensed User

    I will do that.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    v 1.52 allows you to set the authentication method used in SMTP calls.
    For example:
    Code:
    smtp1.Initialize(...)
    smtp1.AuthMethod = smtp1.AUTH_LOGIN
     
  3. biometrics

    biometrics Active Member Licensed User

    Martin,

    Has NetExtas been updated to match the latest Net library?
     
  4. biometrics

    biometrics Active Member Licensed User

    Erel,

    Has the FTPS explicit mode been completed?
     
  5. warwound

    warwound Expert Licensed User

    See here: http://www.basic4ppc.com/android/forum/threads/lib-netextras.26902/#post-231566.
    I updated NetExtras to match version 1.51 of the Net library - Erel kindly sent me the Net library version 1.51 source code.
    I was waiting for you to reply to my post in the NetExtras thread, since then the Net library has been updated again.

    Can i ask Erel to send me the source code for the latest version of the Net library and i'll again update NetExtras?

    Thanks.

    Martin.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Yes.

    I will send you the code.
     
  7. biometrics

    biometrics Active Member Licensed User

    Hi Erel,

    I'm trying our the new library for FTPS explicit mode. I assume I need to use the new property to enable it?

    Code:
    libFTP.UseSSLExplicit = True
    I am getting the following error though:

    Do I need to set libFTP.SetCustomSSLTrustManager to something?

    It's the same sample I sent you on 14 March but the login is different. Can I email it to you to try?

    I can confirm it works with other software like FileZilla client on Windows for example.
     
    Last edited: May 5, 2014
    Mohammed Ghoname likes this.
  8. biometrics

    biometrics Active Member Licensed User

    Erel,

    Not to worry. A bit of searching led me to the new object CustomTrustManager.
     
  9. biometrics

    biometrics Active Member Licensed User

    Hi Erel,

    Got an interesting problem that I managed to do a workaround for ...

    On the Samsung Galaxy Tab 3 when downloading large files (> 150 MB) with FTP the DownloadCompleted event does not fire when the file has been downloaded. It does fire correctly on small files (< 1 MB) and on other devices. DownloadProgress does fire though.

    I worked around this by monitoring the DownloadProgress event. When the local and remote files are the same size I set a 10 second timer. If DownloadCompleted fires I disable the timer. If DownloadCompleted doesn't fire then my timer fires. At that point I restart the whole FTP process (it resumes).

    The only gotcha was that I had to Dim the FTP library again before the Initialize (or else it wouldn't connect again). I have it declared in Process_Globals. I saw you mention in another thread that you had to Dim it again (which is counter to what I would have expected coming from VB6).

    I'm using the Net and NetExtras 1.52 libraries with SSL explicit.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Have you checked the unfiltered logs for any error message?
     
  11. biometrics

    biometrics Active Member Licensed User

    Hi Erel,

    When I run it in debug mode then the DownloadProgress event does not fire often and it appears to hang at the end. So I have to run it in release mode. I clicked Connect in the Log window and this is the result (no errors and no DownloadCompleted event):

    Code:
    LogCat connected to: B4A-Bridge: samsung GT-P5200-357359055991177
    --------- beginning of /dev/
    log/main
    Failure getting entry 
    for 0x01080a03 (t=7 e=2563in package 0 (error -75)
    Parent 
    view is not a TextView
    Failure getting entry 
    for 0x01080a03 (t=7 e=2563in package 0 (error -75)
    Failure getting entry 
    for 0x01080a03 (t=7 e=2563in package 0 (error -75)
    loaded /vendor/lib/egl/libEGL_POWERVR_SGX544_115.so
    loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so
    loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so
    Enabling debug mode 
    0
    ** 
    Activity (main) Create, isFirst = true **
    ** 
    Activity (main) Resume **
    Setting install_non_market_apps has moved from android.provider.Settings.Secure 
    to android.provider.Settings.Global.
    ** 
    Service (service1) Create **
    Rejecting registerization due 
    to mul-int/lit8 v4, v2, (#31)
    Rejecting registerization due 
    to mul-int/lit8 v4, v2, (#31)
    ** 
    Service (service1) Start **
    Total arena pages 
    for JIT: 11
    Total arena pages 
    for JIT: 12
    Total arena pages 
    for JIT: 13
    Total arena pages 
    for JIT: 14
    Total arena pages 
    for JIT: 15
    Total arena pages 
    for JIT: 16
    Total arena pages 
    for JIT: 17
    Total arena pages 
    for JIT: 18
    Total arena pages 
    for JIT: 19
    Total arena pages 
    for JIT: 20
    Connected 
    to B4A-Bridge (Wifi)
    Rejecting registerization due 
    to and-int/lit16 v0, v5, (#128)
    Rejecting registerization due 
    to and-int/lit16 v0, v5, (#128)
    Installing 
    file.
    Rejecting registerization due 
    to move v5, v4, (#0)
    GC_CONCURRENT freed 2610K, 
    41% free 6189K/10380K, paused 2ms+1ms, total 54ms
    Rejecting registerization due 
    to move v5, v4, (#0)
    ** 
    Activity (main) Pause, UserClosed = false **
    PackageAdded: package:isenzo.clientele.ifa
    ** 
    Activity (main) Resume **
    Setting install_non_market_apps has moved from android.provider.Settings.Secure 
    to android.provider.Settings.Global.
    The Samsung Galaxy Tab 3.0 10.1 has a Intel Atom Z2560, not ARM. Don't know if that would make a difference.
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    It is worth trying to download the file without NetExtra to see where is the problem.
     
  13. biometrics

    biometrics Active Member Licensed User

    Hi Erel,

    It's in the Net library. I tested it without NetExtras and it does the same thing.
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Is it possible that the activity was paused when the download completed?
     
  15. biometrics

    biometrics Active Member Licensed User

    No I have the following active:

    Code:
    libPhoneWakeState.KeepAlive(True)
    libPhoneWakeState.PartialLock
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    I did a test with this code:
    Code:
    Sub Activity_Create(FirstTime As Boolean)
       
    Dim ps As PhoneWakeState
       ps.KeepAlive(
    True)
       
    FTP.Initialize("ftp""xxx"21"aaa""bbb")
       
    FTP.DownloadFile("/xxx"FalseFile.DirRootExternal, "1.dat")
    End Sub

    Sub FTP_DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long)
       
    Log(NumberFormat2(TotalDownloaded, 000True))
    End Sub

    Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
       
    Log(ServerPath & " " & Success)
    End Sub
    It successfully downloaded a 163MB file. DownloadCompleted fired at the end. I ran it in rapid debug mode.
     
  17. biometrics

    biometrics Active Member Licensed User

    As mentioned it works on other devices and also with smaller files on this device. It's specific to the Samsung Galaxy Tab 3 10.1. I have no idea why it doesn't fire but at least my workaround works. I'd obviously prefer if it worked the way it should but in the mean time we can ship the product.
     
  18. biometrics

    biometrics Active Member Licensed User

    Hi Erel,

    How do I setup the FTP for a proxy server?
     
  19. Erel

    Erel Administrator Staff Member Licensed User

    It is not possible to set a proxy server with this library.
     
  20. biometrics

    biometrics Active Member Licensed User

    Hi Erel,

    Is that because of the underlying libraries limitations or is it possible to add it? If it is possible to add it we can contract Martin/warwound to add it to his Net Extras as he did for us with the Download Resume (if he is available). We'll happily pay him for that work.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice