Grokking Android

Getting Down to the Nitty Gritty of Android Development

Posts tagged “ContentProviderOperation”:

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’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: Better Performance with ContentProviderOperation

By

ContentProviders are one of Android’s core building blocks. They represent a relational interface to data – either in databases or (cached) data from the cloud. Sometimes you want to use them for multiple operations in a row. Like updating different sources and so on. In those cases you could call the respective ContentResolver methods multiple […]  Continue Reading  “Android: Better Performance with ContentProviderOperation”