Android Upwork Test 2017

2
1114

We don’t guarantee that all provided answers are correct.

Which superclass do must UI elements extend?
Answer

  • View
  • Widget
  • LinearLayout
  • Activity

When does ANR occur?
Answer

  • When a network thread pauses for more than a minute.
  • When there has been no response to a system event within 5 seconds.
  • When there has been no response to user input event within 5 seconds.
  • When the app is selected from within the app launcher, but not installed.

What is the purpose of a loader?
Answer

  • Loaders are special case data streams that provide a bytewise iterator when accessing file from external storage.
  • Loaders are convenience class that makes asynchronous fetching and loading of into a Fragment or Activity easier.
  • Loaders are Android Native classes that are used when graphics are drawn to screen via a canvas.
  • Loaders are UI elements that indicate to user that an asynchronous action is in progress.

What must be done after a TypedArray is no longer needed?
Answer

  • The invalidate() method must be called in order to refresh the contents of the object.
  • The recycle() method must be manually called in order to notify the system that the object is no longer using memory allocated to it.
  • The onDestroy() method must be manually called in order to notify the system that the object is no longer using memory allocated to it.
  • The keepalive() method must be manually called in order to notify the system that the object is still being used and prevent GC from clearing it.

What is master detail pattern?
Answer

  • A layout pattern consisting of a master layout(containing a collection of data) and detail(containing detailed information about an item from the collection).
  • A term is used in parallel processing where there are mlitiple detail threads controlled by a hypervising master thread manager.
  • A layout pattern consisting of a detail layout(containing a collection of data) and master(containing detailed information about an item from the collection).
  • A layout pattern consisting of a user-interactive master layout, and a passive non-touch-enabled detail layout.

Which of the following is true?
Answer

  • Fragments are top-level classes that can contain and manage Activities.
  • Activities are top-level classes that can contain and manage Fragments.
  • Fragment is the superclass for UI elements such as Button, EditText boxes and ImageViews.
  • A Fragment is a data bundle that contains information that an Activity requires in order to be drawn to the display.

What is retrofit?
Answer

  • A collection of libraries that allow older version on android to support the latest APIs and libraries released with newer version of the platform.</span?
  • A type safe client of consuming restfli APIs in android and java in general.
  • A competing operating system for apple.
  • The name given to Google’s integrated fitness and activity tracking API available in recent version of Android.

When defining a view within a xml layout, which two attribute are always required?
Note: There may be more than one right answer.
Answer

  • Width and Height
  • LayoutSum and LayoutWeight
  • Style and LayoutWeight
  • Height and Orientation

When publishing updates to an app on Google Play Store, Which of the following are true?
Answer

  • The versionCode must remain the same.
  • The keystore used to sign the APK to publish the app must be the same.
  • The package name must be the same.
  • The versionCode must be incremented or higher than the previous published version.
  • The versionCode must be decremented or lower than the previous published version.
  • The keystore used to publish the app must be different from that used for previous published version.

What are the android support libraries for?
Answer

  • They provide APIs that allow developers to provide in-app customer support features.
  • They provide APIs that allow developers to provide features aimed at users with additional accessibility requirements.
  • They allow features introduced in more recent version of android to be used on device running older OS version.
  • They allow device running the latest version of android use deprecated features from older version OS.

What does the following code do?
Calendar cal = Calendar.getInstance ();
DataFormat dateFormat = new SimpleDateFormat (“yyyy-MM-dd”);
cal. add(Calendar.Date, -1);
return dataFormat.format(cal.getTime());
Answer

  • Gets yesterday’s date and returns its formatted string.
  • Gets today’s date and returns its formatted string.
  • Gets tomorrow’s date and returns its formatted string.
  • All of the above

What is Espresso?
Answer

  • An Android hardware performance analysis library.
  • An Android UI testing library and API.
  • The name given to a specific release version of the Android OS.
  • An open source free Java implementation, upon which Android is based.

What is difference between a Broadcast Receiver and an Intent Filter?
Answer

  • A Broadcast Receiver allows an app to register to be notified upon system or application events, an Intent Filter specifies which intent an app can receive.
  • A Broadcast Receiver allows an app to receive video stream from live media sources, an Intent Filter specifies URLs are supported.
  • A Broadcast Receiver is a component of the TelephonyManager that determine the cellliar network that device can connect to, an Intent Filter remove noise from telephone call audio.
  • A Broadcast Receiver is a server side script endpoint that an app can communicate with, an Intent Filter determines which android IDs can access the endpoint.

What is the purpose of AppCompat library?
Answer

  • It allows the ActionBar UI pattern to be used on older version of Android.
  • It allows the app to share content with other apps via share intent.
  • It allow for the developer to internationalize their app.
  • It allows the SnackBar UI to be used on newer version of Android.

The best practice is to put string values in _____ file.
Answer

  • Strings.xml
  • strings.java
  • android.text
  • resources.rsc

When creating a main Android App Project with Android studio, how can we support localization of the Android App?
Answer

  • main/res/AndroidMainfest.xml
  • main/res/layout/activity_my.xml
  • main/res/values/strings.xml
  • main/res/style.xml

What is the purpose of Volley?
Answer

  • A type-safe client for consuming RESTFli APIs in Android and Java in general.
  • A convenience library that makes network calls easier and faster.
  • An android unit testing framework.
  • An analytics tool can shed light on parts of an app’s UI that are used most/least.

Which features of java build process allows for android projects with more than 65k method calls?
Answer

  • The Gradle build process
  • Mlitidexing
  • Propguard/Dexguard
  • The Android Run Time (ART)

The addCategory() method places a category in a intent object, ____ deletes a category previously added, and ____ gets the set of all categories in the object?
Answer

  • destroyCategory()
  • removeCategory() , getCategory()
  • setCategory(), destroyCategory()
  • findCategory()

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(“IOExcepion”);
} catch (UserRecoverableAuthException e){
System.out.println
(“UserRecoverableAuthException”);
} catch (GoogleAuthException e){
System.out.println(“GoogleAuthExcepion”);
}
Answer

  • prints token
  • prints IOException
  • Prints UserRecoverableAuthException
  • prints GoogleAuthException

What is Guava?
Answer

  • A hybrid web framework used for developing cross-platform apps for windows Phone, iOS and Android.
  • An open-source project consisting of common libraries for java maintained and primly developed by Google.
  • A library that makes it easy for developers to integrate RESTFli APIs using industry-standard encryption techniques.
  • An OpenGL graphics library aimed specifically at Android devices.

What is the backstack?
Answer

  • A stack data structure containing every activity in the order that they were opened. The pop action removes the most recently opened activity.
  • A queue data structure containing every activity in the order that they were programmatically instantiated. The pop action removes the earliest opened activity from the data structure.
  • Any array containing the inheritance architecture of every view in the current fragment.
  • A stack data structure.

If you are going to check a network connection with the below source code, what wolid be required to make it work?
public boolean isOnline () {
ConnectivityManager CM = (ConnectivityManager)
getSystemService (Context.CONNECTIVITY_SERVICE);
NewtworkInfo netInfo = cm.getActiveNetworkInfo ();
If (netInfo! = nlil && netInfo.isConnectedOrConnecting () return true;
return false
}
Answer

  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.ACCESS_NETWORK
    _CONNECTION
  • android.permission.INTERNET
  • android.permission.ACCESS_WIFI_STATE

2 COMMENTS

  1. Hello and thanks for the good work. Something is wrong here: only 3.1 of 5? I think some answers may be worong. Let’s check it together

LEAVE A REPLY

Please enter your comment!
Please enter your name here