Mobile Archives - Intertech Blog

Android Adapters (and AdapterViews)

Android’s Adapter is describe in the API documentation, as “a bridge between an AdapterView and the underlying data for that view” (see here).  An AdapterView is a group of widgets (aka view) components in Android that include the ListView, Spinner, and GridView.  In general, these are the widgets that provide the selecting capability in the user interface (read about AdapterView widgets here).  What is not mentioned in the documentation is that the AdapterView also provides the layout of the underlying data… Read More

Android Non-UI to UI Thread Communications (Part 5 of 5)

This is the last post in my series regarding Android thread communications.  Parts 1 through 4 are linked in below. Part 1 Part 2 Part 3 Part 4 In this series, I have so far outlined four different approaches for how Android non-user interface threads can communicate user interface (UI) updates back to the UI thread.  As you have learned in this series, new threads to perform longer running work is the way to build applications and to avoid Android Not… Read More

Android Non-UI to UI Thread Communications (Part 4 of 5)

In parts 1-3 of this series, I have explored three different means for an Android non-UI thread to communicate user interface updates to the UI thread. The links below are to the series posts. Part 1 Part 2 Part 3 In this fourth installment, I want to show you how to use a broadcasts and a broadcast receiver to provide non-UI to UI thread communications. Background non-UI thread to UI thread comms As background for those jumping into the middle… Read More

Android Non-UI to UI Thread Communications (Part 3 of 5)

Continuing my series on Android non-UI thread-to-UI thread communications, this post covers use of the Handler Framework to facilitate the communications.  See here for Part 1 and Part 2 of the series. Non-UI threads are not allowed to make updates to the UI.  Trying to do too much work (as defined as not allowing the user to interact with the UI for more than 5 seconds) on the UI thread leads to ANR errors.  In the first two posts, I showed how… Read More

Android Non-UI to UI Thread Communications (Part 2 of 5)

This is the second part of my series of blog posts on Android non-UI thread-to-UI thread communications. See here for the start of the series.  As a refresher, this series of posts is about how non-UI threads can communicate back to the UI thread in an Android application in order to update the user interface.  Non-UI threads are not allowed to make updates to the UI.  Trying to do too much work (as defined as not allowing the user to interact… Read More

Android Non-UI to UI Thread Communications (Part 1 of 5)

Android UI Thread and ANR On the Android platform, applications operate, by default, on one thread.  This thread is called the UI thread.  It is often called that because this single thread displays the user interface and listens for events that occur when the user interacts with the app. Developers quickly learn that if code running on that thread hogs that single thread and prevents user interaction (for more than 5 seconds), it causes Android to throw up the infamous Android… Read More

Writing Android Apps on an Android Device – AIDE

First a word for my sponsor It has been more than a couple of months since my last blog post.  For every seven years of employment, my company gives its employees a two month sabbatical.  I just spent my sabbatical traveling Australia and New Zealand!  Below are a couple of pictures from my trip – one of Uluru in Australia and one of the Fox Glacier in New Zealand (If you look close you can see a few dots on the lower… Read More

Programmatically Working with Android Fragments

I had another great class of soon-to-be Android engineers in my class last week.  Some came a very long way to learn Android.  Baris made his first trip to the U.S. all the way from Turkey and Joshua and Doug came up from Mason City, Iowa.  Thanks for making the long trip guys and thanks to all my students (local and long distance) last week for your attendance and participation. During last week’s class, my students learned that Fragments (since Android 3) can be used… Read More

Android Handling the Unexpected

In all applications, there are those exceptions, those bugs that no one expected.  Try as we might  to think of every conceivable error, exception, or issue, we developers miss some things.  When this happens on a device “out in the wild” – meaning on a device in the hands of the mobile users – we often don’t know it happened, let alone be able to better deal with the problem in the future. Catching the Unexpected – using the UncaughtExceptionHandler… Read More

Android Documentation – Getting a Local Copy

All Android developers know and utilize the Android developer Web site – namely developer.android.com. In particular, the API Guides and Reference (a.k.a. Android Javadocs) are well known and heavily used portions of that Web site.  Did you know, however, that these documents can be downloaded and used on your local development machine?  When disconnected from the Web and designing/developing Android code, this can be quite handy.  How do you get them locally? Download the SDK If you don’t already have… Read More