For long-running or CPU-intensive tasks, there are basically two ways to do this: Java threads, and Android's native AsyncTask.
Use AsyncTask for:
- Simple network operations which do not require downloading a lot of data
- Disk-bound tasks that might take more than a few milliseconds
Use Java threads for:
- Network operations which involve moderate to large amounts of data (either uploading or downloading)
- High-CPU tasks which need to be run in the background
- Any task where you want to control the CPU usage relative to the GUI thread
And there are lot of good resources over internet which may help you:
http://www.vogella.com/articles/AndroidBackgroundProcessing/article.htmlhttp://www.mergeconflict.net/2012/05/java-threads-vs-android-asynctask-which.html
Activity,services(Return Sticky not sticky redeliver intent),fragment communication,shared preference,Thread,AsyncTask getContext and getApplicationContext, Parcelable and Serialize and more basic. From java oops(in detail ) abstract class and interface difference between hash map and hash table, hash set ,string,Exception handling,and some more basic
0 comments:
Post a Comment