2

I need to send a binary file (or a Bitmap object) from Android to a PC, which runs a Python script to receive it. Has anybody been in the same situation or has any hints, what could be best practice here? Options are sockets or Webservice (besides from workarounds with samba etc) I guess, but what is the easiest and fastest to implement?

Cheers, Marc

stk
  • 6,311
  • 11
  • 42
  • 58

2 Answers2

1

Just doing a HTTP POST containing data to a web server should do the job. This way you have a myriad of frameworks to choose from, which saves you from doing the dirty work of pushing bits back and forth. Sure, there is some overhead, but unless you have specific reasons to avoid that (which were not mentioned in the question), I think this is the most straightforward approach.

Additionally, when the application grows, you can extend this to a full REST style interface later on.

Waldheinz
  • 10,399
  • 3
  • 31
  • 61
0

This answer will help you out on the client side:

How to upload a file using Java HttpClient library working with PHP

for additional details - library to use, where to download it, etc.. see: http://vikaskanani.wordpress.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-part/

Community
  • 1
  • 1
Someone Somewhere
  • 23,475
  • 11
  • 118
  • 166