PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Windev Mobile (Android) File transfer
Windev Mobile (Android) File transfer
Iniciado por guest, 30,mar. 2015 17:12 - 10 respuestas
Publicado el 30,marzo 2015 - 17:12
Hi all,

I would like to transfer an image from my mobile device to my computer.
I thought about setting up a http or ftp server on my android device.
But I do not know how to establish this.
Or if there are any better solutions.

Thanks in advance,

Regards,
Koen
Publicado el 30,marzo 2015 - 17:16
Hi there's an android ftp example program, that's what I used.
Publicado el 01,abril 2015 - 15:27
Dear iso,

Checked the example, but this isn't what I meant.
In this example the phone connects with a FTP server.
My intension was to use the phone as a FTP server.
Is this possible?

Regards,
Koen
Publicado el 01,abril 2015 - 16:22
Hi Koen

everything is possible if you know how to code it... By example, AirDroid clearly implements a http server to accomplish files transfer and much more...

For a http server, that would mean a socket open on one port (from the top of my head, airdroid is using 8080, not 80, so there may be some compatibility issues here), and then implementing the whole http protocol behind it so that a standard browser can connect to the phone IP address+port

It is of course much more complex that way...

Personally, I use a webdev awp page on the server, and the android app is polling it to do anything (including files transfers)... MUCH simpler to implement.

Best regards
Publicado el 01,abril 2015 - 17:26
You can find a lot of free ftp server programs for android why don't you use one of them?
I don't thing that coding one ftp server isn't the best spent time.
Publicado el 01,abril 2015 - 17:40
Hi Rik,

Why not using Bluetooth socket with GenericFileTransferServiceClass_UUID? <a class="ExternalLink" rel="nofollow" target="_blank" href="http://doc.windev.com/en-US/?1000017167">http://doc.windev.com/en-US/&hellip;</a> (I never played with that but might help in your case?)

Also, if you are master of both ends, you can simply create a simple TCP/IP socket in WinDev to transfer the files. But you will have quite some coding to do to manager a simple protocol and file integrity check.

In any case, this will require quite some work on your part, but I agree with other that trying to reimplement existing standard protocols is not a good idea.

I do not know what is you need but you can also use existing applications that just does that file transfer over wifi.

Best regards,
Alexandre Leclerc
Publicado el 01,abril 2015 - 17:49
Hi Rik,

As an additionnal note, there exist a Java Web Server called "Tiny Java Web Server" on sourceforge that you could use in case you really want to go this way: http://tjws.sourceforge.net/

There is also an apache solution to this problem: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://www.devlper.com/2010/12/a-bare-minimum-web-server-for-android-platform/">http://www.devlper.com/2010/12/a-bare-minimum-web-server-for-android-platform/</a>

Best regards,
Alexandre Leclerc
Publicado el 01,abril 2015 - 18:00
Hi Alexandre,

Thank you for your Bluetooth solution.
Though it would not be applicable, most desktop pc's don't have that kind of hardware anymore.
Also thanks a lot for your additional note! It may come handy if a standard application won't do the trick.

Regards Koen
Publicado el 01,abril 2015 - 18:03
Hi Fabrice,

Thank you, but this won't be an option.
Not all of my clients have a server.
That's why I thought about android running one.

Maybe the other way around is a better one?
Hosting a ftp server on the PC then connecting with my android?

Regards,
Koen
Publicado el 01,abril 2015 - 19:00
Hi Rik,

The FTP server on the PC is a very simple solution for you to implement. And FileZilla Server will do the job very well.

Best regards,
Alexandre Leclerc
Publicado el 02,abril 2015 - 17:33
Hi Alexandre,

THank you for your suggestion.
Though I do not think I can implement it in my software.

Found a way to start a Windev FTP server. (NetStartServer)
But when I try to connect with the server using the normal FTP function it just crashes without error report nor timout. Edited "WDRPCSRV.INI" for the username + password.

Code I use:
NetStartServer(FTPServer,False,2211)
FTPConnect(NetIPAddress(),"USERNAME1","PASS1",2211)

If I try to connect with:
NetConnect(NetIPAddress(),FTPServer,"USERNAME1","PASS1",False,INTRANET,2211)
It does function. But this function is not supported by Windev Mobile.
Any suggestions?

Thanks in advance,

Regards,
Koen