After countless headaches and time wasted I managed to get the AudioRecorder working for Android and have a file stored on my SDcard. What I want to do now is send this file to a server within the application. So when the user hits submit...it sends the .3gp file. Is this possible? Thanks
I'd recommend that you just use HTTP and POST it to your server.
Here's a good little code snippet that shows how to do an HTTP post from java.
http://rapidandroid.org/wiki/HttpUpload
Then you'll have to receive the file on your server. You could just use a simple php script for that unless you have some other server side technology.
Here's some documentation for doing this using php:
http://www.tizag.com/phpT/fileupload.php
yes you should use FTP because it will be faster...
I had done bit R&D on it and found few link but most of them were not working.
here is the link that is working for FTP upload..
http://www.jibble.org/simpleftp/
Related
Is there any way we can upload file from android phone to a server without using PHP
all the examples I found were with PHP
is there any other way?
I had to use FTP to do this. could not find answer for http
I need to download a set of files from server via ftp. For example say ftp://ftp.example.co.uk/folder1/textfile1
I cant seem to find much information about using ftp and android. Can in be done in the same way as an http network request http://developer.android.com/training/basics/network-ops/connecting.html
If not, can someone point me to a tutorial on how to do so.
Have you considered formatting your file to base64 and creating a web service to handle the request?
ok so i need to upload files directly to server without using any web service from android ..
first i am doing so with REST web service but the thing is it always say transaction is too large when executing my request .... in android i convert the image into byte[] then into Base64 string from my server side i decode this Base64 string and write bytes into file.
how can i upload directly to folder on my server ... something like executing a function that upload the file to "localhost/myWebApplicationDir/images/"then file here.jpg"
You will need to implement something that handles uploads as webservers typically don't do that out of the box. I'm sure you can find a POST upload script written in PHP somewhere on google. Then implement some code that POSTs the file to the endpoint and you should be fine.
There are no out-of-the-box tools for this but it's not a lot of work.
i found this link to be very helpful i discovered that you need an open connection with the server and communicate with streams something like keeping connection alive and upload files bit by bit.... but still you need a web service like #meredrica said.
http://ihofmann.wordpress.com/2013/01/23/android-sending-post-requests-with-parameters/
How can we capture photo and upload on server in phonegap application.
Server side code is mvc4 C# action.
We have to send two more values (name and ID) on server with image.
I can't speak to the android or phonegap piece, but for your MVC action, please look into HttpPostedFileBase - Haacked.com has a great article on it: http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
I tried to ask a similar question but no response. Not sure if it can be done. There are a lot of PHP examples though.
Working example of AJAX file upload to WCF service
we have a text file stored on our server where I work, and I have searched on how to read in a specific line from that text file and have it display on the screen of my Android activity... but I haven't found a solution yet. Only two words, or so, of the text in the file on the server will be changed/replaced periodically, and I would like those changes to take effect/be updated in my Android app each time. Not sure why I couldn't find an answer to this yet. Any help is much appreciated! Thank you!
Actually the best way to have a secure transaction between an android app and server is to use web service like JSON. You request something from your android app to server, Then in server request will be analyse and response to your android app. You can send some request that tell the server what to do. Then in server side have a script that do your job and send response to your android app.