[Q] Best way to upload file - Java for Android App Development

Hi everyone. What's the best way to upload a file ?
ex file location "sdcard/mydir/example.txt"
thanks in advance

alessandrospa said:
Hi everyone. What's the best way to upload a file ?
ex file location "sdcard/mydir/example.txt"
thanks in advance
Click to expand...
Click to collapse
You should say whether you want to upload it to your own server, to a social network or to a cloud service.
Then people will be able to help you.

oh yes, sorry. I want upload it to a cloud(Dropbox or Google Drive)

alessandrospa said:
Hi everyone. What's the best way to upload a file ?
ex file location "sdcard/mydir/example.txt"
thanks in advance
Click to expand...
Click to collapse
As an example, for one of my projects, I am uploading an image (drawing.png) to my server. This is part of an AppEngine web app so first I get a url (responseUrl) that I can post to and then use a HttpClient to execute the post request:
Code:
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(responseUrl);
try
{
[INDENT]MultipartEntity entity = new MultipartEntity();
File image = new File(getFilesDir().toString() + "/drawing.png");
entity.appPart("data",new FileBody(image,"image/png"));
httpPost.setEntity(entity);
HttpResponse response = httpClient.execute(httpPost);[/INDENT]
}
catch(IOException ex)
{
[INDENT]Log.e("deScribe",e.getMessage()+"");[/INDENT]
}

Look at these:
https://www.dropbox.com/developers/core
https://developers.google.com/drive/
http://koklimabc.blogspot.de/2012/12/how-to-programatically-upload-file-from.html
They might help you. Good luck!
(And please be so kind to press the Thanks button whenever someone helps you.)

I always suggest amazon S3 to upload stuff Sorry if it's a bit OT

Related

FTP-server for all! [ Info updated! ]

Don't forget this mirror when sharing apps, ROMs etc:
Use to upload: ftp://xda:[email protected]/
Use to post: ftp://minftp.myftp.org/
For developers of any kind:
Do you need full control of your releases, addons etcetera?
Send me an message!
News: I had to reorganize some files and folders on the server so please review your links to my ftp in your posts!
Disclaimer:
I take no legal responsibility for the contents posted at my FTP.
EOD.
Mod edit:
I sticky this, so that ppl will keep it fresh in mind
thx~~~~~~~~~~~~~
mostberg said:
My ftp-server is avaiable for dl and ul: for ul: usr = xda pwd = xda ftp://ftp.mostberg.se/
regards
Click to expand...
Click to collapse
Thanks so much
Can explain more on the files that in Xperia folder?
mostberg said:
My ftp-server is avaiable for dl and ul: for ul: usr = xda pwd = xda ftp://ftp.mostberg.se/
regards
Click to expand...
Click to collapse
I want to know how to play movie by TCPMP:?
awesome
thanks! this is great

[Q] Create a pdf file dynamically

hi
I want to create a PDF file dynamically in android application.
like File f = new File("sample.pdf");
we have to use any external api for this? any idea?
how can i do that?
Hi,
I found the solution and without using itext we can displaly pdf file.
Thanks
mindus
mindus said:
Hi,
I found the solution and without using itext we can displaly pdf file.
Thanks
mindus
Click to expand...
Click to collapse
What solution did you find?

longclick webview link - get url of link

I can attach a longclickListener to the webview (webview.setOnLongClickListener(l)), but how do I get the url of a long clicked link?
Thanks
anyone ideas ? bump

[Req] Modaco Deodex Script

Hello guys,
I've been trying to download modaco-deodex-1.1.zip script but the download site is blocked here i dunno why !
so can anyone re-upload it to mediafire or 4shared?!
thanks in advance
Give me the link & I will do it for you
here's the link
http://loadbalancing.modaco.com/download.php?url=paul/modaco-odex-1.1.zip
sorry for being late
Same Problem here.
Thing the file doesnt exist.
Greetz
You can use this instead : http://forum.xda-developers.com/showthread.php?t=915732
Sine. said:
You can use this instead : http://forum.xda-developers.com/showthread.php?t=915732
Click to expand...
Click to collapse
I would also recomend this application.

[REQ] Samsung Smart Switch APK

Hi Guys,
Looking for the Samsung Smart Switch APK file for mobile. its a free app from Samsung I live in Australia and its only available in the US. Haven't had the luck of finding a download link, If some one has it could you please post it up.
Thank you
Download it here:http : // pan.baidu.com/share/link?shareid=2663796561&uk=4060570179
Notice:delete space characters between http : // pan
csun72 said:
Download it here:http : // pan.baidu.com/share/link?shareid=2663796561&uk=4060570179
Notice:delete space characters between http : // pan
Click to expand...
Click to collapse
Thanks mate
hoglak said:
Thanks mate
Click to expand...
Click to collapse
Link broken - can you post it back up please mate :fingers-crossed:

Categories

Resources