Category Archives: Android

Using SQLite Transactions with your ContentProvider

In the world of databases, a transaction is a unit of work (including insertions, deletions, updates) that is Atomic, Consistent, Isolated, and Durable. By default in SQLite, each insertion is a transaction. And to preserve data integrity, SQLite will wait … Continue reading

Posted in Android | Tagged , , , , , | 2 Comments

CursorAdapter with Alphabet-indexed Section Headers

Hey everyone, today I would like to share how to organize a CursorAdapter into sections alphabetically. It works as long as your queries in the Cursor are alphabetically sorted (so the sortOrder parameter of your query is ASC by the … Continue reading

Posted in Android | Tagged , , , , , , , , | 79 Comments

Persisting Cookies through Activity Life Cycle

If you are coding an Android REST application using the Apache HttpClient, there may be times when you bring another application into the foreground (like Google Maps to get driving directions), and the process containing your application is killed because … Continue reading

Posted in Android | Tagged , , , , , | 2 Comments

Syncing cookies between an HttpClient and a WebView

Hey all, Today I would like to show how to share cookies between an HttpClient and a WebView. This is necessary when your application use an HttpClient to make POST/GET calls, and then opens a WebView to a webpage that … Continue reading

Posted in Android | Tagged , , , | 19 Comments

ListView items using a Layout defined in XML

To customize the View that an item in a ListView uses (we might want a list item to be organized in some view hierarchy) , an easy approach is to implement a ListActivity, then extend BaseAdapter and call setListAdapter() on … Continue reading

Posted in Android | Tagged , , , , | Leave a comment