Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2.
3.
4.
5.
6.
7.
What is the latest version of android? Can you tell me what is the new concepts added in this
version?
8.
9.
If I have a broadcast receiver that updates my UI frequently, then where should I register that
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()?
101.
I want to store huge structured data in my app that is private to my application, now
should I use preferences [or] files [or] sqlite [or] content provider?
102.
My application has only a service, and my service performs heavy lift functionality to
connect to internet and fetch data, now should I create a thread or not? If so why?
103.
I want to write a game where snake is moving in all the directions of screen randomly,
now should I use existing android views or should use canvas? Which is better?
104.
Can I have more than one thread in my service? How to achieve this?
105.
When lcd goes off, what is the life cycle function gets called in activity?
106.
When a new activity comes on top of your activity, what is the life cycle function that
gets executed.
107.
When a dialog is displayed on top of your activity, is your activity in foreground state or
visible state?
108.
109.
110.
I started messaging app -> composer activity -> gallery -> camera -> press home
Continuation to above question, now If I launch gmail application will it create a new
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
When an activity is being started with an intent action "MY_ACTION", how can I see
124.
How to take an image from gallery and if no images available in gallery I should be able
126.
127.
128.
129.
130.
131.
132.
133.
What is custom adapter, when should I use it. what are the mandatory functions I need
135.
136.
What is adb? What is the command to install one application using adb command
prompt?
137.
138.
How will you analyze a crash, how will fix using logcat?
139.
140.
141.
142.
143.
144.
I want to access a functionality from one application to other application, then should I
What is the difference between local variables, instance variables, and class variables?
147.
148.
What is singleton class, where to use it? show with one example how to use it?
149.
If I want to listen to my phone locations, what all the things I need to use? Is it better to
My phone don't have network signal and satellite signal, now is there any way to fetch
I have some data available in docs.google server, and I want to display it in tabular
If I want to start some heavy weight functionalities that takes lot of battery power like
Why you should not do heavy functionality in onresume and onpause() of your activity?
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
When you fire an intent to start with ACTION_CALL , what is the permission required?
166.
167.
168.
How to achive security to your service programmatically in such a way that your service
What are the sequence of tests done to map intent with an intent-filter?
170.
171.
172.
173.
If I want to notify something to the user from broadcast receiver, should I use dialogs or
notifications? Why?
174.
175.
sendstickybroadcast? Why?
176.
If I want to set an alarm to trigger after two days, how should I implement it? assume
What is sleep mode? What will happened to CPU once screen light goes off?
179.
How many kinds of wake locks are available, which one to use when?
180.
If I am using full wake lock and user presses screen lights off, what will happen?
181.
When phone is in sleep mode, what are the two components that will keep running
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 ?
183.
When you start an activity from a notification, will it start as new task or old task?
184.
Why android follows single threaded ui mode? How other threads can manipulate ui
views?
185.
186.
187.
188.
If I want to write one application for both phones and tablets, what should I use in my
UI?
189.
I have a thousands of items in my array, and I want to display it in listview, what is the
191.
Write one application which will get triggered immediately after booting.
192.
193.
How will pass information from one activity to other activity, let's say pass userid, city, and
Write code for an xml file having a relative layout with employee registration form.
195.
Get a table information from the database and show it in table UI format.
196.
how should I show it this dynamically growing UI. Should I load all in single shot or any optimization can be
done?
197.
198.
What is String constant pool? What is the difference between below two statements?
i.
199.
ii.
iii.
If I want to share a String between two threads, and none of threads are modifying my
If I want to use my String within only one thread which is modifying my String, then
which class I have to use? Similarly if I want to my string to be changed by more than one thread then
which class I have to use?
201.
How does String class look like? What is final class meant for? How will you implement
203.
204.
How will you write a class in such a way that it should generate immutable objects?
205.
206.
What is the difference between char & Character classes? Which one is value type and
What is the meaning of pass by reference? If I have an integer array and if I pass that
I want to use array in my program which has to grow dynamically, in that case should I
use Array [or] ArrayList [or] Vector? What is the difference between arraylist and vector? Which one of
them is not part of collections framework of JAVA?
209.
I want to use dynamically growing array shared between two threads, should I use
arraylist or vector?
210.
framework in such a way that I should be able to read, write, modify & delete them very fastly. Which
datastructure should I use ? arraylist [or] linkedlist [or] hashsets [or] hashmap ?
211.
Write a program in such a way that Thread1 will print from 1-1000 & Thread2 will print
from 1000-1. Thread1 should sleep for 1 second at every 100th location. Thread2 should interrupt thread1
once thread2 reaches 500.
212.
213.
If Thread1 interrputs Thread2, how Thread2 should handle it? (Generally how threads
should handle interruptions?) how will thread2 know that other threads are interrupting it?
214.
What is interrupted exception? Which functions will throw this exception? How to
handle it?
215.
Assume that two threads t1, & t2 are running simultaneously in single core CPU. How
Runnable interface? Which one is better, justify your answer in terms of design.
217.
What will happen if you return from run() function of your thread?
218.
What is the difference between checked & unchecked exceptions? Which one
ArithmeticException, InterruptedException, IOError, IOException. In this list which exceptions programmer has
to handler compulsorily? Categorize above exception list into ERROR/ RUNTIME EXCEPTION/ REST
categories.
220.
Assume that I am writing a function which likely to throw checked exception, in that
How one should handle checked exceptions? Mention 2 ways to handle it.
222.
I am writing a function where it is likely that checked exception may come, I want to
handle it in my function and I want to pass that exception to my parent caller also. How do I achieve it?
223.
224.
225.
226.
Will java ensure that finalize will be executed all the time immediately after object is
What is 9 patch image, how is it different from .png images? Why we have to use this in
android? How will it help in the scalability of an image for various screens?
228.
What is the difference between synchronized method and synchronized block? If I have
a huge function where only two lines of code is modifying a shared object then should I use synchronized
block or method?
229.
230.
How many ways a server can communicate (Send data) to a mobile application? Which
What is JSONArray & JSONObject. Show this with one example by requesting one
Name some sites which extensively use JSON in communicating their data with clients.
233.
What is the permission you need to take for fetching GPS locations, & reading contacts.
How will you display data base information in a table kind of architecture in android?
236.
237.
Take data base cursor of employee (eno, ename, salary) into a cursor, fill into a list view
where each item should have a check box also, how will you implement it in android?
238.
What is the difference between constructor and static block. Can I initialize static
variables in constructor?
239.
I want to use a private variable of Class-A in classB directly without using any function.
I want to create a class in such a way that nobody should be able to create object for
Can I access instance variables in a static function? Can I access static function
Why is multiple inheritance of classes not allowed in java? If I want to get functions of
Does java allow multiple inheritance of interfaces? Can one interface extend other
245.
246.
247.
How does default constructor look like? What super() call does in a constructor?
248.
Why does base class constructor gets executed before executing derived class
249.
How will you achieve dynamic polymorphism using over riding? Justify usage by taking
251.
What is the difference between static/compile time linking & dynamic/run time linking?
253.