Android Question Best way to send data back to server?

dadelayer

New Member
If I have a file (.txt or .csv) that was created from the B4A app, what would be the easiest way to send the file back to a server and vice versa?


I'm using the trial version, so I'm not sure if I have access to some of the libraries that are used in the tutorials.
For example, I was thinking of sending the file via email (SMTP) but I don't know if the trial version can do that.
 
Last edited:

udg

Expert
Licensed User
Longtime User
I would say that it depends on what services are available on your server.
If it allows FTP (or , better, SFTP) you can use that.
OkHttpUtils2 library let's use commands like POST to send bunches of bytes to a receiving service (which has to reassemble the inital file)
If the server has running a webserver with upload/download functions you may interact with those (webview and javascript injection)
 
Upvote 0

dadelayer

New Member
I would say that it depends on what services are available on your server.
If it allows FTP (or , better, SFTP) you can use that.
OkHttpUtils2 library let's use commands like POST to send bunches of bytes to a receiving service (which has to reassemble the inital file)
If the server has running a webserver with upload/download functions you may interact with those (webview and javascript injection)

It's a Windows Server so the tools I can use are whatever is available and can work with B4A. I should have mentioned that in the first post, sorry abotu that.
I guess I could setup an FTP server and lock it down to just a specific path/folder.
Only problem with that is the plain password will be in the app, and if someone figures it out, they can upload some malicious stuff there too no?
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Since you have full control on the server, you could set up a webservice (or similar mechanism) to be called by the mobile app in order to receive valid credentials for the FTP service. The ws would use common methods to authenticate the user (e.g jwt, credentuals, license code..).
 
Upvote 0
Top