Android Multithreading in a Ui Environment

Why do we need multithreading in Android applications? Let’s say you want to do a very long operation when the user pushes a button.If you are not using another thread, it will look something like this: 1 2 3 4 5 6 7 8 9 ((Button)findViewById(R.id.Button01)).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { int result = doLongOperation(); updateUI(result); } }); What will happen?The UI freezes. This is a really bad UI experience.

Android Dealing With Asynctask and Screen Orientation

A common task in Android is to perform some background activity in another thread, meanwhile displaying a ProgressDialog to the user. Example of these tasks include downloading some data from internet, logging into an application, etc. Implementing an AsyncTask is fairly a simple job, the big challenge is how to handle it properly when an orientation change occurs. In this article I will walk though a series of potential solutions to address the screen orientation issues when using an AsyncTask.

Android Contentprovider

Android ContentProvider Content Provider Basics Using Content Providers Writing your own Content Provider Better Performance with ContentProviderOperation Android ContentProvider This is a tutorial covering Android’s ContentProvider. ContentProvider Basics What are content providers? Content providers are Android’s central mechanism that enables you to access data of other applications – mostly information stored in databases or flat files. As such content providers are one of Android’s central component types to support the modular approach common to Android.