tommek

I just push the buttons….

M3U8 Validator Tool

leave a comment »

Recently I worked on a iPad video application setting up the video streaming solution for it. Videos had to be viewable over 3G and EDGE connections, so this meant that we had to use Apple Segmented HTTP Live Streaming . The app had VOD’s with durations ranging from 2mins, 10mins and 60mins. If you understand how “Segmented HTTP Streams” works then you understand that the amount of files that are created just for one VOD is quite large.

i.e  60mins VOD with 5 bitrates would be around 1800 files (*.ts / *.m3u8).

One issue I had was validating and debug the VOD’s when they where on the production environment. The mediastreamvalidator tools supplied by apple works well but can handle token/cookie authentication which was I had implemented for security. Also the tool only works on a mac.

So I decided to to create a AIR app with the ability to connect to the CDN by FTP that way bypassing the token/cookie auth and allowing the app to validate the m3u8 VODs.

Download from here

Features
–
parse a index multi-bitrate M3U8 file and a single bitrate M3U8 file.
– It will validate that all *.ts segments files referenced in the M3U8 files exist and the VOD is not missing any files which make the clip
– It will validate that all the M3U8 files are of correct format and contain data.

Does Not
– calculate ts file bitrate  and average segment bitrate
– validate segment encryption

Note: When implementing Apple HTTP Live Streaming using the mediastreamvalidator to validate your VODs is the best way. This app is just designed to validate that all the *.ts files referenced in the *.m3u8 files exist.

Written by tomkaurin

January 31, 2011 at 6:47 pm

Getting Started Flex / AIR & Android

leave a comment »

If you have been thinking of porting your flex app to run on Android or have a idea for a mobile application which you want to develop in flex. Then to get started follow the links below.

First download Adobe Flash Builder “Burrito”: (This is the new Flash Builder which now has supports for mobile application projects)

Seconds download a sample app from “Christophe Coenraets“: (Use this app to learn about the new view structure etc and preview a working Flex / AIR app on your phone/emulator)

Written by tomkaurin

December 12, 2010 at 7:48 pm

Posted in AIR, Android, Flex

SQLite Browser tool for Android development.

leave a comment »

If you are developing an Android app that utilizes SQLite then you might want to install Questoid SQLite Browser. This is a eclipse plugin that will allow you to open the SQLite DB  file off the emulator.

1. Install Questoid SQLite Browser
2. Switch to DDMS perspective :

3. Open File Explorer:

4. Navigate to your SQLite file. should be something like data/data/<APP_PACKAGE_NAME>/database/<FILE_NAME>
5. Select the SQLite file and then launch Questoid 

Written by tomkaurin

November 8, 2010 at 6:27 pm

Posted in Android, Eclipse, SQLite

Improving your Android List Activity Performance with a ViewHolder

leave a comment »

I recently attended a Android developer lab at the Sydney Google offices. (ADL) Most of the day was about Android Market place etc but they did have one speaker Bill Laun who spoke about UI Best Practices & High Performance Apps. Most of the best practices talk was about design and graphics related to different screen sizes and dpi.

He did show us one thing that I found useful and had not heard of before and this was the “ViewHolder”. Using this strategy with your custom Adapter improves the performance for your List.

Every time your custom Adapter is executed the “getView()” method is called to get reference to your custom layout and populate it with data. If you have a large list, calling  “findViewById()” to access resource on every row will impact the performance of your list. So to get around this you can use a “ViewHolder” which basically keeps a object in memory with references to your row layout. This means you do not need to use “findViewById()”every time “getView()” is called but only once on the first call of it when the list is created.

public View getView(int position, View convertView, ViewGroup parent) {

		View v = convertView;
		ViewHolder holder;
        if (v == null) {

        	LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        	v = vi.inflate(R.layout.article_row, null);

        	 holder = new ViewHolder();
        	 holder.title = (TextView) v.findViewById(R.id.article_title);
        	 holder.description = (TextView) v.findViewById(R.id.article_des);
        	 holder.date = (TextView) v.findViewById(R.id.article_pubdate);
        	 v.setTag(holder);
        } else {
        	holder = (ViewHolder) v.getTag();
        }
        Article article = articles.get(position);
        if (article != null) {
        	holder.title.setText(article.title);
        	holder.description.setText(article.description);
        	holder.date.setText(article.pubDate);
        }
        return v;
}
class ViewHolder{
	TextView title;
	TextView description;
	TextView date;
}

Written by tomkaurin

November 8, 2010 at 4:42 pm

Android Emulator ConnectivityManager, always returning connected

leave a comment »

I have recently be playing around with the ConnectivityManager in the android emulator. I was trying to detect if the emulator had internet connectivity or not.

ConnectivityManager connec =  (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);

connec.getNetworkInfo(0).getState() // = CONNECTED
connec.getNetworkInfo(1).getState() // = CONNECTED

Every time I retrieved the status from the NetworkInfo it would return “CONNECTED”, even when I disconnected from internet.

After doing some hunting around on the issue, I found that you need to manually disable the internet connectivity on the emulator. The emulator does not listen to the computers  network interface so disable the network / internet will not effect the emulator.

To disable internet / network connectivity on the emulator hit F8.

Written by tomkaurin

October 29, 2010 at 6:46 pm

Posted in Android, Emulator

Build Path Error, When creating first Android project

leave a comment »

Recently I start developing a Android App. After downloading the SDK, installing ADT pluging in eclipse and create my first every Android project, I was confronted with a project error even before writing one bit of code.

After doing some googling I found that by default eclipse treats incomplete build paths as an error.

To fix this all you need to do is:

Open eclipse preferences > Java > Compiler > Building and switch “Incomplete Build Paths” from “Error” to “Warning”.

I also noticed once you have changed this option to warning and your Android project is rebuilt, you can switch it back to “Error” and you will not get build path error any more. Even when you create new Android projects.

Written by tomkaurin

October 13, 2010 at 5:46 pm

Posted in Android, Eclipse, Error

Create your own website, free on WordPress.com.Create your own website.
Start free