Friday 6 February 2015

How many application tag we can add in manifest ?

As many user wants
Which method is called when the user leaves the activity ?

onPause
Which built-in database is Android have ?

SQLite
Which are must required folders in the android application ?

src & res
What is the default permission for external storage files ?

Public
What does .apk extension stand for ?

Application Package kit
What are the different launch configurations for Android ?

Run and debug
To log messages from your app to LogCat you should use ?

android.util.Log
The root element of AndroidManifest.xml is ?

manifest
The basic building element of Android's user interface is called ?

View
Stores private primitive data in key-value pairs ?

Shared Preferences
Specify the directory name where the XML layout files are stored ?

/res/layout

Thursday 5 February 2015

the method used to access a view element of a layout resource in an activity

findViewById()
a mandatory attribute for any view inside of a containing layout manager

layout_width
Android SDK is compatible with ?

Windows
Mac
Linux

Android Apps can share data among other apps

Content Provider

difference between versioncode and versionname ?

android:versionCode
An internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version number shown to users; that number is set by the versionName attribute. The value must be set as an integer, such as "100". You can define it however you want, as long as each successive version has a higher number. [...]


android:versionName

The version number shown to users. This attribute can be set as a raw string or as a reference to a string resource. The string has no other purpose than to be displayed to users. The versionCode attribute holds the significant version number used internally.

Fragment Life Cycle ?

onAttach()
onCreate()
onCreateView()
onActivityCreated()
onStart()
onResume()
onPaused()
onStop()
onDestroyView()
onDestroy()
onDetach()
What is the difference between activity and fragment in android ?

fragment is a part of an activity, which contributes its own UI to that activity. Fragment can be thought like a sub activity. Where as the complete screen with which user interacts is called as activity. An activity can contain multiple fragments.Fragments are mostly a sub part of an activity.

An activity may contain 0 or multiple number of fragments based on the screen size. A fragment can be reused in multiple activities, so it acts like a reusable component in activities.

A fragment can't exist independently. It should be always part of an activity. Where as activity can exist with out any fragment in it.

Tuesday 3 February 2015

What is the difference between local variables, instance variables, and class variables ?

local variables - declared in the function 
class variables - declared in class, static 
instance variables - declared in class which are non static

What is the difference between intent and intent-filter in android ?

intent is a message passing mechanism between components of android, except for content provider.
intent-filter tells about the capabilities of that component.
What is the difference between getPreferences and getSharedPreferences in android ?

getPreferences(0) - will open or create a preference file with out giving a name specifically. By default preference file name will be the current Activity name. if some one knows this, any once can access getPreference() file using that activity name.  getSharedPreferences("name",0) - will open or create a preference file with the given name. If you want to create a preference file with a specific name then use this function. If you want multiple preference files for you activity, then also you can use this function.  Note: preferences file will be with .xml extension stored in data/data/preferences folder.