Labels

Sunday, 20 July 2014

Android Key board raising and hiding Programmatically


// Android key board raising Programmatically
InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isAcceptingText())
{
} else
{
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}

// Android key board hiding Programmatically getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

Android Basic Fundamentals



  1. Activity
  2. Service
  3. Broadcast Receiver
  4. Content Provider.
An activity represents a single screen with a user interface.
The user can interact with the activity i.e. click the button.

service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface.

Example:
       Listening Music is the service. Because no user interaction is necessary to play music. Once you start it will playing all the songs.
content provider manages a shared set of application data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your application can access. 

Example:
       Consider that you are going to develop message sending application. For choosing the contacts you need to add contacts one by one in your application. 
       Instead of that you just share the contact which is in your phone contacts.

broadcast receiver is a component that responds to system-wide broadcast announcements.

            Example:
                      It reacts something, when the phone receive any messages or phone etc.