360 Degree infotech interview questions for fresher Android developer with Answers
In this post, we are going to discuss about 360 Degree infotech interview questions for fresher Android developer with Answers.
The questions are mostly on logical thinking ability of the candidates and the theoretical knowledge in android stream. Let us discuss the questions briefly;
1.A)What is session in Android?
Session allows you to store the user data outside your app, ao that when then next time user use your app, you can easily regain his details and act correspondingly.
B)How to use session?
The most easiest and nicest way of using session is through Shared Preferences. They allow you to save and get back the data in the form of key, value pair. You have to call a method getSharedPreferences() to use the shared preferences.
C)What is the purpose of session?
=> To store user-visible groups of related stream data in a useful and shareable manner.
=> For easy querying of the data in a detailed or aggregated fashion.
=> To represent user-friendly groupings of activities.
2. What is shared preference in Android?
-> Shared preference is generally used to store small amount of data, that may be required frequently.
-> Its nothing but a simple XML file that belongs to your app to store key-value pairs of data, which your app needs often.
-> It is mostly used to sort cache/cookie which will be useful when the user’s detail/action is to be known when the user comes back to use the application.
3. Google map API Concepts:
=> The Android app was first released in September 2008,though the GPS-localization feature had been in testing on cellphones since 2007.
=> Google Maps on iOS received significant praise after its standalone app release in December 2012, with critics highlighting its detailed information and design as positives
=> The steps in setting up the Google Maps API through the Google Developer Console are as follows;
1.Setting Up the Developer Console
2.Setting Up the Android Project
3.Initializing the Map
4.Marking Locations
5.Drawing on the Map
=>In August 2018, Google maps changed its over-all view (when zoomed out completely) into a 3D globe dropping the Mercator projection, which was used to project the planet onto a flat surface.
4. Explain ListView with delete options in Android.
i) ListView is a view group that displays a list of scrollable items.
ii) A sample snippet for ListView with delete options are as follows;
final SwipeToDismissTouchListener<ListViewAdapter> touchListener =
new SwipeToDismissTouchListener<>(
new ListViewAdapter(lv),
new SwipeToDismissTouchListener.DismissCallbacks<ListViewAdapter>() {
@Override
public boolean canDismiss(int position) {
return true;
}
@Override
public void onDismiss(ListViewAdapter view, int position) {
customAdapter.remove(position);
}
});
lv.setOnTouchListener(touchListener);
lv.setOnScrollListener((AbsListView.OnScrollListener) touchListener.makeScrollListener());
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (touchListener.existPendingDismisses()) {
touchListener.undoPendingDismiss();
} else {
Toast.makeText(MainActivity.this, “Position ” + position, LENGTH_SHORT).show();
}
}
});
=> When the user swipes left or right, the compiler will execute the above code lines.
=> Row item of listview is removed when the user swipes left or right. onDismiss() method will be executed when user swipes.
=> onDismiss() method will call the remove() method from the adapter class.
=> A position of the listview row item, which is swiped by the user will be sent as a parameter in the remove() method.
5. Recyclerview in Android:
It is an improved version of the ListView and the GridView classes provided by the Android framework.
Recycler view addresses several issues that the existing widgets have.
It also comes with default animations for removing and adding elements.
Recycler view uses a ViewHolder to store references to the views for one entry in the recycler view
References:
https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Session
https://www.tutorialspoint.com/android/android_session_management.htm
https://www.quora.com/What-is-shared-preferences-in-Android-and-when-is-it-used
https://code.tutsplus.com/tutorials/getting-started-with-google-maps-for-android-basics–cms-24635
https://en.wikipedia.org/wiki/Google_Maps#Google_Maps_API
https://developer.android.com/guide/topics/ui/layout/listview
https://demonuts.com/android-listview-swipe-delete/
http://www.vogella.com/tutorials/AndroidRecyclerView/article.html