Most common Android Interview Questions with Answers
Below are some of the Most common Android Interview Questions.
Explain Android Intent
An Intent in Android is a messaging object we can use to request data or an action from another app compotent. Using Intent we can pass data between activities in an application. More Info on Android Intents.
Types of Android Intent:
There are two types of Intents in Android – Explicit Intents and Implicit Intents.
Explicit Intent specifies which application will satisfy the intent, by supplying either the target application package or a fully-qualified component class name. In an application we normally use Explicit intent to start a new Activity instance by specifying the class name and the data to pass with it.
Implicit Intent declares a general action to perform (like downloading a file, sending a mail, opening an URL), which allows a component from another application to handle it.
More Info on Android Intents.
What is Android Activity ?
Android uses Activity class to display a screen with an User Interface in an application using XML design file. It has different methods
onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). Every application must have an Activity or a fragment to display a screen to the users.
Android Activity Lifecycle :
When the user interacts with an Activity, it transits between different lifecycles methods. The Activity lifecycle has different methods
onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). Using this method developers can define how the application will behave when the user enters, pauses or leaves or exits the application. Using this methods developers can also optimize the application for optimal performance.
What is Android Manifest Xml ?
An Android application project must have an AndroidManifest.xml file (case-sensitive) which should be location at the project source folder. Manifest files declares all the important features and information about your App to the build tools, Android Operating System and Google Play stores.
AndroidManifest.xml files contains the package name of your application, permissions and features used by your application and also the Icon of the application. More on Android Manifest file.
What are different tools available for developing Android Applications?
Native Android applications can be developed using
Android Studio, also using
Microsoft Visual Studio in Xamarin. Apart from this Android applications can be made
IntelliJIDEA, DroidEdit, Android-IDE, Cordova, Corona.
What are the Storage options avialable in Android?
Small temporary data like
string, int, Boolean variables can be stored using Android SharedPreferences and for small to medium database requirements Android provides SQLite Database. For enterprise level applications like e-commerce application external database can be connected using Web API (Ex: MS SQL, MySQL). Additionally External storage and Internal storage can be used to save data in XML, Text file or any other file formats. Creating Text file in Android.
What is an APK file?
APK stands for
Android Package Kit. It is an installation file for Android OS. An APK files must be uploaded to the App Stores like Google Play, etc.
What is ADT?
ADT stands for Android development tool. They are used for developing Android applications like
Visual Studio with Xamarin and some more.
What is Service in Android?
Service in Android runs in background. It has no user interface. Example : Task for downloading Songs, Sending Emails.
What is Shared Preference in Android?
Android provides Shared Preferences to store chunk of data in XML files. It can be used to store string, int, Boolean variables.
Example : We can use Shared Preference to store UserId of a user while Login process for future usage. More Info on Android SharedPreferences.
What are fragments in Android?
Fragment is a part of an Android Activity. Fragment represents a behavior or a portion of user interface in a FragmentActivity. Multiple fragments can be combined in single activity to build a multi-page UI.
Can an External Database like MS SQL or MySQL be connected to Android application?
Yes, external databases like MS SQL and MySQL can be connected to Android application using Web services and open source connectors are available to connect this databases.
Please see :
How to connect Android to MySQL Database?
How to connect Android to MS SQL Database?
Permissions in Android :
To use features like writing or reading files on available storage, for using cellular data network or WiFi network, using GPS, making calls, using Camera, a developer must ask for permissions in Android Manifest file, without which applications will fail to perform a specific task. It is used for security purposes by Android System. Permissions are always declared in Android Manifest file.
Before Android 5.0 (API Level 21), permissions in Android Manifest serve the purpose. From Android 5.0 apart from Android Manifest file, application must ask for permissions while the applications opens for the very first time, or else user have to individually permit permissions by going to its details from the Setting options in Android.
<uses-permission android:name=”android.permission.INTERNET” />
<uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” />
<uses-permission android:name=”android.permission.ACCESS_WIFI_STATE” />
What are differents layouts in Android?
Linear Layout, Relative Layout, Table Layout, Coordinator Layout, Absolute Layout.
How many languages does Android Application support?
While developing the application, a developer can add support for multiple languages for different regions and countries. But it is important for the target device to support a specified language.
What are Notifications in Android?
Notifications in Android are like messages that can be displayed in an Overlay format, in the Status bar or small Pop-Ups.
What are Types of Android Notifications?
Status Bar Notification − This is used to display messages in status bar. It is usally used when the application is not running or running in the background. Android services with Broadcast can be used to display Notifications in status bar. Example : When a new sms or messages arrives, missed call update.
Toasts − Toasts are Pop-Up messages used by Android application to display messages to users when a specific task is completed or to display output of a specific method. Example : On unsuccessful Login process, when a tasks like downloading a file is completed.
Dialogues − This are Alert messages like Pop-Up, dialogues inside Android applications using a design file.
Snackbars – Snackbars were introduced from Android 5.0. They cannot be exactly qualified for Android Notifications, but it can be used to display messages just like Toasts.
If you found any mistakes, grammatical errors or wrong Answers please let me by commenting below or mailing me at firstname.lastname@example.org or on Facebook : Hitesh Vikani.
Can you make a tutorial on how to bind data to android expandable listview from mssql server?