Grokking Android

Getting Down to the Nitty Gritty of Android Development

Android Tutorial: Adding Search Suggestions

By

In this tutorial I am going to cover search suggestions. It’s the second and last part of a tutorial on Android search. In the first part I covered the basics of how to use the search framework of Android within your app. If you haven’t read it yet you might want to do so now. […]  Continue Reading  “Android Tutorial: Adding Search Suggestions”

Android’s ContentProviderOperation: “withYieldAllowed” explained

By

Whenever you use a ContentProviderOperation and have to insert, update or delete many records, the method withYieldAllowed() comes in handy. Normally the batch job would be executed in one transaction that spans all operations. But if your job contains many manipulations, the transaction might last quite a while and it might block other tasks from […]  Continue Reading  “Android’s ContentProviderOperation: “withYieldAllowed” explained”

Android Tutorial: Adding Search to Your Apps

By

Search on Android is a big topic. On every device’s homescreen is the Quick Search Box by default, older devices even had a dedicated search button. With the Quick Search Box you can quickly search the web, search for apps or contacts and search within all apps that are configured for global search. Many apps […]  Continue Reading  “Android Tutorial: Adding Search to Your Apps”

Why is There no Configuration by Default for Android Search?

By

If you use Android search a lot you will have noticed that you write the same lines of code again and again. You have to configure two things to make Android’s search work: the meta-data to use for search and which Activity to use for search Coming from the Java EE world, this reminds me […]  Continue Reading  “Why is There no Configuration by Default for Android Search?”

Surprising Statistics on Library Usage in Android Apps

By

AppBrain published statistics on library usage on Android. This list of libraries is very interesting and to me quite surprising. These stats are presented on three tabs: “Ad networks”, “Social SDKs” and “Development tools”. Here I care about development tools only. For example the two most-used libraries are those of the leading analytics providers, Google […]  Continue Reading  “Surprising Statistics on Library Usage in Android Apps”

How Android’s AutoCompleteTextView Nearly Drove me Nuts

By

AutoCompleteTextView is a nice widget Android provides. It helps the user enter text by presenting him possible selections based on what he has entered so far. Nicolas Klein has written a nice introduction of AutoCompleteTextView. As a short recap: You have to provide a ListAdapter that also must implement the Filterable interface. The filterable adapter […]  Continue Reading  “How Android’s AutoCompleteTextView Nearly Drove me Nuts”

Android’s ContentProviderOperation: “withBackReference” explained

By

The class ContentProviderOperation.Builder has a method named withValueBackReference(String key, int previousResult). The API states ominously “Add a ContentValues back reference. A column value from the back references takes precedence over a value specified in withValues(ContentValues)”. Now, thank you, Google! That about explains everything! Android’s documentation is never short of surprises. A lot of stuff is […]  Continue Reading  “Android’s ContentProviderOperation: “withBackReference” explained”

Android Tutorial: Writing your own Content Provider

By

This is the last part of a three part tutorial on content providers. In this post I am going to show you how to write your own content provider. I covered the common concepts of content providers in my first post of this series. And in the second part I’ve covered how to use content […]  Continue Reading  “Android Tutorial: Writing your own Content Provider”

Weird error message in Android’s MergeCursor

By

For an app I am working on I needed a MergeCursor to use search in a meaningful way. I needed to use two combine two cursors from different sources and I was going to merge them. The only major difference between the code for both cursors was the projection map I used to transform the […]  Continue Reading  “Weird error message in Android’s MergeCursor”

Android: Getting Notified of Connectivity Changes

By

In a previous posting I have explained how you can check the device’s current connectivity status. But this is only a temporary snapshot of the status. It might change anytime – and it probably will, given the volatility of a mobile environment. Thus you want to know whenever the connectivity state changes. Thankfully Android’s ConnectivityManager […]  Continue Reading  “Android: Getting Notified of Connectivity Changes”