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:
http://it-ride.blogspot.com/2010/04/android-youtube-intent.html

However, if you wish to use a custom player (uses the built-in codecs provided by the framework):
http://www.keyeslabs.com/joomla/blogs/i-think-im-becoming-an-android/51-polish-your-app-free-embeddable-android-youtube-activity

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: http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html

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:
http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/
Note You can find the best solution in the comments, I attached it as java file to this post.
WorkspaceView.java 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:
http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html

Another useful solution to reuse layouts and make code more consistent and easy to maintain:
http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html
http://android.amberfog.com/?p=9

Using ViewStub to quickly insert a new view:
http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-with.html