Cheatography
https://cheatography.com
This is a cheat sheet for Android Interviews
This is a draft cheat sheet. It is a work in progress and is not finished yet.
General Questions
This interview will have different sections. In this first part, I would like to talk about your experience and background. |
----------------------------------------------- |
Would you like to go ahead and tell me about it? |
Which is the most challenging project that you have faced so far? |
Did you run into any obstacles with this project and how did you handle the issue? |
About the teams you have been involved in - Were they distributed in other countries? |
About the Methodology - Was it agile? |
Did you usually follow all the ceremonies? |
Have you ever lead a team? |
|
|
Android Core
Tell all the Android application components. Activities, Services, Broadcast Receiver, and Content Provider.
|
What is Context? How is it used? - Interface to global information about an application environment. - It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc.
|
How many contexts can you mention? Application & Activity
|
What is the AndroidManifest.xml - All App components are declared in this file. - User permissions that the app requires. - Declares hardware and software features used or required by the app - Declares API libraries the app needs to be linked (Maps)
|
What is Application class? - Base class that contains all other components. - It is instantiated before any other class when the process for your application/package is created.
|
Activities
What is an Activity? An activity is the entry point for interacting with the user
|
Can you explain the life cycle of the Activity? |
What happens when the device is rotated? |
How do you avoid this information to be lost? onSavedInstanceState() - This method is used to store data before pausing the activity. onRestoreInstanceState() - This method is used to recover the saved state of an activity when the activity is recreated after destruction.
|
What if I want to send info from one activity to another? Intents (primitive types)
|
But what if I want to send an Object? Parcelable or Serializable
|
Can an Activity be opened from another App? Yes, you need to add an <intent-filter>
element in your manifest file for the corresponding <activity>
element.
|
Services
What is a Service? Long-running operations in the background
|
Foreground Service? Performs some operation that is noticeable to the user
|
Background Service? Performs an operation that isn't directly noticed by the user.
|
Bound Service? - A bound service offers a client-server interface that allows components to interact with the service. - bindService() - Runs only as long as another application component is bound to it
|
Service vs IntentService |
Service: Block UI, Main Thread, Short tasks, Need to stop it
|
IntentService: Async, Need an intent, Worker thread, Not need to stop it
|
What is a JobScheduler? |
|
|
|