Posts

Image
next → ← prev Android Activity Lifecycle Android Activity Lifecycle  is controlled by 7 methods of android.app.Activity class. The android Activity is the subclass of ContextThemeWrapper class. An activity is the single screen in android. It is like window or frame of Java. By the help of activity, you can place all your UI components or widgets in a single screen. The 7 lifecycle method of Activity describes how activity will behave at different states. Android Activity Lifecycle methods Let's see the 7 lifecycle methods of android activity. Method Description onCreate called when activity is first created. onStart called when activity is becoming visible to the user. onResume called when activity will start interacting with the user. onPause called when activity is not visible to the user. onStop called when activity is no longer visible to the user. onRestart called after your activity is stopped, prior to start. onDestroy called before the activity is destr

Android interview questions with answers

Android interview questions with answers Here are some of the Android interview questions and answers to help you if you are planning on attending an interview. What is Android? Ans. Android is an open source operating system that is mainly used on mobile devices like tablets and Smartphones. Its operations are mainly based on the Linux kernel system which comprises of rich elements that enable developers to develop and run apps that are able to carry out both basic and advanced functions. What are intents? Ans. Intents display messages of notification from within the Android enabled device to the user. Intents are used to notify the user when a particular state occurs, and users have the opportunity to respond to the notification. What is ANR? Ans. ANR is the acronym for Application Not Responding. When an application is unresponsive for a long time, the dialogue shows up to let the user know about the situation. What is Orientation? Ans. Orientation di

Most important topics:

Most important topics: 1.Java OOPs concepts.( Lesson: Object-Oriented Programming Concepts ) 2.Java Basics.( Lesson: Language Basics ) 3.Java Collections.( Collections in Java - javatpoint ) 4.Java Exceptions. 5.Multi Threading. 6.Class/Object     Where to use /When to use / How to use/How to create     7.Thread Concepts.   1.Where to use /When to use / How to use/How to create   2.Life cycle.   3.Types. 8.Synchoronization    1.Where to use /When to use / How to use/How to create    2.Types.     9.serialization/deserialization 10.Interface   1.Where to use /When to use / How to use/How to create   2.Uses of interface/why we are using. 11.String /String Buffer/String Builder.   1.difference between thease three.   2.Where to use /usage. 12.Static    1.Uses of static keyword. 13.Sorting   1.Bubble sort   2.Quick sort.   3.selection sort.   4.Insertion sort.   4.Merge sort 14.Java Data structure.    1.Stack.    2.Queue.    3.Linked list. 15.Java Annotations.   1.@Deprecated   2.@Override

Display All Contacts from Contacts application in ListView

Image
Display All Contacts from Contacts application in ListView Above output checked in Real Device. xml files under values folder: strings.xml: <?xml version="1.0" encoding="utf-8"?> <resources>     <string name="app_name">Display All Contacts</string>     <string name="action_settings">Settings</string>     <string name="hello_world">Hello world!</string>     <string name="btitle">Load Contacts</string> </resources>   xml files under layout folder: activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/LinearLayout1"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical" >     <Button         android:id=&