Flashcards
Android Interview Questions
Cards in this deck (26)
- 1Which dialog boxes can you use in Android?-AlertDialog: up to 3 buttons, list of selectable elements
-ProgressDialog: Extension on A.D, Shows progress wheel or bar
-DatePickerDialog: Displays Calendar to choose date
-TimePickerDialog: Displays clock to choose time - 2What is the compiled virtual resource that can be used as a background, title or other part in the screen?A Drawable resource
-Different folders for different resolutions - 3How can 2 android apps share the same Linux User ID and VM?App must sign in with same certificate
- 4Can we deploy executable jars on Android?No, Android does not support JAR files
- 5Is it ok to change the name of an app after deployment?NO, references can be broken, and possibility of breaking an otherwise in production app
- 6How can ANR be prevented?To introduce tasks on a Child Thread.
Lesson the Main Thread's work - 7How can applications perform actions that are provided by other apps?With intents. We can implicitly or explicitly call certain actions which other apps contain
- 8How to pass data to sub-activitiesWith the use of bundles.
We add data to bundles to be passed with intents - 9Difference between Explicit and Implicit Intent?Explicit: We tell the system which activity or system component we should use
Implicit: We declare the action we want to perform and the system will check what can handle the request - 10When should we use a Fragment over an Activity?Activities: should be used when we need to swap the entire screen.
Fragments: When ui and logic is going to be used across multi activities,
Data that needs to be saved when activity restarts,
when using nav features linked with fragments -> ex. Swipe View - 11How do we ensure that the user can hit the back button to return to the previous fragment?When we call the fragment in the first place (going to said frag), we must add that frag to the back stack.
- 12How would you create a multi-threaded app without using the Thread class?Runnable: if we only override the run() and no thread()s
- 13Should you ever extend from a class?NO, only if we need to modify is functionality
- 14What is a Thread Pool?Is a task queue and a group of worker threads, which allows us to run multiple parallel instances of tasks.
- 15How can we access data from a ContentProvider?-App has to have read access.
-Get ContentResolver object.
-Construct a Query to gather.
-Use's Cursor to GET data.
-Best used on a separate thread - 16What is Serializable?-Standard JAVA interface.
-Used mainly for JSON objects
-Creates alot to temp objects - 17What is Parcelable?-Optimized for Android
-Fully customizable
-Less garbage objects than Serializable
- - 18What is an Adapter?What bridges are List views (Recycler, List, Grid) with the data that populates them
- 19Outline creating a simple VIEW?-Create XML file
-Add constructor() method
-Instantiate Paint object
-add custom attributes
-override onSizeChanged/onMeasure()
-Draw view with onDraw() - 20What is the major difference between ListVIew and RecyclerView?-ViewHolder pattern is entirely optional in ListView, but is required in RecyclerView
-ListView only supports vertical scrolling
-RecyclerView supports vertical and horizontal scrolling - 21How can we optimize View usage?-Checking fro excessive overdraw
...GPU Debug option...
-Flattening our View Hierarchy
...use hierarchy view...
-Measure how long it takes to complete
measure, layout and draw phases - 22What is handler typically used for?-Is used to communicate between threads
-To pass background thread to main thread - 23Can you update the UI from any other thread that is not the Main Thread?No, UI updates are only allowed from the Main Thread
- 24How to create a Bound service through AIDL?-Define Interface in AIDL. file
-Save file in src of hosting activity and any app that uses it
-Build app
-Implement created IBinder interface
-Extend service and override onBind() - 25When might we use FrameLayout?-If we add multiple views it will stack them one over the other
-If we need overlapping views
-Its a simple layout and thats what we should always use -> SIMPLEST - 26How do we supply construction args to a Fragment?-Args are passed via Bundle.SetArgs()
-GetArgs()
Information
- Description
- Android Flashcards on Android Interview Questions , created by andrew tittle on 31/07/2019.
- Created by
- andrew tittle
- Views
- 0
- Rating