Accessing files from server - android

I am doing multimedia application, now i am concentrating on to connect Apache web server. I already uploaded some media files in server. I want to access all media file from the server to android device(to client). How to access data from server?

Get the URLs of those files on the server, and use that URL. But this way, the files will be public.
For other security reasons, you can have a server side script, which can deliver your audio video content by setting correct MIME type, and your Android app can request that script for files .

You can use CouchDB or other NoSQL solutions to access data from your mobile application - http://www.infoq.com/news/2010/08/CouchDB-Android

Related

How do I upload large files to AWS S3 in chunks using Sinatra?

I have written an API in Ruby/Sinatra that connects with our Android app through http(s) endpoints. One action involves uploading (zlib-compressed) files from the Android app to our S3 bucket via the application server. Using the aws-sdk gem, I've been doing so using a single POST /files endpoint in which the Android client sends a zlib-compressed, base64-encoded string of the entire file in one go. This isn't a best practice on both Android and for our backend though, and I'd like to be able to read file data in chunks on a POST request and upload each part in a multipart upload to S3. I tried successfully implementing a Sinatra streaming GET route, but I'm unable to do the same for my purpose. How do I achieve this? And is Sinatra streaming + S3 multipart-upload the correct way to go?

Accessing a file on an android device using asp.net webpage in chrome

I have an asp web page which needs to grab an xls file from the device storage area on my android tablet, convert it into bytes and store it in my SQL database.
I can do the converting and storing bit but I have no idea as to how to get the file using VB.
Can anyone tell me how I can get the file without the user having to search for it using an upload control?
I would also like to delete the file after processing..
Thank you..
Derek.
In order to think about this we need to have clear in our minds where the division between client and server exists: You've got a webserver running ASP and a client running a webbrowser on the android platform.
The file you are trying to upload exists on the client. As such any code which does the uploading will have to run on the client and, as the client is running on android, it's unlikely it'll be VB doing the uploading. You're likely to need to use a scripting language like Javascript and, if you care about cross-browser support, be careful how you do it.
The server cannot get the file directly from the client due to common security restrictions.
Once the client side script has got the file, it'd usually send the data to the server using a webservice or other endpoint, deletion of the file can then happen after that.

Android + NodeJS: Client-Server communication

I have some questions about developing a Android application which shall be able to communicate with a NodeJS server.
The Android application gathers some data and saves everything in a .csv file.
This file now needs to be uploaded to a NodeJS server. The NodeJS server should save the file as well as storing the content in a MongoDB.
My question now is how I should implement the communication between the Android device and the server.
I know how to upload a single file to a NodeJS server using a HttpURLConnection with a DataOutputStream.
But I need more than just uploading the file because I need a unique identification of each Android device.
I thought about using the (encrypted) Google account E-Mail address of the user to distinguish the devices. I am not interested in knowing who uploads which data but I need to store the data for each device separately.
The problem is that I don't know how to communicate between the device and the server.
If I upload a file via HttpURLConnection and DataOutptStream it seems that I can only upload the file without any additional information like the unique key for the device.
I also thought about uploading the file via sockets. But I am not sure how to handle huge file sizes (5 MB or more).
I am not looking for code fragments. I rather need some hints to the right direction. Hopefully my problem was stated clearly and someone can help me with this.
Using a HttpUrlConnection on the Android side, and a RESTful server on the Node side would be a straightforward option.
You can embed information into the URL in a RESTful way:
pathParam: www.address.com/api/save/{clientId}/data
queryParam: www.address.com/api/save/data?c={clientID}
each uniquely identifying the client. This can be whatever scheme you choose. You will have to build the HttpUrlConnection each time as the URI is unique, and important!
The server side can then route the URL however you see fit. Node has a number of packages to aid in that (Express, Restify, etc.). Basically you'll grab the body of the request to store into your DB, but the other parameters are available too so it's all a unique and separated transaction.
Edit: The package you use for RESTful handling can stream large files for you as well. Processing of the request can really begin once the data is fully uploaded to the server.
Using a socket would be nearly just as easy. The most difficult part will be 'making your own protocol' which in reality could be very simple.
Upload 1 file at at time by sending data to the socket like this:
54::{filename:'myfilename.txt',length:13023,hash:'ss23vd'}xxxxxxxxxxx...
54= length of the JSON txt
:: = the delimiter between the length and the JSON
{JSON} = additional data you need
xxx... = 13023 bytes of data
Then once all the data is sent you can disconnect... OR if you need to send another file, you know where the next set of data should be.
And since node.js is javascript you already have wonderful JSON support to parse the JSON for you.
Would I suggest using a socket? Probably not. Because if you ever have to upload additional files at the same time, HTTP and node.js HTTP modules might do a better job. But if you can guarantee nothing will ever change, then sure, why not... But that's a bad attitude to have towards development.

Android Video listing from remote server?

I use my application to upload the video in server and it was stored in appropriate folder in server, i need to show the list of video from remote server folder and allow the user to streaming the video.Is there any sample is there?
I feel you can have a script running on server which tells you about which directory has what videos, and returns their URLs too.
Later, you can access those URLs to play the videos
You can use commons-net-2.2-bin library to create a FTP connection to your server and make a query of listing . files from the folder.

How to connect to the server

I am doing multimedia application, Now i am concentrating on connecting my application to server. i want to store all my multimedia files(music and videos) into server. whenever my device is connected to WIFI i want to access all my multimedia files from server. In short i want to access my server through WIFI. can anyone pls guide me how to access this process, also give some useful links to know this process in details.
Hi
you need to make an http request to the server and then upload the data to it. for this simply create servlets on the server which can read and store the files. whereas on the client part follow the following APIs. httpclient.. do remember to use POST/GET methods for file uploads etc.Hope this helps

Categories

Resources