Saturday, January 3, 2015

250 Android Interview Questions - part 1

I am giving set of 250 Android interview questions here, which I have answered in android interview questions and answers - skillgun
                                            
Android Interview Questions:
1.       Draw architecture diagram of android framework.
2.       Which kernel(Operating system) is used in android?
3.       In which language android framework is written?
4.       What does DVM stand for ?
5.       Why DVM why not JVM?
6.       Which layer does DVM sits?
7.       What is the latest version of android? Can you tell me what is the new concepts added in this version?
8.       Explain life cycle of activity?
9.       If I have a broadcast receiver that updates my UI frequently, then where should I register that broadcast receiver in my activity life cycle functions?
10.   Can I save all my databse tables updations in onStop() of activity? If not explain why and also explain where should I save db tables?
11.   What is difference between persistent data and transient data, give one example. Also tell me which activity life cycle function I need to use to save them?
12.   What will happen if I remove super.oncreate() from oncreate() function of activity?
13.   What is the purpose f super.oncreate() ?
14.   Show me how does intent-filter of main activity looks like? What is the action and what is the category?
15.   What is the importance of version code and version name attributes in manifest file?
16.   Can one application have more than on manifest file?
17.   Can I create activity without xml file?
18.   How to create ui without using xml file, show with one example on how to create activity with a linear layout and with two buttons and without having xml file?
19.   Give me two examples of configuration changes in phone?
20.   What is the mandatory life cycle function that will get called in case of configuration changes?
21.   Can I save large images downloaded from internet in onsaveinstancestate() ?
22.   What is the difference between this & getapplicationcontext() ? which one to use when?
23.   Every application will have by default one thread? True or false?
24.   What is ANR (application not responding)? What is the reason for this problem and what is the solution for that problem?
25.   Main thread will have a looper , true or false?
26.   By default a given process will have how many threads? Who will create those threads?
27.   What will happen if I remove oncreate() & onstart() from activity? Will it run?
28.   Can I have an activity without UI?
29.   What is the difference between intent, sticky intent, pending intent?
30.   What is the difference between implicit intent and explicit intent, give one example?
31.   How many components are there in an intent?
32.   Can I give more than one action in a given intent?
33.   Can I give more than one category in a given intent?
34.   Create an intent to start calling a number “12345” ?
35.   what is the importance of putextras in intent? How is it different from setdata() ? any way both are passing data only , so in that case what is the difference?
36.   What is the difference between thread and service?
37.   Can I have a service without thread?
38.   If I want to touch ui from another thread can I touch directly? What will happen if I do so?
39.   How to achieve inter thread communication?
40.   What is the difference between thread and handler thread?
41.   what will happen if I bind a service from a broad cast receiver, is there any problem?
42.   Can I start a service from a broadcast receiver?
43.   How to start a service with foreground priority?
44.   What is the difference between broadcast receiver and a service, where most of the cases both will not have any UI, in that case which one I should use?
45.   If I start an activity with implicit intent, and there is no matching intent-filter then what will happen?
46.   If I send a broad cast with implicit intent, and there is no matching intent-filter then what will happen?
47.   Write a broadcast receiver that gets triggered once phone boot is done?
48.   What will happen if I don’t pass any action in an implicit intent, will it trigger any component?
49.   Can I start a content provider using an intent?
50.   I have one intent filter without any action, then can I trigger this component from outside of this application?
51.   Can I have more than one action in my intent-filter?
52.   Can I have more than one category in my intent-filter?
53.   Can I have extras in my intent-filter?
54.   I want to start something in the background in my activity, should I use thread or should I start service? Why?
55.   If I crate a thread in my activity and if I stop my activity what will happen to that thread, will it be alive or dead?
56.   If I start a service from my activity and if I stop my activity what will happen to that service, will it be alive or dead?
57.   How many ways are there to kill a service?
58.   If I want my service to allow binding, then what is the function that I need to implement in my service class?
59.   Can I create a customized textview?
60.   How many ways you can store persistent data?
61.   What is the use of content provider? Will it support shared preferences?
62.   If I want to share some data with outside applications then what is the component in android to use?
63.   Can one application access other app database directly?
64.   Where does the database get stored?
65.   What is the extension of your shared preference file? Where is it stored?
66.   What is the default shared preference file name of an activity?
67.   What is the difference between task, process, application, and thread?
68.   Does android support multi tasking? If yes explain how to start a new task when you are already running one task?
69.   Does android support multi threading?
70.   What is the mechanism used by android for Inter-process-communication?
71.   How binder is different from serialization?
72.   How serialization differ from parcel?
73.   If I have one application with activity, service, and contentprovider.  Then when I run this program how many process, threads will be created? Is it possible to run these components in more than one process?
74.   What is looper, message queue, and a Handler? Where do you need these components?
75.   Can I send a message from thread-a to thread-b, if thread-b didn’t prepare its looper?
76.   How to avoid synchronization problems in threads?
77.   What is the difference between synchronized block(statement) and synchronized methods?
78.   If I want to create a service with one worker thread how to achieve it?
79.   How to create multi threaded service?
80.   How to create a service with threads and that updates ui?
81.   What will happen if you start a service that does heavy functionality without starting a thread?
82.   What is the UI response time limit in android. (I.E with in how many seconds main thread has to respond for user actions?)
83.   What is the time limit of a broadcast receiver, what will happen if it crosses that time limit?
84.   What is the difference between sendbroadcast(), sendorderedbroadcast(), sendstickybroadcast() ?
85.   If I want to start an activity that gives a response, what is the function I need to use to start that activity?
86.   If I startactivityforresult() and the child activity gets crashed what is the result code obtained by the parent?
87.   In case of low memory if android closes a service forcefully, then will it restart automatically or user has to start it?
88.   What are the various return values of onstartcommand() , and when to use what?
89.   Let’s say my service supports both starting a service and binding a service, and currently two persons have started my service and one person is binding to my service. After 5 minutes person who bound to my service, unbinds it.And other person stops my service, now is my service running in memory or got moved out from memory?
90.   What is empty process and what is its priority? When android will use this concept?
91.   How does android achieves seamlessness. What is the meaning of seamlessness?
92.   What is the difference between menus and dialogs?
93.   How many kinds of menus are there in android?
94.   How many kinds of dialogues are there in android?
95.   I want to design one application where I take username, password and connect to the gmail and show the status of login to the user. Now how to design this application? How many components will be there?
96.   What is the use of httpclient class?
97.   What is the difference between httpget() and httppost() methods, when to use what?
98.   What does httpclient.execute() return?
99.   What  are static variables stored in memory segments?
100.                        If I want to secure my preference file from other activities in my app, then should I use getpreferences() or getsharedpreferences()?

No comments:

Post a Comment