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

Status
Not open for further replies.

biometrics

Active Member
Licensed User
Longtime User

Hi Erel,

I'm having this problem of the event not firing on other devices as well for example the VIA VT-6078 with Android 4.0.3. So it's not only the Samsung Galaxy Tab 3 10.1.

Even though I have a workaround it's not ideal and wastes time & resources.

Is there anyway for you to fix this?

(btw I'm using FTPS)
 

biometrics

Active Member
Licensed User
Longtime User
I'm sorry but I was unable to reproduce it. I tested it on several devices.
Hi Erel,

Thanks for the effort.

I think I have a clue for you how to replicate it ...

I think it is related to how long the download takes, not necessarily the file size. Small files which download under a minute works fine (the event fires) but large files which take about 20 minutes fails (event doesn't fire).

We only have a shared 4 Mbps connection at our office (old part of the city with old infrastructure) so it takes a while to download.

To replicate the problem, you'll need to either throttle your connection speed, or use a slow connection, or easiest is to just use a large file of a couple of GB. Basically make the download take 20 minutes.
 

biometrics

Active Member
Licensed User
Longtime User
Call PhoneWakeState.KeepAlive and see whether it helps.

As downloads are critical to the functioning of our app we do that:

B4X:
libPhoneWakeState.KeepAlive(True)
libPhoneWakeState.PartialLock
 

Jausa

Member
Licensed User
Longtime User
¡Hello!
How can i read multiple files from a folder and add them as attachmets.

I know that i just have to use the SMTP.AddAttachment(Route, Name) Statement
But i don't know how to read all the files from that route.

¿Some For Each statement?
¿Any example?
 

M.LAZ

Active Member
Licensed User
Longtime User


he
wow great, how did you put the code into a service module?
 

Shadow&Max

Active Member
Licensed User
Longtime User
This is working perfectly for me. However, I'm only using the net library to send one anonymous email from the program once, and the "Full Network Access" permission will be very scary for my users when the app gets out there this weekend or on Monday.

Is there anything I can use, other than this net library, that will allow me to send the anonymous email without the horrendous, scary "Full Network Access" permission?

If not, I'll have to try to figure out another way to do this because I think I'll lose buyers with the permission...
 

Shadow&Max

Active Member
Licensed User
Longtime User
Thanks Erel... yes, I tried removing it, and the Full Network Access is still there. Which one of these libs is causing this? Is it the Phone????

Camera
Content Resolver
Core
DateUtils
Dialogs
Gestures
JavaObject
Net
Notification Builder
Phone
RandomAccessFile
Reflection
SQL
TTS

OK, I did click the List Permissions button, and I see Internet access for Webviewer and SMTP... Is that what's generating the "Full Network Access" permission on my Moto-X and on the emulator? Seems like a pretty frightening permission, although I haven't installed a lot of other apps on my own phone...

If this is a "standard" permission of most apps, then I won't worry about it.
 
Last edited:

Shadow&Max

Active Member
Licensed User
Longtime User
Thanks again Erel... Yes, I did that and figured out all of the permissions. Thank you.

It also occurred to me that most apps will require network access, so I'm not going to worry about it.

Thank you again.
 

Mahares

Expert
Licensed User
Longtime User
I use pop3 mailparser to download attachments to a given folder in the device. I use an input box to enter the device’s owner password before the initialization process.

How can I verify that the password entered matches the owner’s stored password, so I can use it in the initialization line below without having to look it up inside a text file or map:

pop.Initialize("pop.gmail.com", 995, AccountName, MyPassword, "pop")
 

Mahares

Expert
Licensed User
Longtime User
You can call pop.ListMessages. If it succeeds then the user name and password are correct.
How can you do a pop.Listmessages before the pop is initialized? I need to find out what the password is before initialization so I can put in this code: pop.Initialize("pop.gmail.com", 995, AccountName, MyPassword, "pop")
Extracting it from a file is not safe.

SOLVED by adding this code:
B4X:
Sub Activity_Resume
    If pop.IsInitialized=False  Then
        pop.Initialize("pop.gmail.com", 995, accountName, MyPassword, "pop")
        pop.useSSL = True  'very important must be below the initialize line
    End If
End Sub

However, I can ONLY use a Gmail account to send and receive in order for the attachments to save. If POP3 mailmarper works with other email clients, I have not been able to make it work.
Thank you
 
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…