Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

Upwork Android Programming Test Answer

In this post you will find all the Answers of Android Programming Test from Upwork Mobile Technologies category, please press CTRL + F to find your desired answers of the test questions.
-------------------------------------------------------------------------------------------------------------------

1. Which of the following are UI elements that you can use in a window in an Android application?
 Answers: • TextView -- or -- . EditText

 2. What is the correct way to fix if checking the status of the GPS_PROVIDER throws SecurityException?
 Answers: • request permission for ACCESS_FINE_LOCATION

 3. Which of the following is not Content Provider?
 Answers: • Shared Preferences

 4. 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 created by the Android SDK build tools can be used.
 Answers: • all statements are true

 5. What does the following code do?

 SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE);
 List<Sensor> sensors = mgr.getSensorList(Sensor.TYPE_ALL);
 for (Sensor sensor : sensors) {
 System.out.println(""+sensor.getName());
 }
 Answers: • prints names of all available sensors in device

 6. 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 (IOException e) {
 System.out.println("IOException");
 } catch (UserRecoverableAuthException e) {
 System.out.println("UserRecoverableAuthException");
 } catch (GoogleAuthException e) {
 System.out.println("GoogleAuthException");
 }
 Answers: • prints token

 7. Which of the following is correct to use for data transfer regularly and efficiently, but not instantaneously?
 Answers: • Sync adapters

 8. What is the ListActivity class used for?
 Answers: • Create a view to display a list of items from a data source.

 9. Using a content provider, which of the following operations are able to perform?
 a) create
 b) read
 c) update
 d) delete
 Answers: • b, c and d

 10. Which of the following widgets helps to embed images in activities?
 Answers: • both of above



 11. What is the best way of opening camera as sub-activity?
 Answers: • Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, 1); }

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

 13. Which of the following sensors is only hardware-based?
 Answers: • accelerometer sensor

 14. Which of the following formats is not supported in Android?
 Answers: • AVI

 15. Which of the following permissions and configurations must be added in manifest file for implementing GCM Client?

 A) com.google.android.c2dm.permission.RECEIVE
 B) android.permission.INTERNET
 C) android.permission.GET_ACCOUNTS
 D) android.permission.WAKE_LOCK
 E) applicationPackage + ".permission.C2D_MESSAGE"
 F) A receiver for com.google.android.c2dm.intent.RECEIVE, with the category set as applicationPackage. The receiver should require the com.google.android.c2dm.SEND permission
 Answers: • all of these

 16. Which of the following permissons is needed to perform the network operations through internet?
 a) INTERNET
 b) ACCESS_NETWORK_STATE
 Answers: • a

 17. Consider the following snippet of code:

 @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>?
 Answers: • editor.commit();

 18. What does the following statement define?

 It provides query(), insert(), update(), and delete() methods for accessing data from a content provider and invokes identically-named methods on an instance of a concrete content provider.
 Answers: • ContentResolver

 19. What is the advantage of using AsyncTaskLoader instead of AsyncTask?
 Answers: • less work with the configuration of application

 20. What does the following code do?

 public boolean isOnline() {
 ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
 NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
 return (networkInfo != null && networkInfo.isConnected());
 }
 Answers: • checking Network connection.

 21. Which of the following statements 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.
 Answers: • Both statements are false.

 22. Which of the following statements are correct with regards to calling place GoogleAuthUtil.getToken()?
 A) call getToken() on the UI thread
 B) call getToken() on AsyncTask
 Answers: • Statement B is true, while Statement A is false.

 23. Which of the following protocols are provided by Google for GCM Connection Servers?
 A) HTTP
 B) XMPP
 C) SOAP
 D) RMI
 Answers: • A and B

 24. Which of the following 4 classes does not relate to others?

 ApplicationInfo, SyncInfo, ActivityInfo, PackageInfo
 Answers: • SyncInfo

 25. Which of the following are valid ways to deploy an Android application to a device?
 Answers: • All of these.

 26. Which of the following classes is not used in working with database?
 Answers: • DatabaseHelper

 27. 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?
 Answers: • MyElement should be the name of a class derived, directly or indirectly, from the View class.

 28. Which of the following statement is correct regarding StrictMode?
 Answers: • All of the above

 29. 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>?
 Answers: • mp.prepare();

 30. 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?
 Answers: • When an outgoing phone call is initiated on the device.

 31. Which of the following are true about enabling/disabling menu items from an Activity class?
 Answers: • onPrepareOptionsMenu can be used to enable/disable some menu items in an Android application.

 32. Which of the following should be used to save the unsaved data and release resources being used by an Android application?
 Answers: • Activity.onDestroy()

 33. Which of the following statements are correct with regards to publishing updates of apps on Google Play?
 Answers: • The android:versionCode attribute in the manifest file must be incremented and the APK file must be signed with the same private key.

 34. Which of the following would you have to include in your project to use the SimpleAdapter class?
 Answers: • import android.widget;

 35. Which of the following is/are appropriate for saving the state of an Android application?
 Answers: • Activity.onPause()

 36. Which of the following is the parent class for the main application class in an Android application that has a user interface?
 Answers: • Activity

 37. Which of the following can be used to bind data from an SQL database to a ListView in an Android application?
 Answers: • SimpleCursorAdapter

 38. 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>?
 Answers: • mp.prepare();

 39. Which of the following packages provide the classes required to manage the Bluetooth functionality on an Android device?
 Answers: • android.bluetooth

 40. Which of the following can be accomplished by using the TelephoneNumberUtil class?
 Answers: • Format an international telephone number.

 41. 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?
 Answers: • Adding these two lines to the Android manifest file: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

 42. Which of the following are true about PhoneStateIntentReceiver.notifyPhoneCallState?
 Answers: • notifyPhoneCallState has to be called if your application wishes to receive a notification about an incoming phone call.

 43. Which of the following statements are correct with regards to Content Providers?

 A) A content provider allows applications to access data.
 B) A content provider must be declared in the AndroidManifest.xml file.
 Answers: • Both statements are true.

 44. Which of the following functions will return all available Content Providers?
 Answers: • List<ProviderInfo> returnList = new ArrayList<ProvderInfo>(); for (PackageInfo pack : getPackageManager().getInstalledPackages(PackageManager.GET_PROVIDERS)) { ProviderInfo[] providers = pack.providers; if (providers != null) { returnList.addAll(Arrays.asList(providers)); } } return returnList;

 45. What is the purpose of the ContentProvider class?
 Answers: • To share data between Android applications.

 46. Which of the following are true?
 Answers: • Both startActivity and startActivityForResults start an activity asynchronously.

 47. Which of the following is the immediate base class for Activity and Service classes?
 Answers: • Context

 48. Which of the following are classes that can be used to handle the Bluetooth functionality on a device?
 Answers: • BluetoothAdapte

 49. How many expansion files can an APK file have? Select all correct options.
 Answers: • two

 50. Which of the following are Android build modes?
 Answers: • Debug mode

 51. What is "Android-dx"?
 Answers: • A tool to generate Android byte code from .class files.

 52. 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?
 Answers: • MyElement should be the name of a class derived, directly or indirectly, from the View class.

 53. Which of the following fields of the Message class should be used to store custom message codes about the Message?
 Answers: • what

 54. Suppose Screen1 is the main screen of an Android application MyAndroid. Now if another screen, Screen2 has to be opened from Screen1, then which of the following are true?
 Answers: • Screen2 can return a result code to Screen1 if launched with startActivityForResult.

 55. Select the two function calls that can be used to start a Service from your Android application?
 Answers: • startService

 56. Which of the following Integrated Development Environments can be used for developing software applications for the Android platform?
 Answers: • Eclipse

 57. Which of the following can you use to display an HTML web page in an Android application?
 Answers: • WebView

 58. 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
 Answers: • editor.commit();

 59. What is "Android-Positron"?
 Answers: • A framework to create unit tests for Android projects.

 60. Which of the following can you use to add items to the screen menu?
 Answers: • Activity.onCreateOptionsMenu

 61. 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?
 Answers: • onCompleteThaw

 62. What is the interface Spannable used for?
 Answers: • This is the interface for text to which markup objects can be attached and detached.

 63. What is correct regarding GCM - Google Cloud Messaging service?
 Answers: • It does device to server communication and vice versa.

 64. Which of the following procedures will get the package name of an APK file?
 Answers: • Programmatically, using PackageManager in an installed Android app.

 65. What is the maximum supported file size for a single APK file (excluding expansion packages) in the Google Play Store?
 Answers: • 50MB

 66. What is Android?
 Answers: • A software stack for mobile devices that includes an operating system, middleware and key applications.

 67. Which of the following can be used to navigate between screens of different Android applications?
 Answers: • Intent

 68. Which of the following are valid features that you can request using requestWindowFeature?
 Answers: • FEATURE_NO_TITLE

 69. Which of the following are true?
 Answers: • startActivity and startActivityForResult can both be used to start a new activity from your activity class.

 70. Which of the following can you use to display a progress bar in an Android application?
 Answers: • ProgressDialog

 71. Which of the following can be used to handle commands from menu items in an Android application?
 Answers: • onOptionsItemSelected

 72. Fill in the blank:

 Once an app is published, the ________ cannot be changed. It should be unique for each APK.
 Answers: • package name

 73. Which of the following attributes in the manifest file defines version information of an application for the Google Play Store (as opposed to defining version information for display to users)?
 Answers: • android:versionCode

 74. Which of the following are true about Intent.CALL_ACTION and Intent.DIAL_ACTION?
 Answers: • Intent.action = Intent.CALL_ACTION is used when a phone number is to be dialled without showing a UI on the device.

 75. Suppose MyView is a class derived from View and mView is a variable of type MyView. Which of the following should be used to display mView when the Android application is started?
 Answers: • Call setContentView(mView) in the onCreate() of the main application class.

 76. Which of the following programming languages can be used to develop software applications for the Android platform?
 Answers: • Java

 77. 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?
 Answers: • import android.hardware.camera;

 78. What is "Android-activityCreator"?
 Answers: • A command line tool to create Android project files.

 79. What is the maximum supported size for a single expansion file in the Google Play Store?
 Answers: • 2GB

 80. Which of the following tools can be used to reduce apk package size?
 Answers: • ProGuard

2 comments:

  1. Faild...................................

    ReplyDelete
  2. All are fake answer. don't believed on this site.

    ReplyDelete