HttpServer on Android to stream local video files to other devices

This blogs explains how to embed a mini HttpServer into your android app to serve local video files from your device to  other devices/desktop browsers/mediaplayers

You can do it by serving the local file using Java ServerSocket : server-side socket that waits for incoming client connections. A ServerSocket handles the requests and sends back an appropriate reply.

I made a demo App explaining this functionality, check out the code from Github (demo has a sample mp4, you can find it in assets folder. Move it your SD card  root folder to run the demo successfully)

device-2014-09-06-210137

LocalFileStreamingServer is a Thread which implements Runnable interface, you can create server object by passing the video file object from your activity. Continue reading

Advertisements

Subtitles support to Android MediaPlayer across any OS version

One of the key features in video hosting applications is Subtitles availability.

Unfortunately on Android, default media player doesn’t support SRT subtitles until Jellybean. Even on JB, it doesn’t give much flexibility to play around those APIs. I have had my troubles in debugging some intermittent crashes with no help from stack traces.
More over Android TV runs on Honeycomb devices which leaves us no other option than having our own functionality.

I came across a blog which mentioned about a hidden gem Subtitle Converter, a JAVA research project which deals with conversion of subtitle format to one another. Continue reading

IOS style password control on Android

A while ago I came across a kind of weird requirement by an IOS biased client :P, he wanted to have a control which looks like an IOS lock screen password field.

                                     VS246

Since there is no control available in Android of this kind, I decided to create a compound component using a hidden EditText underneath other layouts. Continue reading