Monday, December 12, 2016

UPWORK ANDROID PROGRAMING TEST ANSWER 2016

UPWORK ANDROID PROGRAMING TEST 2016

It is tough to answer the questions in a short time. Here we have categorized the questions. When you are going to seat for exam, follow the categories to answer them. Hope you can find the answer in shorter time.

Upwork Test Answer Adobe Illustrator cs6
Upwork US English Basic Skills Test-2016
Upwork readiness test for beginners - 2016


QUESTIONS ABOUT ''CODING''

1. Consider the code snippet below:
MediaPlayer mp = new MediaPlayer(); 
mp.setDataSource(PATH_TO_FILE);
<Some code here> 
mp.start();
Which of the following should be placed at <some code here>?
  • mp.prepare();
  • mp.prepareAsync();
  • mp.loadMedia();
  • mp.loadSource();
  • mp.loadSource; mp.prepare();
  • no code is required at <some code here> to start back.
2. Consider the XML fragment below, which is taken from one of the files in an Android project:
<MyElement xmls:"http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Some Text>
</MyElement>
Which one of the are true about the XML fragment above?
  • It is taken from the manifest XML file of the Android project.
  • It is taken from an XML file used to define a view.
  • It is taken from the package file (.apk) of the Android project.
  • The xmlns: attribute is a compulsory attribute.
  • If this is not the outer most tag in the XML file then it need not contain the xmlns: attribute
  • MyElement should be the name of a class derived, directly or indirectly, from the view class. 
 
3. Consider the following snippet of code:

<font size =2>
@Override
protected void onStop
{
Super.onStop();
SharedPreferences setting = getSharedPreferences(“MyPrefs”, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean(“MyBool”, true);
<some more code here>
}
Which of the following should be used <some more code here>?
  • </font
  • editor.save(); editor.close();
  • editor.save(); editor.finish();
  • editor.commit();
  • editor.save();
  • editor.close();
  • editor.finish();
4. What does the following code do?
 try {
String token = GoogleAuthUtil.getToken(this, email.
"https://www.googleapis.com/auth/devstorage.read_only")
System.out.println(token);
}  catch (IOExceptioon)  {
System.out.println("IOException");
}  catch (UserRecoverableAuthException e) {
 System.out.println(''UserRecoverableAuthException'');
 } catch (GoogleAuthException e) {
 System.out.println("GoogleAuthException");
}
  • prints token
  • prints IOException
  • prints UserRecoverableAuthException
  • prints GoogleAuthException


5. Consider the XML fragment below, which is taken from one of the files in an Android project:

<MyElement xmlns:”http://schemas.androd.com/apk/res/android”

android:layout_width = “fill_parent”
android:layout_height = “fill_parent”
android:text = “Some Text”>
</MyElement>

Which of the following are true about the XML fragment above?
  • It is taken from the manifest xml file of the Android project.
  • It is taken from an XML file used to define a view.
  • It is taken from the package file (.apk) of the Android project.
  • The xmlns: attribute is a compulsory attribute.
  • If this is not the outer most tag in the XML file then it need not contain the xmlns: attribute.
  • MyElement should be the name of a class derived, directly or indirectly, from the View class.

6. Consider the code snippet below:

public class MyReceiver extends PhoneStateIntentReceiver
{

    @Override
    public void onReceiveIntent(Context context, Intent intent)
    {
        if (intent.action == Intent.CALL_ACTION)
        {

        }
    }
}

Assuming that notifyPhoneCallState has been called to enable MyReceiver to receive notifications about the phone call states, in which of the following cases will the code in get executed?

  • When the device receives an incoming phone call
  • When an outgoing phone call is initiated on the device.
  • When the user presses the CALL button on the device.
  • The code in will never get executed.
6. What does the following code do?
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager)
getSystemService(Context.CONECTIVITY_SERVICE);
          NetworkInfo networkInfo=connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
  • Checking Network connection
  • Checking only WIFI network connection.
  • Checking only Bluetooth data connection
  • Checking only Ethernet data connection

  QUESTIONS START WITH ''WHAT''


1. What is the maximum supported file for a single APK file(excluding expansion packages) in the Google Play Store?
  • 50MB
  • 2GB
  • 30MB
  • Unlimited
2. What is Android?
  • A new programming language that can be used to develop applications for mobile devices.
  • A new IDE that can be used to develop applications for mobile devices.
  • A software stack for mobile devices that includes an operating system, middleware and key applications.
  • A new mobile developed by Google.
3. What is the ContentProvider class?
  • To play rich media content files.
  • To create and publish rich media files.
  • To share data between Android applications.
  • To access the global information about an application environment.
  • To maintain global state.
4. What is Android-dx?
  • A framework to create unit tests for Android projects.
  • A resource editor to create user interface for Android applications.
  • A tool to generate Android byte code from .class files.
  • An emulator to execute and debug Android projects
5. What is "Android-Positron"?
  • A command line tool to create Android project files.
  • A framework to create unit tests for Android projects.
  • A tool to generate Android byte code from .class files.
  • An emulator to execute and debug Android projects.
6. What is the "Android activityCreator"?
  • A command line tool to create Android project files.
  • A framework to create unit tests for Android projects.
  • A resource editor to create user interface for Android applications.
  • A tool to generate Android byte code from .class files.
  • An emulator to execute and debug Android projects
7. What is the ListActivity class used for?
  • Create a view to display a list of items from data source.
  • List all the activities currently running on the Android device.
  • List the activities that are installed on the Android device.
  • List the activities whose IntentFilters match with a particular Intent type.
8. What is the maximum supported size for a single expansion file in the Google Store?
  • 50MB
  • 2GB
  • 30MB
  • Unlimited


9. What is correct regarding GCM – Google Cloud Messaging service?

  • It does server to device communication.
  • It does device to server communication.
  • It does device to server communication and vice versa.
  • It does device to device communication.



10. What is the interface Spannable used for?

  • Manipulate text that can span across multiple pages.
  • Manipulate text that can span across multiple TextView windows.
  • This is the interface for text to which markup objects can be attached and detached.
  • String parsing.

11. What is the correct way to restrict app visibility on Google Play to devices that have a camera?
  • <uses-feature android:name=”android.hardware.camera”/>
  • <uses-feature android:name=”android.hardware.camera” android:required=”true” />
  • <uses-feature android:name=”android.hardware.camera.front” android:required=”true” />
  • <uses-permission android:name=”android.permission.CAMERA”/>


 QUESTIONS START WITH ''WHICH''
1. Which of the following are true about Intent.CALL_ACTION and Intent.DIAL_ACTION?
  • Both of them are used to dial a phone number on the device.
  • Intent.CALL_ACTION is true when a phone call is received on the device.
  • Intent.CALL_ACTION is used when a phone number is to be dialed without showing a UI on the device.
  • Intent.DIAL_ACTION is used when a phone number is to be dialed without showing a UI on the device.
  • Intent.CALL_ACTION is used when a phone number is to be dialed without the user having to explicitly initiate the call.
  • Intent.DIAL_ACTION is used when a phone number is to be dialed without showing a UI on the user having to explicitly initiate the call.
2. Which of the following attributes in the manifest file defines version information of an application for the Google Play Store (as opposed to define version information for display to users)?
  • android:versionCode
  • android:versionName
  • android:targetSdkVersion
  • android:maxSdkVersion
3. Which of the following tools can be used to reduce APK package size?
  • lint
  • ProGuard
  • zipalign
  • etc tool
4. Which of the following would you have to include in your project to use the APIs and classes required to access the camera on the mobile device?
  • import android.drivers;
  • impoort android.hardware.camera;
  • import android.camera;
  • import android.util;
  • import andriod.hardware;
5. Which of the following programming languages can be used to develop software applications for the Android platform?
  • Java
  • C# with .NET Compact Framework for mobile devices.
  • C programming language.
  • Android programming language.
6. Which of the following is the best way to request user permission if an Android application receives location updates from both NETWORK_PROVIDER and GPS PROVIDER?
  • Adding this file to the Android manifest file: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  • Adding this file to the Android manifest file: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION/><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
  • Adding this file to the Android manifest file: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  • Adding this file to the Android manifest file: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION_UPDATED"/>
7. Which of the following can be accomplished by using TelephoneNumberUtil class?
  • Save a phone number to the contacts in the phone device.
  • Retrieve a phone number from the contacts in the phone device.
  • Delete a phone number from the contacts in the phone device.
  • Format an international telephone number.
  • Setting and retrieving the call forwarding phone number on the device.
8. Which of the following packages provide the classes required to manage the bluetooth functionality on an Android device?
  • android.hardware
  • android.bluetooth
  • android.bluez
  • org.bluez
9. Which of the following can be used to bind data from an SQL database to a ListView in an Android application?
  • SimpleCursor
  • SimpleCursorAdapter
  • SimpleAdapter
  • SQLiteCursor
  • SQLLitwAdapter
10. Which of the following is the parent class for the main application class in an Android application that has a user interface?
  • MIDLet
  • AndroidApp
  • Activity
  • AppLet
  • Application
11. Which of the following is/are appropriate for saving the state of an Android application?
  • Activity.onFreeze()
  • Activity.onPause()
  • Activity.onStop()
  • Activity.onDestroy()
12. Which of the following would you have to include in your project to use the SimpleAdapter class?
  • import android.content;
  • import android.widget;
  • import android.database;
  • import android.database.sqlite;
  • import adnroid.util;
13. Which of the following statements are correct with regards to publishing updates of apps on Google Play?
  • The android:versionCode attribute in the manifest file must be incremented and the APK file must be signed with the same private key.
  • The android:versionCode attribute in the manifest file must be same and the APK file must be signed with the same private key.
  • The android:versionCode attribute in the manifest file must be incremented and the APK file must be signed with the new private key.
  • The android:versionCode attribute in the manifest file must be same and the APK file must be signed with the new private key.
14. Which of the following should be used to save the unsaved data and release resources being used by an Android application?
  • Activity.onStop()
  • Activity.onPause()
  • Activity.onDestroy()
  • Activity.onShutdown()
  • Activity.onFreeze
15. Which of the following are true about enabling/disabling menu items from an Activity class?
  • On Create Options Menu can be used to enable/disable some menu items in an Android application.
  • On Prepare Options Menu can be used to enable/disable some items in an Android application.
  • On Show Options Menu can be used to enable/disable some items in an Android application.
  • The menu items in an Android application cannot be disabled
16. Which of the following statement is correct regarding StrictMode?
  • StrictMode detects improper layouts
  • Strictmode detects operation which blocks UI
  • StrictMode detects the speed of the connection
  • All of the above
17. Which of the following classes is not used in working with database?
  • SQLiteOpenHelper
  • SQLiteDatabase
  • ContentProvider
  • DatabaseHelper
18. Which of the following are valid ways to deploy an Android application to a device?
  • Using the "adb install/path/to/apk" command prompt/terminal, when USB Debugging Mode is enabled in the device.
  • Exporting and signing the package, then browsing it to install.
  • Launching the application from an IDE, when USB Debugging Mode is enabled in the device.
  • All of these.
19. Which of the following 4 classes does not relate to others?
ApplicationInfo, SyncInfo, ActivityInfo, PackageInfo
  • ApplicationInfo
  • SyncInfo
  • ActivityInfo
  • PackageInfo
20. Which of the following protocols are provided by Google for GCM Connection servers?
1. A) HTTP
2. B) XMPP
3. C) SOAP
4. D) RMI
  • A and B
  • A,B,C
  • C,D
  • All of these
21. Which of the following statements are correct with regards to calling place GoogleAuthUtil.getToken()?
1. A) call getToken() on the UI thread
2. B) call getToken() on AsyncTask
  • Statement A is true, while Statement B is false.
  • Statement B is true, while Statement A is false.
  • Both statements are ture.
  • Both statements are false.
22. Consider the following snippet of code:
@override
 protected void onStop
{
Super.onStop();
SharedPreferences setting = getSharedPreferences("MyPrefs",0);
editor.putBoolean("MyBool",true);
<some code here>
}
Which of the following should be used<some more code here>?
  • editor.save();editor.close();
  • editor.save();editor.finish();
  • editor.commit();
  • editor.save();
  • editor.close();
  • editor.finish();
23. Which of the following are UI elements that you can use in a window in an Android application?
  • TextBox
  • TextView
  • TextField
  • EditText
  • TextElement
24. Which of the following is not Content Provider?
  • Contacts
  • Shared Preferences
  • Bookmarks
  • Settings 
25. Which of the following formats is not supported in Android?
  • MP4
  • MPEG
  • AVI
  • MIDI
26. Which of the following peremissions and configurations must be added in manifest file for implementing GCM client?
A) com.google.android.c2dm.permissioon.RECEIVE
B) android.permission.INTERNET
D) android.permission.GET_ACCOUNTS
E) android.permission.WAKE_LOCK
F) A receiver for com.google.android.c2dm.intent.RECEIVE, with the category set ass application Package. The receiver should require the com.google.android.c2dm.SEND permission.
  • A,B,C and D
  • C,D,E and F
  • A,B,E and F
  • all of those
27. Which of the following sensors is only hardware based?
  • Linear acceleration sensor
  • Gravity sensor
  • Rotation Sensor
  • Accelerometer sensor
28. Which of the following widgets helps to embed images in activities?
  • Image View
  • Image Button
  • Both of the above
  • None of these
29. Which of the following statement are correct with regards to running of the Sync  Adapter?
A) Running sync adapter in response to a user request.
B) Running sync adapter periodically by setting a period of time to wait between runs, or by running it at certain times of the day, or both.
  • Statement A is true, while statement B is false
  • Statement Bis true, while statement A is false
  • Both statements are true
  • Both statements are false.
30. Which of the following permissions are needed to perform the network operations through internet?
a) INTERNET
b) ACCESS_NETWORK_STATE
  • a
  • b
  • Both
  • None 
31. Which of the following is correct to use for data transfer regularly and efficiently, but not instantaneously?
  • AsyncTask
  • IntentService
  • Sync adapters
  • All of those
32. Which of the following can you use to display a progress bar in an Android application?
  • ProgressBa
  • ProgressDialog
  • ProgressItem
33. Which of the following are true?
  • startActivity and startActivityForResult can both be used to start a new activity from your activity class.
  • only Only startActivityForResult can be used to launch a new activity from your activity class.
  • startActivity(myIntent); and startActivityForResult(myIntent,-1); have the same result.
  • When startActivity is used to launch a new activity from your activity class then your activity class gets notified when the new activity is completed.
  • When startActivityForResult is used to launch a new activity from your activity class then your activity class gets notified when the new activity is completed.
34. Which of the following are valid features that you can request using requestWindowFeature?
  • FEATURE_NO_TITLE
  • FEATURE_NO_ICON
  • FEATURE_RIGHT_ICON
  • FEATURE_TRANSPARENT_WINDOW
35. Which of the following can be used to navigate between screens of different Android applications?
  • Binde
  • Flow
  • Navigate
  • Intent
  • ApplicationContext
36. Which of the following procedures will get the package name of an APK file?
  • Looking for the package attribute's value of the <manifest> element in the manifest file.
  • Executing the command, "pm list packages -f", in the ADB shell.
  • Programmatically, using PackageManager in an installed Android app.
  • Using the AAPT platform tool, "aapt dump badging apkName.apk".
37. Which of the following is not a life cycle methods of an Activity that can be implemented to perform various operations during the lifetime of an Activity?
  • onCreate
  • onLnit
  • onCompleteThaw
  • onRestart
38. Which of the following are Android build modes?
  • Debug mode
  • Release mode
  • Production mode
  • Development mode
39. Which of the following are classes that can be used to handle the Blutooth functionality on a device?
  • Adapte
  • Manage
  • Matche
  • BlutoothAdapte
40. Which of the following statements are correct with regards to signing applications?
a) All applications must be signed
b) No certificate authority is needed
c) When releasing application special debug key that is creaed by the Android SDK uild tools can be used.
  • a and b are true
  • a and c are true
  • b and c are true
  • All statements are true   
 We will update this question soon.....please follow us!!!!

No comments:

Post a Comment