Android Dev Con

I just got back from android dev con. I attended some really informative classes. There were some that I felt weren’t appropriate for the venue. I felt that some people were trying to sell products/services more than they were about development. One exception was the speaker for Mono Droid, Wallace McClure. His presentation was excellent because he actually showed code. …

Android Animation

I used the AnimationDrawable for the first time today. I wanted to illustrate how to play accelo break. So I took a few shots on my camera. Did some photoshop editing. I then dropped them into my project, it turned out pretty neat. Click image below to check it out.

Android Patterns

I just came across this Android Patterns site. And I love it.

New Android Game

I made a fun game of memory. You have to pair up the cards as quickly as possible. See who can get the fastest score. So far my high score is 60 some seconds.

BadTokenException for Dialog

I went to add a Dialog in a game that I am working on and encountered a BadTokenException. I initially thought that it was related to the library I was using for the game. Then I realized I was using an application context instead of an activity context(which is required for dialogs). For some reason the android documentation has an …

java.net.UnknownHostException:

While programming I kept getting dns failed exceptions. The error was called due to not having the proper permission for using the internet in my android manifest. <uses-permission android:name="android.permission.INTERNET" />

Lazy Loading GridView

I just added sample code showing one method of lazy loading images in a GridView. I used thread, handler, and the looper classes. It starts by displaying a GridView with a ViewSwitcher that initially displays ProgressBars for each image. Then as the images are sequentially loaded the ViewSwitcher switches to the loaded ImageView. Check it out here. Screen shot:

getAdapter throwing java.lang.ClassCastException

I had used addHeaderView method to add a header to my listview. But when I went to retrieve my adapter I kept getting class cast exceptions. I was very mystified until I looked at my recent changes. I commented out the addheaderview line and viola it worked. A bit of googling directed me to this useful link about the topic.

Custom ListView Layout

I came across this while trying to figure out how to make a custom list view layout. So far it works really well. Very simple straight forward example.