share local files (audio,video) via local http server in android - android

i want to share my local audio and video files inside the phone through a HTTP server by creating a link.and through that link i can access my local file any where on the network.i used this open source project this but i doesn't share video files i think because of large size.I also tried to use nano httpd server but it has same issue too.Can any one tell me any other open source server as i cant be able to find one

Jetty is the most popular one. http://www.eclipse.org/jetty/

Related

Is it possible to Use SCP in Android to transfer file from Android Device to Remote Server?

I have an Android application which send app debug logs from Background thread without opening any intent through smtpoffice365 but now have to do implementation with using SCP. Is it possible to use SCP in android to copy log file to remote server?
i have also referred these links
Upload Files Using SCP/SFTP or more secure way in Android
Is it possible to transfer files between Android devices via scp?
But as not get proper answer from above link which didn't help me to solve. if there is any sample code then please provide with references link or code.

load local file in webview ios using http protocol. (Create Webview server in android and iOS)

Is there any way to create the server in android and iOS to run a web-view? I want to run a local HTML file in a web-view with a local-host URL.
I have already searched for this on the following links but could not find any solution.
GCDWebServer
local-http-server-for-ios
Supercharging the Android WebView
Hereby i am sharing the actual scenario :
1) Download ".zip" file from server and save it on application library directory for offline use.
2) ".zip" file contents html and javascript files. It works when the HTML page is simple. But if the HTML references something else, i.e. a JavaScript file also in the library directory (with an absolute path like ), it will fail to load.
3) I need to setup local server in my device, On application launch local server starts and upload the application library directory on local server and then load the content using local host. See below example
Using Library directory path
file:////Users/prince/Library/Developer/CoreSimulator/Devices/75EF3DD7-DFD1-4EDB-9A6B-9FBA60F4D98C/data/Containers/Data/Application/32F774B2-E811-4281-A37A-DC8A5183B7C8/Library/Application%20Support/adededfe6c1c7bd8b5d5adb19861b9e0/Responses/36b8f6a8d6f58d58f117856dc80b0d37/abc.html
Using localhost path
http://localhost:8080/Application%20Support/adededfe6c1c7bd8b5d5adb19861b9e0/Responses/36b8f6a8d6f58d58f117856dc80b0d37/abc.html
Does anyone know why this happens, and how to resolve the issue?

Treat remote http URLs as local ones

I don't know how to call it correctly and how to do it, but I will try to explain what I want to achieve.
Remote server provides URLs to mp3 files (downloadable) like so:
http://someremotehost.com/song1.mp3
I need this link to be local, for example:
http://192.168.0.20:78787/song1.mp3
So that I could send the local URL to my DLNA player, which would understand it as a local URL, though the mp3 file would be played from remote host.
One of my ideas was to setup a http server that would map somehow remote URL to local ones, possibly downloading mp3 files from remote host and providing a URL of it on hard disk. But I'm not good at such things, so I wonder what are the options and how to do it right.
It is an Android app I'm developing, so I would appreciate approaches that could easily fit within an app.
Thank you

Save File to a remote Url

first of all sorry for my english , not my main lang.
I need to export some data to a remote folder from android.
I have a file on android "file.xml" and i need to export it to a folder (under iis)
"http://192.168.x.xx/folder/fileuploaded.txt"
It seems most of the examples out there are using an upload script in php, but i need to do it only from android. Doing the opposite way (from remote url to android app) is easy with Url.openStream(), but i cannot find a working example to put back the file on the server.
Maybe im missing something, this is my first android (and java btw) app.
anyone could point me in the right direction?
Thanks!
Diego, what you are trying to achieve is not possible only from Android. You cannot put a file on the server using HTTP unless there is a receiving application running.
You can only post your binary data to the server (url) but to write it locally and make it available on the http again for download, can only be done if you have a server app. It could be created using any language PHP, JSP, ASP etc.
You cannot just upload files to server of your wish unless there is something on the server side that allows file uploads. That is usually a ASP/Perl/PHP script.
If you don't want to use such a script, then one way to do this is to run ftp on your server and upload files using that.

How to play local video files in a browser

Am looking for the way to play video inside my android browser locally. There may be two or more video's in a local page (like facebook contains video's).
Can anyone please help me out..
Without actually reading about the specifics of the Android built in browser I would safely say, you can't. Well, if you run a local html file it might work, but if you intend to have an external page from which you can play local videos it shouldn't work. I say shouldn't because in the early days of browsers some of them actually did give you access to the local file system. Javascript for example could use file://, something I used myself for image previewing before upload. But this was a major security concern and all modern browsers prevent this.
The difference is if you run a local file or a file on your own local web server. Since then, your local file system is actually part of the web servers file system and the web server can serve your local files.

Categories

Resources