Android Interview Questions

Hi Guys, Here are some Android test questions that I have compiled. Search for their answers by reading Android Docs. Post your answers in the comments. If you are too desperate for answers you can try . Which class is used to handle the Bluetooth on Android? Which package provide set of classes required to manage the Bluetooth on android sdk? What is a sticky intent? How to show a non-modal dialog/information on screen? OR What’s the purpose of Toasts. What is a 9-patch image and how to benefit from it? What is adb? Following are some more generous objective…

Read more

Singleton Toast

On Android you may have experienced delayed toasts or overlapping toasts. This causes the toasts being displayed with irrelevant context/activity (e.g. user may have pressed backed, or previous toast is still overriding new one, or when too many toasts are displayed on screen). Consider the code below. It defines a single function for toast, that makes use of context object of Application. The class MyApplication needs to be declared in manifest.xml. The main advantage of such design is reduced footprint for activity’s context object. at any moment only one toast remains on screen reusing single toast object, rather than creating…

Read more