Choose a topic to test your knowledge and improve your Android skills
In which situation is it acceptable to make network calls on the UI thread?
Which of the following will cause a Force Close event?
Which superclass do most UI elements extend?
What is a WakeLock?
What is the difference between a Broadcast Receiver and an Intent Filter?
Which of the following statements are true with regard to an AsyncTask class.
With regard to Android Wear, what is Ambient Mode?
Which feature of the Java build process allows for Android projects with more than 65k method calls?
What is the purpose of Volley?
If required during the build process, where should sensitive information such as API Keys, keystore passwords and VCS login details be kept when using Android Studio?
Which of the following FragmentTransaction methods allow the transaction to occur after the parent Activity’s state has been saved?
What are the two types of Intent in Android?
What is Lint?
In the context of Android development tools, what does DDMS stand for?
In the context of Android development tools, what does DDMS stand for?
What is Guava?
Which of the following is a tool used for profiling the performance of Android apps?
Which of the following is the correct way to request permission to allow an app feature to access the internet?
How could using Guava in an Android application cause problems at build time in particular?
Within the context of Android resource definitions, what do 'sw600' and 'w800' mean?
Which of the following is true when an Android device is rotated?
What is the primary purpose of an Intent?
What is an Intent Filter?
What is the purpose of a Loader?
Which of the following enables you to use Java 8 features when building apps for Android?
What is Robotium?
Which exception is thrown when an image exceeds the maximum allocated size in memory?
What is the purpose of the Systrace tool?
With regard to graphics, what is the “dirty rect”?
What is Google Cloud Messaging?
What is Espresso?
Which of these table element does not exists?
What is Robolectric?
A service has lifecycle callback methods that you can implement to __ changes in the service's state and you can perform work at the appropriate stage?
By default, ArrayAdapter creates a view for each array item by calling toString() on each item and placing the contents in?
Following Android Classes will uses Design Patterns?
The addCategory() method places a category in an Intent object, ____ deletes a category previously added, and ____ gets the set of all categories currently in the object?
Which of the following are key components under the Android application Architecture?
What does the following code? public void launchScreen(Activity activity) { Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_HOME); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); activity.startActivity(intent); }
Technically you can use Eclipse with versions 5 and newer. However, the latest version of Eclipse was only tested on the __ JRE ?
The setData() method specifies data only as a ____ , setType() specifies it only as a MIME type, and setDataAndType() specifies it as both a URI and a MIME type. The URI is read by getData() and the type by getType()?
When creating main Android App project with Android studio, how can we support localization of the Android App?
What does A() function do? private void A() { B(getActivity(), "com.app.package.here"); } public void B(Context context, String packageN) { Intent i = context.getPackageManager().getLaunchIntentForPackage(packageN); if (i == null) { i.addCategory(Intent.CATEGORY_LAUNCHER); context.startActivity(i); } else { try { context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageN))); } catch (android.content.ActivityNotFoundException anfe) { context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + packageN))); } } }
An Intent object is a bundle of information and what are the object contains?
What does the following code do? Calendar cal = Calendar.getInstance(); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); cal.add(Calendar.DATE, -1); return dateFormat.format(cal.getTime());
What is the output if following code executed? Values/google_maps_api.xml google_maps_key (key from https://console.developers.google.com/) AndroidManifest.xml <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" /> Build.gradle(Module: app) Dependencies{ … Compile ‘com.google.android.gms:play-services:8.4.0’ }
What is the output if following code executed? public int pxToDp(int px) { DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics(); int dp = Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); return dp; } public int dpToPx(int dp) { DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics(); int px = Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); return px; }
After building an Android project with Android Studio, what is the purpose of generating R.java as follows? package com.intelstar.venus; public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040000; } }
If you are going to check a network connection with the below source code, what would be required to make it work? public boolean isOnline() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); if (netInfo != null && netInfo.isConnectedOrConnecting()) return true; return false; }
What is the output if following code executed? final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0); for (Object object : pkgAppsList) { ResolveInfo info = (ResolveInfo) object; File file = new File(info.activityInfo.applicationInfo.publicSourceDir); // … }
Which of the following common design patterns are used in Android?
Following methods called during the life cycle of an android activity are?
Which of the following are possible states of a process?
Android Architecture is consisted of the following components?
Android Framework (Application Framework is ok)
How to show option menu using the following source on Samsung phone but cannot see it. How to fix it? try { ViewConfigurationconfig = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class .getDeclaredField("sHasPermanentMenuKey"); if (menuKeyField != null) { menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception e) { e.printStackTrace(); }
What does mean by the following XML code? AndroidManifest.xml <application android:label=»@string/app_name» android:icon=»@drawable/icon» android:name=»com.intel.starApp»> … …. <meta-data android:name=»DATABASE» android:value=» example.db»> <meta-data android:name=»VERSION» android:value=»2″> <meta-data android:name=»QUERY_LOG» android:value=»true»> … </meta-data></meta-data></meta-data>
What does the following code output? public class XYZ extends AsyncTask { @Override protected String doInBackground(String... params) { PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); final WakeLockwl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK |PowerManager.ACQUIRE_CAUSES_WAKEUP |PowerManager.ON_AFTER_RELEASE, ""); wl.acquire(); return "Executed"; } @Override protected void onPostExecute(String result) {} }
Which of the following data types does AIDL support?
The 'showAsAction' attribute of in a menu resource file can have which of the following values? Check all that apply.
Which file contains information about the app?
Which statement correctly assigns the id to textView element in layout file?
AndroidMainfest.xml file contains the following essential information about your app: (choose all that apply)
The strings.xml has a _________ element, which contains one or more elements.
A layout can retrieve the value of the String named 'stringmessage' using `____`.
The best practice is to put string values in _________ file.
Buttons and text views both inherit from the same Android class named _____.
If the intent has extra integer information passed to it with a name of "message", we can retrieve that information using which of the following?
Which of the following correctly adds a string array resource to strings.xml?
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?
Which of the following can you use to display a progress bar in an Android application?
One can declare a logical parent ".MainActivity" to < activity > by adding the following line in the respective < activity > in AndroidManifest.xml.
Which of the following lifecycle methods are common to both Activity and Fragment?