Category Archives: Android

Playing Youtube videos on Android

If you ever wondered, how to access the built-in Youtube player, check out the following post:

However, if you wish to use a custom player (uses the built-in codecs provided by the framework):

Easy Image Caching for Android with multithreading.

Displaying images in a ListView from online sources are not always trivial. To have seamless scrolling and good UI experience, you need to have a separate thread, which downloads and adds images to the ListView. A really intresting article about this, can be found here:

Swipe between views

If you ever wondered, how you can swipe between views like in many iphone application, or simply on the home screen, then check out this post with a solution derived from the open sourced Android home screen:
Note You can find the best solution in the comments, I attached it as java file to this post. zipped
Note 2 ViewFlipper and ViewAnimator is quite buggy on Android 1.5 & 1.6, and even slow on newer versions.

Android Layout Tricks

Here are some useful tricks about Android layouts:

Here is a solution to faster your listviews:

Another useful solution to reuse layouts and make code more consistent and easy to maintain:

Using ViewStub to quickly insert a new view: