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 empty process in android and what is its priority?
  1. Empty process - an app with out any components in it.
  2. Empty process- an app which is destroyed and still in the memory.
  3. Empty process - an app which is destroyed and removed from the memory.
  4. Empty process - an app with out any components, but always in memory.
Show Answer
Share Facebook gmail Twitter
2
Can I have more than one application in a given task?
  1. task is different and application is different
  2. task can have maximum 1 app
  3. task can have n number of apps
Show Answer
Share Facebook gmail Twitter
3
Can I have more than one process in a given task?
  1. Yes a task can have multiple process in it
  2. Task can have only one process
  3. Task can have apps not processes
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
5
What is sleep mode in android? What will happen to CPU once screen (LCD) light goes off?
  1. Sleep mode - is phone switched off. CPU will not work when LCD is turned off.
  2. Sleep mode - means CPU will be sleeping. CPU will not work when LCD is turned off.
  3. Sleep mode - means CPU will be sleeping. CPU will go to sleep mode with in fraction of seconds after LCD is turned off.
  4. Sleep mode - means CPU will be sleeping and will not accept any command except from RIL(Radio Interface Layer) and alarms. CPU will go to sleep mode with in fraction of seconds after LCD is turned off.
Show Answer
Share Facebook gmail Twitter
6
How many kinds of wake locks are available, which one to use when?
  1. PARTIAL_WAKE_LOCK - use it when you need only screen on
    SCREEN_DIM_WAKE_LOCK - use it when you need only CPU on
    SCREEN_BRIGHT_WAKE_LOCK - use it when you need screen Bright
    FULL_WAKE_LOCK - use it when you need all SCREEN, CPU, Keypad in bright and on.
  2. PARTIAL_WAKE_LOCK - use it when you need only CPU on
    SCREEN_DIM_WAKE_LOCK - use it when you need only Screen on
    SCREEN_BRIGHT_WAKE_LOCK - use it when you need screen & keyboard Bright
    FULL_WAKE_LOCK - use it when you need all SCREEN, CPU, Keypad in bright and on.
  3. PARTIAL_WAKE_LOCK - use it when you need only CPU on
    SCREEN_DIM_WAKE_LOCK - use it when you need CPU + Screen in dim mode
    SCREEN_BRIGHT_WAKE_LOCK - use it when you need CPU +  keyboard Bright
    FULL_WAKE_LOCK - use it when you need all SCREEN, CPU, Keypad in bright and on.
  4. PARTIAL_WAKE_LOCK - use it when you need only CPU on
    SCREEN_DIM_WAKE_LOCK - use it when you need CPU + Screen in dim mode
    SCREEN_BRIGHT_WAKE_LOCK - use it when you need CPU +  SCREEN Bright
    FULL_WAKE_LOCK - use it when you need all SCREEN, CPU, Keypad in bright and on.
Show Answer
Share Facebook gmail Twitter
7
while using full wake lock and user presses screen lights off (power button), then what will happen?
  1. Still Screen lights will be on forcefully.
  2. Screen lights & Keyboard will be off, but CPU still running.
  3. Screen lights will be off, and CPU also go to sleep
  4. Screen lights & keyboards lights will be off, but CPU still running.
Show Answer
Share Facebook gmail Twitter
8
When phone is in sleep mode, what are the two components that will keep running even though phone is in sleep mode?
  1. RIL (Radio Interface Layer) & time ticks
  2. RIL (Radio Interface Layer) & alarms
  3. only Call Manager & alarms
  4. only call manager, sms manager, and alarms
Show Answer
Share Facebook gmail Twitter
9
Every day night at 12 o clock I need to post some images to Facebook, in that case I will set repeating alarm for every day night 12 am. But to upload images I want to start service, how should I do this ?
  1. Create a pending intent to start a service, and give it to alarm to fire at every day night 12.
  2. Create a pending intent to start a service, and give it to alarm to fire at every day night 12. Also make sure to acquire full wake lock in onCreate of your service and release wake lock after uploading all images.
  3. Create a pending intent to start a service, and give it to alarm to fire at every day night 12. Also make sure to acquire partial wake lock in onCreate of your service and release wake lock after uploading all images.
  4. option 3 is wrong and option 2 is correct, because partial wake lock may not be available for full period of time.
Show Answer
Share Facebook gmail Twitter
10
Show with one example where memory leak possibility in Android?
  1. class MyActivity extends Activity
    {
            private static Drawable sBackground;
    
            @Override
            protected void onCreate(Bundle state) {
              super.onCreate(state);
      
                TextView label = new TextView(this);
              label.setText("Leaks are bad");
      
                if (sBackground == null) {
                sBackground = getDrawable(R.drawable.large_bitmap);
              }
              
              label.setBackgroundDrawable(sBackground);
              setContentView(label);
    }
  2. class MyActivity extends Activity
    {
            private static Drawable sBackground;
    
            @Override
            protected void onCreate(Bundle state) {
              super.onCreate(state);
      
              TextView label = new TextView(getApplicationContext());
              label.setText("Leaks are bad");
      
                if (sBackground == null) {
                sBackground = getDrawable(R.drawable.large_bitmap);
              }
              
              label.setBackgroundDrawable(sBackground);
              setContentView(label);
    }
  3. class MyActivity extends Activity
    {
            private static Drawable sBackground;
            TextView label;
    
            @Override
            protected void onCreate(Bundle state) {
              super.onCreate(state);
      
                label = new TextView(this);
              label.setText("Leaks are bad");
      
                if (sBackground == null) {
                sBackground = getDrawable(R.drawable.large_bitmap);
              }
              
              label.setBackgroundDrawable(sBackground);
              setContentView(label);
    
             onDestroy()
             {
               label.unbindDrawables()
             }
    }
  4. All above leaks memory.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
13
How many processes, and Virtual machines will be given for each application, by android system?
  1. One process, and one common Virtual machine for all applications.
  2. One process, and one Virtual machine for each application.
  3. One process common for all applications, and one Virtual machine for each application.
  4. One process common for all applications, and one Virtual machine common for each application.
Show Answer
Share Facebook gmail Twitter
14
Does android applications leak memory? Is there any possibility?
  1. android is based on java, java has garbage collector to collect unused memory, so don't need to worry about memory leaks.
  2. Java GC doesn't guarantee about memory leaks, if it finds any memory pointed by some one by mistake, then it might not clean that memory.
  3. option 2 is true, there may be some situations where activity will be pointed by some ui controls, which will be pointed by some static variables, which leads to memory leak in android.
  4. all of the above optoins are true.
Show Answer
Share Facebook gmail Twitter
15
Can a static variable point to an instance variable which is pointing to an activity context?
  1. No, it might lead to dangerous memory leaks.
  2. No, because it is an infinite loop.
  3. Yes, any one can point to any thing as long as both are part of same application.
  4. option 3 is true, because only other apps can't access different process's properties.
Show Answer
Share Facebook gmail Twitter
16
What is the android compilation and execution process/ cycle?
  1. test.java -> compile -> test.class -> dvm -> final machine code
  2. test.java -> compile -> test.class -> dx tool -> .dex -> dvm -> final machine code
  3. test.java -> compile -> test.class -> .dex -> dvm -> final machine code
  4. test.java -> compile -> byte code -> interpreter -> test.class -> dx tool -> .dex -> dvm -> final machine code
Show Answer
Share Facebook gmail Twitter
17
What is anonymous class?
  1. Class for which we can't create any object
  2. Class for which we can create only one object
  3. Class with out any body
  4. class with out a class name but with body.
Show Answer
Share Facebook gmail Twitter
18
What is a singleton class?
  1. Class which can't be extended, means only one definition for that class will be there.
  2. Class for which we can create only one object
  3. Class for which we can't create any object
  4. Class which has only one base class.
Show Answer
Share Facebook gmail Twitter
19
What is the life cycle of  and android application process?
  1. (application)Process will be loaded into memory before loading first component of the application, and will be killed after destroying all components.
  2. (application)Process will be loaded into memory after loading first component of the application, and will be killed after destroying all components.
  3. (application)Process will be loaded into memory before loading first component of the application, and will be always staying in the memory.
  4. (application)Process will be loaded into memory before loading first component of the application, and will be killed after destroying all components.But if user is visiting that application very frequently, then android might not kill the process at all to optimize the loading time of that application.
Show Answer
Share Facebook gmail Twitter
20
How serializable differ from parcel?
  1. Parcels are used in Binders. We use parcels for only IPCs, for normal serialization we use serializables.
  2. Parcels are used in Binders. We can use and also suggestible to use parcels for any kind of serialization use cases.
  3. Binders are used in Parcels. We use Serializables for only IPCs, for normal serialization we use parcels.
  4. Both are same, you can use any of them in any serialization scenarios.
Show Answer
Share Facebook gmail Twitter
Read more papers :