http://schemas.google.com/blogger/2008/kind#post

AsyncTask and context leaking

Read Time 2 minutes AsyncTask is mostly used as inner class of Activity or Fragment. For example: public class SampleActivity extends Activity { private static SampleActivity instance; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome); new SampleTask().execute(); } @Override protected void onPause() { super.onPause(); instance = null; } @Override protected void onResume() { super.onResume(); instance = this; } private …

AsyncTask and context leaking Read More »

MediaCodec: Decoding AAC android

Read Time 2 minutes Encoding/Decoding for various audio/video formats is now possible in android since JellyBean. Sample code below shows AAC decoding using MediaCodec API provided in android JellyBean and above. Sample InputFile Sample input file, songwav.mp4 is also created using MediaCodec and MediaMuxer. Songwav.mp4 file AAC encoded file with following parameters:   MediaFormat outputFormat = MediaFormat.createAudioFormat( “audio/mp4a-latm”, 44100, 2); …

MediaCodec: Decoding AAC android Read More »

Making three state custom button in android

Read Time 2 minutes Today I’ll discuss how can we make three state button like repeat song button in android music app. First of all we need to define xml custom attributes for our custom button. Our repeat button has three states: Repeat One. Repeat All. Repeat Off. So we need to define xml attributes for: src_repeat_one => Source …

Making three state custom button in android Read More »

Secure your content provider with SQLCipher

Read Time 3 minutes SQLCipher provides encryption of SQLite database files. It encrypts database using AES-256 in CBC mode. SQLCipher supports many platform including android. Here is a basic tutorial for setting up and using SQLCipher in android application. In this tutorial I’ll try to explain how can we secure our Contentprovider with SQLCipher. We need to change few …

Secure your content provider with SQLCipher Read More »

AntiSpyware Fraud on #Android’s Google Play

Read Time 2 minutes States have been making money for decades on the name of  “Security”. After the revolution of mobile phones many companies are doing the same in the world of  mobile applications. After Realizing the fact that many people, who owns smart phones, are conscious about their privacy, and majority of those do not really know about …

AntiSpyware Fraud on #Android’s Google Play Read More »

Db4o Concurrent Access

Read Time < 1 minute Db4o has access limitations, which means you cannot use the ObjectContainer to query/store objects in different process than the one it was opened in. For example if you open db ObjectContainer db= Db4oEmbedded.openFile(Db4oEmbedded.newConfiguration(),DB_PATH); You cannot use this ObjectContainer, db for database operations in other processes. If you try to open db again in some other …

Db4o Concurrent Access Read More »

Using Database for Object (db4o) in android part-2

Read Time 2 minutes In previous post we discussed db4o benefits over relational databases and saw how we can setup and use db4o in android applications. Today we will go little deeper in understanding the advance functionality of  db4o and its querying mechanism. QBE is easy but We need more sophisticated  mechanisms of querying in actual android applications, and that’s Native …

Using Database for Object (db4o) in android part-2 Read More »

Using database for objects (db4o) in android part-1

Read Time 4 minutes Mapping object paradigm to relational paradigm is very hectic job for programmer and intensive for processor. As mobile development move to object oriented paradigm, we need object based database where we can directly store/retrieve/update and delete objects without first converting them to relational table entities. Fortunately we have db4o, which was released just after first …

Using database for objects (db4o) in android part-1 Read More »

Application Class: Application-wide data sharing #android

Read Time 2 minutes There are cases when we need to share same data to all application components and we want anyone to be able to update that data. Example of this use-case can be application settings e.g shared preferences. Application class instance is initiated before any other component and remained there till the application terminate. You can think …

Application Class: Application-wide data sharing #android Read More »

A complete Contentprovider

Read Time 6 minutes MyContentProvider Much have been written about contentproviders and there are various tutorials and examples available. I walk through many of those tutorials during my learning of custom contentprovider. However none of those tutorial gave me complete and clean implementation details.Aim of this post is to show you a complete [all necessary function implementation] and clean …

A complete Contentprovider Read More »