Author Archives: eshyu

New Academic Blog

http://eshyumusings.wordpress.com/ Advertisements

Posted in Uncategorized | 1 Comment

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

Converting a Hex String to N-bit Binary String

Recently I have wanted to keep track of unique IDs of the Android devices using one of my applications. These are found under Settings.Secure.ANDROID_ID and are 64bit numbers given as Hex Strings, but I needed the actual binary number, with … Continue reading

Posted in Programming | Tagged , , , | 1 Comment

Implementing a Generic Method with Function as Parameters Using Interfaces

Consider the following: Say the function getListItems() needs to download a JSON output, parse it, and return a list of items of a specific type. Depending on the URL we get the output from, we might want to parse the … Continue reading

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

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