Friday, 1 August 2014

Elance Test Android Questions & Answers 2014


Elance Skill Test - Android Questions and Answers 2014

Find Elance Android Test Questions and Answers 2014
Q Android layouts are read from which type of file?

    xaml
    xml
    txt
    res

Q What is the official name of the Android 3.0 SDK?

    Gingerbread
    Froyo
    Donut
    Honeycomb
    Ice Cream Sandwich

Q What is the main hardware platform of Android?

    ARM architecture
    MIPS
    x86
    None of these

Q Every Android application runs in its own process...

    with its own instance of the Dalvik Virtual Machine.
    within a shared system wide instance of the Dalvik Virtual Machine.
    with its own instance of the Java Virtual Machine.

Q Which tag is used to add "Star Rating" in XML layout file

    RatingWidget
    RatingBar
    Stars
    Rating

Q You can retrieve the resources for your applications by using:

    android.app.getResources()
    android.content.pm
    android.content.getResources()

Q In which resource folder do we create an animation file ?

    anim
    raw
    values
    animation
    drawable

Q Android version 2.2 is better known as what?

    Eclair
    Gingerbread
    Ice-Cream Sandwich
    Froyo

Q How do you disable the scrollbars for a webview?

    <WebView android:layout_height="wrap_content" />
    all of these
    <WebView android:scrollbars="none" />
    <WebView android:layout_width="wrap_content" />

Q Which layout is deprecated since version 2.3?

    Table Layout
    Relative Layout
    Absolute Layout
    Frame Layout

Q The correct way to get pass string in an Intent is (where key and value are both string variables):

    intent.putValue(key,value);
    intent.putKey(key,value);
    intent.putExtra(key,value);
    intent.putString(key,value);

Q If your application needs to access information about the devices wi-fi networks, you need to specify:

    <manifest-permission ="android.permission.ACCESS_WIFI_STATE" />
    Both of these
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />.
    None of these

Q True or False: The Android operating system is a multi-user Linux system in which each application is a different user.

    True
    False

Q Android uses what class to communicate a request for an action to be performed?

    Broadcast
    Activity
    Request
    Intent
    Service

Q In order to be notified of a device switching from landscape to portrait view, you should:

    Both of these
    Request changes via the android:configChanges="orientation" attribute for activities in your manifest file
    Override the onConfigurationChanged event

Q Fragments were added in what version of Android (not including the compatibility pack)?

    Version 3.2
    Version 2.3.4
    Version 3.1
    Version 2.1
    Version 3.0

Q What causes an Activity's onDestroy() method to be called.

    The Activity that launched this Activity called finishActivity()
    The Activity called finish().
    The Activity is paused or stopped and it's resources were needed by the operating system.
    All of these reasons.

Q What is the key used for an bundle extra parameter on a PendingIntent holding a location?

    public static final String KEY_STATUS_CHANGED
    public static final String KEY_PROVIDER_ENABLED
    public static final String KEY_PROXIMITY_ENTERING
    public static final String KEY_LOCATION_CHANGED

Q Relative layout has two types of orientations,vertical and horizantal

    false
    true

Q Which of these is NOT a Layout derived from the ViewGroup class?

    AbsoluteLayout
    RelativeLayout
    ListViewLayout
    LinearLayout

Q What is the primary license of Android?

    OSI
    Apache License
    MIT
    GPL

Q C2DM is deprecated and it was replaced by

    Polling
    GCM
    Tokudu
    APS
    GCS

Q Which of the following isn't a valid stage in an Activity's lifecycle?

    onPause
    onCreate
    onFinish
    onStop
    onStart

Q Which of the following was NOT a name used in any previous versions of Android (3.2)?

    Gingerbread
    Eclair
    Honeycomb
    Cannoli

Q A layout that organizes its children into a horizontal or vertical stack

    TableLayout
    LinearLayout
    FrameLayout
    RelativeLayout

Q What is an application component that can perform long-running operations in the background and does not provide a user interface?

    Broadcast receiver
    Activity
    Content-provider
    Service

Q What is the proper order of life cycle methods called when an Activity is first run?

    onCreate(), onRestart(), onResume()
    onCreate(), onStart(), onResume()
    onStart(), onResume, onCreate()
    onCreate(), onResume(), onStart()                                                                                      
    onStart(), onCreate(), onResume()

Q Who can submit applications to the Marketplace?

    Registered Android Market developers
    Anyone and everyone
    Only Google employees
    Only device manufacturers and their employees

Q If you wanted to store a name/value string pair for your Android application, which class would you use?

    android.content.Cookies
    android.content.Resources
    android.content.SharedPreferences

Q The Android SDK tools compile your application into an Android application (.apk file) which...

    contains all the information needed to install the application on an Android device.
    contains information needed by the Universal Mobile Installer to create the install package for Android devices.
    then has to be formatted for installation through the Android installer.

Q Which of these widgets is an input box for a user to enter text?

    TextView
    TextBox
    EditText
    Label

Q Which is NOT a default value used for a Toast length parameter?

    LENGTH_LONG
    LENGTH_SMALL
    LENGTH_SHORT

Q How do you request permissions for your application?

    <requires-permission> in the Android Manifest
    You do not need to request permissions for any application
    <uses-permission> in the Android Manifest
    Submit a request when you publish your application to the android market
    <request-permission> in the Android Manifest

Q Where would we specify which activity should launch first in our app

    Manifest file
    properties file
    All of the above
    Main Class file

Q If your application uses the camera on an Android powered device, the following line should be in your manifest file:

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature="android.hardware.camera" />
    <uses-feature name="camera" />

Q In order to specify layouts so that they adapt to any screen size, specify dimensions in:

    Pixels
    Density-independent pixels

Q Which of the following is used to detect when a user clicks or taps on a button?

    OnTapListener
    OnClickDetecter
    OnClickListener
    OnTouchListener

Q Which of the following are different types of Android application components?

    services
    all of these
    activities
    none of these

Q What is the first method called in the Activity Lifecycle?

    onResume()
    onBegin()
    onCreate()
    onInit()
    onStart()

Q Which statement correctly changes content of a TextView named textLabel to show "Your Text"?

    textLabel.text = "Your Text";
    textLabel.text("Your Text");
    textLabel.setText("Your Text");
    textLabel = "Your Text";

Q Android relies on the Linux kernel for which of the following system services?

    Security
    Both security and network stack
    Network stack
    Neither security nor network stack

Q What is the name of component used to display web pages in the application?

    WebBrowser
    BrowserView
    WebView
    Browser

Q If I set min sdk version to be 8 for an app , on what version(s) will I NOT be able to run the app?

    12
    7
    10
    8
    14

Q The Android Manifest file has what extension?

    .jar
    .java
    .apk
    .xml

Q Do you need to buy an android developer account to start developing and testing applications on Android ?

    No
    Yes

Q Which Virtual Machine (VM) does the android system use?

    Dalvik
    VMLite
    KVM
    Erlang

Q Your Android application components are defined in the...

    AndroidManifest.xml file.
    AndroidManifest.pkg file.
    myApp.xml file.

Q What is the official website for Android programmers?

    developer.android.com
    stackoverflow.com/
    android.google.com
    anddev.org
    eclipse.org/android

Q What database is available for developers in Android?

    There is no available database
    SQL Server
    Oracle
    NoSQL
    SQLite

Q Which of the following are a function of the manifest file?

    all of these
    declare the level of user permissions required.
    declare the minimum API level required

Q Which event listener is used to handle when an Android device has changed orientation?

    PositioningEventListener
    OrientationEventListener
    DeviceOrientationEventListener
    LayoutEventListener

Q Android's main programming language is:

    JavaScripts
    C++
    Java
    VB-Script

Q Externalizing resources is an important part of application development because different resources are needed for:

    Different language versions of the application.
    Different devices.
    All of these
    None of these

Q Which of the following are versions of Android?

    Eclair
    Gingerbread
    Froyo
    All of these

Q What are some examples of direct descendants of the android.view object?

    Neither of these
    ProgressBar
    ViewGroup
    Both of these

Q What package encompasses the interactive UI components of Android such as buttons and text fields?

    android.view.ViewGroup
    android.widget
    android.view

Q What kernel is Android based on?

    Linux Kernel
    XNA
    Mach Kernel
    NT Kernel

Q Which of these ListAdapter subclasses is not a direct subclass of BaseAdapter?

    ArrayAdapter
    SimpleAdapter
    HeaderViewListAdapter
    CursorAdapter

Q Which of the following allows you to instantinate a LocationManager class?

    LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
    LocationManager lm = (LocationManager)Runtime.getSystemServiceInstance
(Context.LOCATION_SERVICE);
    LocationManager lm = new LocationManager(Context.LOCATION_SERVICE);
    LocationManager lm = (LocationManager)getSystem().getService(Context.LOCATION_SERVICE);
    LocationManager lm = (LocationManager)SystemServiceFactory.createSystemService(Context.LOCATION_SERVICE);

Q Which subclass of a Preference class displays a list of entries as a dialog?

    Both of these
    MultiSelectListPreference
    ListPreference
    None of these

Q When an asynchronous task is executed, the task goes through several steps, what option isn't a step of an asynchronous task.

    onPostExecute()
    onBackground()
    onPreExecute()
    onProgressUpdate()

Q What is the Sub Class of TextView...?

    Image Button
    All of These
    EditText
    Radio Button
    Button

Q What is the API version code for the Android 3.2 SDK?

    9
    14
    15
    11
    13

Q Android applications can "borrow" functionality from other applications by using...

    application lifecyle methods
    content Provider system
    intent objects

Q Which programming language is used to develop application for the Android platform?

    C#
    Java
    JavaScript

Q Which of the following is a public constructor for canvas?

    canvas(Context context)
    canvas(int color)
    canvas(AttributeSet set)
    canvas(Bitmap bitmap)

Q Fragments are independent from Activities

    True
    False

Q Maximum size of an android app?

    40mb
    20mb
    100mb
    4 gb
    1.3 gb

Q What manifest uses-configuration should your application use if your application requires a finger activated touch screen on the device.

    <uses-configuration android:reqTouchScreen="finger" /> must be in your manifest.
    <uses-configuration android:reqTouchScreen /> must be in your manifest.
    <uses-configuration android:reqNavigation="finger" /> must be in your manifest.

Q Which callbacks in AsyncTask gets executed on main thread

    doInBackground onPostExecute onProgressUpdate
    onProgressUpdate
    doInBackground
    both onPostExecute and onProgressUpdate
    onPostExecute

Q If you have a fragment which displays a ListViewContaining query results, which API would you use to bring the data over to the device asynchronously?

    android.app.LocalActivityManager
    android.app.LoaderManager
    android.app.ListActivity

Q You should extend which class when using/creating a database?

    SQLiteOpenHelper
    SQLiteDatabasehelper
    SQLiteDatabase
    None of the above
    SQLiteHelper

Q What permission is required for your application to use the device's vibrate hardware?

    android.permission.VIBRATE
    android.hardware.permission.VIBRATE
    android.security.VIBRATE
    android.hardware.VIBRATE
    android.permission.hardware.VIBRATE

Q Android library functions are written of ...?

    C#
    Python
    C/C++
    PHP
    Java

Q Which of these Activity lifecycle events is called when the activity is about to become visible to the user.

    onStart()
    onCreate()
    Resume()
    Start()
    onResume()

Q You can control process usage in your Android application by...

    both of these
    moving your components up in the process lifecycle hierarchy.
    using the android:process attribute on the specific component defined in the manifest.
    neither of these

Q AppWidgetProvider is a subclass of

    BroadcastReceiver
    Activity
    AppWidgetHost
    Intent
    Service

Q What is a benefit of deodexing?

    Custom themes
    Remove files
    Install custom apps
    Speed boost