Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
11
Erster Beitrag:
vor 3 Jahren, 2 Monaten
Letzter Beitrag:
vor 3 Jahren, 2 Monaten
Beteiligte Autoren:
Rik, Alexandre Leclerc, Paulo Oliveira, Fabrice Harari, iso

Windev Mobile (Android) File transfer

Startbeitrag von Rik am 30.03.2015 15: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

Antworten:

Hi there's an android ftp example program, that's what I used.

von iso - am 30.03.2015 15:16
Dear iso,

Thank you for your fast response
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

von Rik - am 01.04.2015 13:27
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

von Fabrice Harari - am 01.04.2015 14:22
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 is the best spent time.

von Paulo Oliveira - am 01.04.2015 15:26
Hi Rik,

Why not using Bluetooth socket with GenericFileTransferServiceClass_UUID? http://doc.windev.com/en-US/?1000017167 (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

von Alexandre Leclerc - am 01.04.2015 15:40
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: http://www.devlper.com/2010/12/a-bare-minimum-web-server-for-android-platform/

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 01.04.2015 15:49
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

von Rik - am 01.04.2015 16:00
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

von Rik - am 01.04.2015 16:03
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

von Alexandre Leclerc - am 01.04.2015 17:00
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

von Rik - am 02.04.2015 15:33
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.