Thursday, 29 October 2015

AsyncTask

AsyncTask AsyncTask enables proper and easy use of the UI thread.  This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.  AsyncTask is designed to be a helper class around Thread and Handler and does not constitute a generic threading framework.  If you need to keep threads running for long periods of time, it is highly recommended you use the various APIs. An asynchronous task is defined by a computation that runs on a background...

Monday, 19 October 2015

Passing data from one activity to other in android

Passing data from one activity to other in android   The data can be passed to other activity using intent putExtra() method.  Data is passed as extras and are key/value pairs.  The key is always a String. As value you can use the primitive data types int, float, chars, etc.  We can also pass Parceable and Serializable objects from one activity to other. *We have two ways for sending data . Example 1:  Intent intent=new Intent(MainActivity.this,Main2Activity.class) *intent.putExtras("key","value"); intent.putExtras("key",Welcome...

Wednesday, 14 October 2015

Types Of Intents

Intent What is Intent: An intent is an abstract description of an operation to be performed.  It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service.  An Android Intent can be used to perform following 3 tasks : Open another...

Friday, 9 October 2015

Storage Options

Storage Options Android provides several options for you to save persistent application data. The solution you choose depends on your specific needs, such as whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires.   Your data storage options are the following: Shared Preferences: Store private primitive data in key-value pairs. Internal Storage: Store private data on the device memory. External Storage: Store public data on...