Select chapter



basics (6.papers)
activities (5.papers)
services (2.papers)
threads (2.papers)
receivers (1.papers)
advanced android (2.papers)
SQLite database (1.papers)
adapters (1.papers)
adb and ddms (1.papers)
widgets (1.papers)
fragments (1.papers)
UI (1.papers)
Hide

Sponsored Links


  

android interview questions and answers

1
What is the difference between px, dp, dip, and dpi ?
  1. px - pixels, dp - density pixels, dip - density independent pixels, sp - scale independent pixels
  2. px - pixels, dp - density pics, dip - density independent pics, sp - scale independent pixels
  3. px - pixels, dp - density independent pixels, dip - density independent pixels, sp - scale independent pixels
  4. px - pixels, dp - density independent pics, dip - density independent pics, sp - scale independent pixels
Show Answer
Share Facebook gmail Twitter
2
What is android:gravity attribute in the view tag?
  1. it is to align the view either right/top/bottom/center in its parent layout
  2. it is to align the view content either right/top/bottom/center with in that view.
  3. it is to align the parent layout of the view either in right/top/bottom/center.
  4. it is to weigh the view with respect to other views in that layout
Show Answer
Share Facebook gmail Twitter
3
What is the difference between linear layout and relative layout?
  1. linear layout - arranges element in either vertical or horizontal fashion. Relative layout - arranges elements in relative to each other.
  2. linear layout - arranges element in only vertical fashion. Relative layout - arranges elements in relative to each other.
  3. linear layout - arranges element in either absolute fashion. Relative layout - arranges elements in relative to other layouts.
  4. linear layout - arranges element in either vertical or horizontal fashion. Relative layout - arranges elements in stack base architecture (piled up).
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
5
what is the life cycle of an activity in case of configuration change or orientation change?
  1. onPause() -> onSaveInstanceState() -> onCreate() -> onStart() -> onRestoreInstanceState() -> onResume()
  2. onPause() -> onSaveInstanceState() -> onStop() -> onCreate() -> onStart() -> onRestoreInstanceState() -> onResume()
  3. onPause() -> onSaveInstanceState() -> onStop() -> onDestroy()->onCreate() -> onStart() -> onRestoreInstanceState() -> onResume()
  4. can be any of the above based on the situation.
Show Answer
Share Facebook gmail Twitter
6
How many kinds of linear layouts are there in android?
  1. absolute linear layout, normal linear layout
  2. horizontal & vertical linear layout
  3. frame & absolute linear layout
  4. linear layout & relative linear layout
Show Answer
Share Facebook gmail Twitter
7
Activity life cycle: Why you should not do heavy functionality in onPause()  of your activity?
  1. because android may kill your activity at any point of time from then on
  2. because user is eagerly waiting for next activity to show up
  3. because it has time limit of 5 seconds
  4. because it has time limit of 10 seconds
Show Answer
Share Facebook gmail Twitter
8
Activity life cycle: What to do in onRestart() of an activity?
  1. load your xml layout file
  2. if any UI changes happened while it is in invisible state, updated it in this function
  3. if any UI changes happened while it is in running state, updated it in this function
  4. Used to reload all UI resources in case of activity recreation which happens in case of  configuration changes.
Show Answer
Share Facebook gmail Twitter
9
Is it possible to give cursor to an array adapter as a source?
  1. yes
  2. no
  3. option 2 is right, because array adapter takes only lists
  4. option 3 is wrong because cursors is also one list.
Show Answer
Share Facebook gmail Twitter
10
what are the mandatory functions to be implemented in custom adapter?
  1. onCreate(), onStart(), getView()
  2. getCount(), getView(), getItem(), getItemId()
  3. only getView() is mandatory to implement.
  4. only getView() & getCount() is mandatory to implement.
Show Answer
Share Facebook gmail Twitter
11
How to create a custom adapter in Android? What is the class that I need to extend to create my own adapter?
  1. Extend Adapter class
  2. Extend ListAdapter
  3. Extend Either one of the conceret Adapters or BaseAdapter
  4. Extend BaseAdapter
Show Answer
Share Facebook gmail Twitter
12
What is an adapter in android?
  1. bridge between source and layouts
  2. bridge between source and adapter views
  3. bridge between listview and view
  4. bridge between view and activity
Show Answer
Share Facebook gmail Twitter
13
What is an adapterview? How many adapter views are available in android?
  1. listview is an adapterview, eg of adapter views are : listview, tablelayout, spinner
  2. linear layout is an adapterview, eg of adapter views are : linear layout, relative layout, and frame layout
  3. any view that takes input from adapter is called as adapter view. eg:listview, imageview, spinner, gridview, etc..
  4. any view that takes input from adapter is called as adapter view. eg:listview, gallery, spinner, gridview, etc..
Show Answer
Share Facebook gmail Twitter
14
When activity is destroyed, will it be in memory or moved out of it?
  1. Yes, all destroyed apps will be removed from memory
  2. Yes, all destroyed apps will be removed from memory only after some time.
  3. A destroyed application will be removed from memory if it is not frequently visited by user.
  4. option 3 is true because, if user is visiting an app frequently, then it has to be loaded many times.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
16
What is Bundle? What does it contain in onCreate() of your activity?
  1. Bundle will be null always in onCreate()
  2. Bundle contain previous savedInstantceState
  3. Bundle contain previous restoredInstanceState
  4. Bundle contains information passed from other activities when it was started using startActivity()
Show Answer
Share Facebook gmail Twitter
17
How to get image from gallery, in android?
  1. Intent in = new Intent();
    in.setType("image/*");
    in.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(in, 0);
  2. Intent in = new Intent();
    in.setType("image/*");
    in.setAction(Intent.ACTION_GET);
    startActivityForResult(in, 0);
  3. Intent in = new Intent();
    in.setType("image/*");
    in.setAction(Intent.ACTION_PICK);
    startActivityForResult(in, 0);
  4. Intent in = new Intent();
    in.setType("*/*");
    in.setAction(Intent.ACTION_GET);
    startActivityForResult(in, 0);
Show Answer
Share Facebook gmail Twitter
18
Name some list adapters?
  1. all view groups are adapters only
  2. array adapter, cursor adapter, expandable list adapter, etc..
  3. both option 1 & 2
  4. option 2 is right, and all layouts are also adapters.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
20
When an activity is in stopped state, is it still in memory or not?
  1. when onStop() is called, then activity is removed from memory
  2. when onStop() is called, then activity will be removed from memory in fraction of seconds
  3. when onStop() is called, then activity is still in memory and all its states and variables are intact.
  4. when onStop() is called, then activity is still in memory and all its states and variables are intact. But it will be removed from memory with in 5 seconds.
Show Answer
Share Facebook gmail Twitter
Read more papers :