Android collection 1

Ace your homework & exams now with Quizwiz!

What is retrofit?

This offers very easy to use REST API's. We can use it with any serialization library, with error handling.

Which of the following is a disadvantage of using a fragment to use the Preferences API to display preferences?

This technique only works with Android 3.0 (API 11) and later

In Java, creating an exception object and handing it to the runtime system is called ____________ an exception.

Throwing

To specify that a method may throw exception(s), add a _________ clause to the method declaration.

Throws

If TicTacToe is the class for the Model and we are inside the Activity class (the Controller), we can use an instance variable of type __________________ to represent the Model.

TicTacToe

When you ________________ the execution of an app, you add statements to your code that display messages at key points in the code. This can help you find the cause of a bug.

Trace

# Does CSS support to detecting device size and orientation?

True

# Does HTML5 native support for local storage?

True

# Intents filter are used to register activity, services, broadcast receiver as being capable of performing an action on a particular kind of action.

True

# On android, a layout can contain other layout?

True

(T/F) A class can directly implement multiple interfaces.

True

(T/F) A generic class is defined with a list of type parameters (inside of angle brackets) specified after the name of a class.

True

(T/F) A source file can only contain one public type.

True

(T/F) A static nested class needs an object reference to refer directly to instance variables or methods defined in its enclosing class.

True

(T/F) Abstract classes cannot be instantiated, but they may be subclassed.

True

(T/F) All primitive types have wrapper classes to "wrap" the primitive in an object.

True

(T/F) An inner class (non-static nested class) and a local class cannot define any static members.

True

(T/F) An interface name can be used anywhere a type can be used.

True

(T/F) An object without any references is recycled (aka garbage-collected) automatically.

True

(T/F) Appending characters to a StringBuilder adds the characters at the end of the sequence.

True

(T/F) Each component of a package name corresponds to a subdirectory on your file system.

True

(T/F) If an Integer object is expected as a parameter, and you pass a primitive int, the compiler will "box" the primitive in its wrapper class for you.

True

(T/F) If none of the methods on the call stack handle the thrown exception, the program terminates.

True

(T/F) If you try to return a value from a method that is declared void, the compiler will complain.

True

(T/F) Invocation of a superclass constructor must be the first line in the subclass constructor.

True

(T/F) It is good practice to be as specific as possible when specifying exceptions caught in your exception handlers.

True

(T/F) Overridden instance methods, regardless of which class invoked the method, will resolve to the subclass implementation.

True

(T/F) String implements the CharSequence interface

True

(T/F) Stringbuilder objects are mutable.

True

(T/F) Super class constructors are called all the way back to the constructor of Object.

True

(T/F) Superclass, base class, and parent class are synonyms.

True

(T/F) Suppose an interface called Scalable is defined. You can declare a reference of type Scalable.

True

(T/F) The name of a constructor matches the name of the class.

True

(T/F) To override a method in a subclass, both the method signature and the return type must match.

True

(T/F) Using the static keyword, you can import static final fields and static methods.

True

(T/F) You cannot declare constructors in an anonymous class.

True

114. Android AsyncTask create new thread in background

True

47. On android, a layout can contain other layout?

True

54. Does CSS support to detecting device size and orientation?

True

65. Does HTML5 native support for local storage?

True

A String value can be used as the control expression to switch based upon.

True

Annotations have no direct effect on the operation of code they annotate.

True

By convention, in a class declaration, the implements keyword follows the extends keyword, if the class is a subclass.

True

Choose whether the statement is true or false Does PhoneGap support iOS, Android, Windows Phone, BlackBerry, webOS, Bada, Symbian at the same time?

True

Does AsyncTask create new thread in background?

True

On android, a layout can contain other layout ?

True

Read the following 2 URLs and answer the question

True

The ViewGroup.LayoutParameters class contains a setMargins method that allows us to set all four margins.

True

To install and run Sencha Touch, we need:

True

# How to set position of a Sencha Touch component?

Use centered property ...Use top, left properties

# Which of the following are true about Intent.CALL_ACTION?

Used to dial a phone .... Used when a phone number .....

Toast is a class to display a message in Android. How to set position of a Toast

Using setGravity()

In Android, how do you access the string resource stored in the strings

Using the getResources() method

By convention, The first word in a method name should be what article of speech?

Verb

How to register a broadcast reciever?

Via AndroidManifest.xml file

AS: find video view called videoView > set the video path to demo/video > start the video

VideoView videoView = (VideoView) findViewById(R.id.videoView); videoView.setVideoPath("android.resource://" + getPackageName() + "/" + R.raw.demo/video); videoView.start();

What is a ViewGroup and how is just a View different?

ViewGroup is a invisible container of other views (child views like TextView, Button, etc) and other viewgroups. Eg: LinearLayout is a viewgroup which can contain other views in it. ViewGroup is a special kind of view which is extended from View as its base class.

One of the things we must do to handle touch events is register an object of a class that implements View.OnTouchListener on one or more __________________.

Views

Why is CardView useful for RecyclerView?

When you want to display a collection of items which might have different lengths/heights depending on their content (like pictures with descriptions and comments) or a high number of supplemental actions.

Types of features provided by the JQuery UI (jQuery UI features)

Widgets - accordions, tabs, date pickers, and more. Themes - 25 predefined themes as well as ThemeRoller application that lets you create a custom theme. A theme is implemented by a CSS style sheet. Interactions - Draggable, droppable, resizable, and more. Effects - color animation, class transitions, and more.

# Does Android 2.3 supports push e-mail for Exchange mail and Gmail?

Yes

# Does CSS support to detecting device size and orientation?

Yes

# Does HTML5 native support for local storage?

Yes

# Is color a new HTML5 element of input type?

Yes

# Is it possible to use HTML5 for the mobile application?

Yes

84. Does CSS support to detecting device size and orientation?

Yes

How can applications running survive a rotation change?

You CAN use the onSaveInstanceState()/onCreate () pair of methods, for tiny bits of data, but implementing a ViewModel which will preserve config changes and UI data is a much better option.

What can you use grid layout for in AS?

You can define views inside the layout to keep elements together

How do you access the string resource stored in the strings.xml fil

You can use the getResources()

# How do you access the string resource stored in the strings.xml file?

You can use the getResources() method

35. How do you access the string resource stored in the strings.xml file?

You can use the getResources() method

# How do you programmatically determine whether a RadioButton is checked?

You should check the isChecked() method

42. How do you programmatically determine whether a RadioButton is checked?

You should check the isChecked() method

How do you programmatically determine whether a RadioButton is checked?

You should check the isChecked() method

A project

a directory that contains all of the files for an app

jQuery UI

a free, open source, JavaScript library that extends the use of the jQuery library by providing higher-level features that you can use with a minimum of code. "The official plugin library for jQuery"

JQuery selectors

$("css selector here")

jQuery widget code

$(document).ready(function( ) { $("selector").widgetMethod( { // option settings }); });

Why you need Javascript for data validation

- The HTML5 input controls and attributes for data validation aren't implemented by all current browsers - HTML5 is limited in the types of data validation it can do

20. Where can you define the icon for your Activity?

. In the manifest xml file

Given this image: res/drawable-mdpi/jack_of_spades.png What ImageView attribute specifies the location of the image?

. android:src="@drawable/jack_of_spades"

36. Which of the following methods is used to return a View from a layout file given the ID of the View?

. findViewById(int id)

The extension for a Java bytecode file is

.class

What is the extension of the bytecode files output by the Java compiler? (include the dot)

.class

The extension for a Java source file is ________________.

.java

Java: get length

.length();

AS: media player start > stop > pause

.start(); .stop(); .pause();

What is special about a javadoc comment vs a standard multi line comment?

/** on the first line

Write the code to set the margins of a button to 30 pixels on the left and 50 pixels on the right.

// Assume that the Button myButton has been instantiated and has been added to the View MarginLayoutParams params = ( MarginLayoutParams ) myButton.getLayoutParams( ); // Your code goes here params.setMargins( 30, 0, 50, 0 );

AS: Display get webView > enable Javascript > set web view client > load webView URL

//Set internet permissions WebView webView = (WebView) findViewById(R.id.webview); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClient());

3 Steps of handling an event (android)

1. Import the interface that defines a listener, which is an object that listens for an event 2. Create a listener. To do that, implement the listener interface 3. Connect, or wire, the listener to a widget

What are the primitive data types?

1. int (used in java methods) 2.double (used in java methods) 3.char (used in java methods) 4.boolean 5.byte 6.short 7.long 8.float

# How many main approaches to build GUI of Android app?

2

How many kind of Android service do we have?

2

# What year was Android founded?

2003

# How many ways data stored in android?

5

Inside an item element of a menu, this line of code makes the item visible in the action bar if there is room for it.

<item ... app:showAsAction="ifRoom" />

AS: set user permissions for internet in Android Manifest

<users-permission android:name="android.permission.INTERNET"/>

# Which permission needed in order to use MapActivity?

<uses-permission android:name="android.permission.INTERNET" />

69. Which permission needed in order to use MapActivity?

<uses-permission android:name="android.permission.INTERNET" />

Which permission needed in order to use MapActivity?

<uses-permission android:name="android.permission.INTERNET" />

# What is the correct HTML5 element for playing video files?

<video>

53. What is the correct HTML5 element for playing video files?

<video>

# For defining the possible line break which tag do we have to use in HTML 5?

<wbr>

AS: Add your own code to a method that already exists

@Override

AS: Link menu to main activity

@Override public boolean onCreateoptionsMenu(Menu menu) { MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.main_menu, menu); return super.onCreateOptionsMenu(menu); }

AS: log item selected on item selection in menu

@Override public boolean onOptionsItemSelected(MenuItem item) { super.onoptionsItemSelected(item); switch (item.getItemId()) { case R.id.settings: Log.i("Menu item", "ItemName"); return true; case R.id.settings: Log.i("Menu item", "ItemName"); return true; default: return false; } }

AS: What method can we use to execute an action when the doInBackground method has completed?

@Override protected void onpostExecute(String s){ super.onPostExecute(s); }

JQuery plugin

A JQuery application that does one web task or set of related web tasks. A plugin makes use of the jQuery library, and most plugins can used with limited knowledge of JavaScript and jQuery

What is the first argument for every data access method of the ContentProvider class?

A Uri object

128. Android: Is the main thread called the UI thread?

A Yes

What is a broadcast used for in Android? What is a broadcast receiver?

A broadcast is wrapped in an Intent object with the action string of the event. Broadcasts are sent out when system events occur, like turning off/on airplane mode. A broadcast receiver is a component that enables the system to deliver events to the app outside of a regular user flow, allowing the app to respond to system-wide broadcast announcements, which is useful for things like timers and alarms. Broadcast receivers are more commonly used as a gateway to other components, like scheduling a JobService to perform some work based on the JobScheduler event.

What are methods in Java?

A chunk of code that does something

What setListAdapter() function used for?

A command that projects your data to the onscreen list on your device by connecting the listActivity

# What is Drawable?

A compiled visual resource that can be used as a background, title, or other part of the screen

# What is broadcast receiver?

A component that does thing but receive and react to broadcast announcements

What does a constructor do?

A constructor is a special method that is called whenever an object is created using the new keyword.

What is a dialog in Android?

A dialog is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed.

What is a headless fragment?

A fragment that doesn't have a view or layout to render.

JQuery

A free open-source JavaScript library intended to simplify client-side scripting

What is an Android service?

A general purpose entry point for keeping an app running in the background, like media playing, or PIP.

Content Delivery Network (CDN)

A web server that hosts open source software

If B is a public, static, inner class of A, ____________ refers to B.

A.B

In Android, which manifest permission is needed when use GPS location

ACCESS_FINE_LOCATION

Which of the following permissions is necessary for an app to use GPS?

ACCESS_FINE_LOCATION

# Where will you declare your activity so the system can access it?

Activity is to be declared in the manifest file

# Which of the following should be used to save the unsaved data and release resources being used by an Android application?

Activity.onDestroy()

9. Which of the following should be used to save the unsaved data and release resources being used by an Android application?

Activity.onDestroy()

Which of the following should be used to save the unsave

Activity.onDestroy()

Which of the following should be used to save the unsaved data and release resources being used by an Android application?

Activity.onDestroy() Correct

# Which of the following is/are appropriate for saving the state of an Android application?

Activity.onPause()

22. Which of the following is/are appropriate for saving the state of an Android application?

Activity.onPause()

Which of the following is appropriate for restoring the state of an An

Activity.onPause()

Which of the following is appropriate for saving the state of an Android application

Activity.onPause()

Which of the following is/are appropriate

Activity.onPause()

Which of the following is/are appropriate for saving the state of an Android application?

Activity.onPause() Correct

What class and interface can you use to build and display a dialog box that includes event handlers?

AlertDialog.Builder and DialogInterface.OnClickListener

# Android: When will onUpgrade() be invoked?

All of above

# What is Content Provider?

All of above

# What is a Fragment?

All of above

56. Android: When will onUpgrade() be invoked?

All of above

Android: Which statements are correct about Broadcast receivers ?

All of above

Android: when will onUpgrade() be invoked ?

All of above

# Android supports which features

All of the above

What do Android package (.apk) files contain? a. Compiled resources b. Uncompiled resources c. .dex files d. All of the above

All of the above

Which of the following is true? a. Android is a Linux-based operating system designed primarily for touchscreen mobile devices. b. Android code is open source. c. Android is designed for smartphones and tablets. d. All of the above.

All of the above

# What version of Android is codenamed "Jelly Bean"?

All of the above - 4.1, 4.2, 4.3

# What chat protocols did Android 1.0 support?

All of the above - AIM, Google Talk, Windows Live Messenger, Yahoo! Messenger

Android is based on Linux for the following reason.

All of these

What is the difference between ANR and an application crash?

An ANR will occur if you are running a process on the UI thread which takes a long time, usually around 5 seconds. During this time the GUI (Graphical User Interface) will lock up which will result in anything the user presses will not be actioned. A crash is when an exception within the app has been thrown which has not been handled.

# What is an intent object?

An Intent object is a bundle of information

1. What is an intent object?

An Intent object is a bundle of information

What is an intent object?

An Intent object is a bundle of information Correct

# What is used to let a class know about a data type you want to use?

An import statement

What is ADB?

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device.

# What is ADT?

Android Development Tools

# Which company developed android?

Android Inc

29. Which company developed android?

Android Inc

Which company developed android?

Android Inc Correct

The ________________ is an XML file that specifies the first activity to launch when the app is started.

Android Manifest

# What does AOSP stand for?

Android Open Source Project

# What does the .apk extension stand for?

Android Package

14. What does the .apk extension stand for?

Android Package

An example of an IDE (Integrated Development Environment) is a. Java b. Android Studio c. Dalvik virtual machine d. Android debug bridge

Android Studio

AVD stands for __________________.

Android Virtual Device

Which company developed android

Android inc

# Which company developed android?

Android inc.

# Which of the following is correct?

Android is an open system

# Why cannot you run standard Java bytecode on Android?

Android uses Dalvik Virtual Machine

Why cannot you run standard Java bytecode on Android?

Android uses Dalvik Virtual Machine Correct

Before other apps can use your content provider class, you must register it by adding a provider element to the ________________ file.

AndroidManifest.xml

The ________________ file uses its application element to specify the theme for the application.

AndroidManifest.xml

The ________________ specifies the first activity to launch when an app is started.

AndroidManifest.xml

15. Android is licensed under which open source licensing license?

Apache/MIT

Android is licensed under which open source licensing license?

Apache/MIT Correct

What are Android components?

App components are the essential building blocks of an Android app. Each component is an entry point through which the system or a user can enter your app. Some components depend on others. There are four different types of app components: Activities Services Broadcast receivers Content providers

# What does the .apk extension stand for?

Application Package

API

Application Programming Interface

What does the apk extension

Application program kit

How are Array and ArrayList objects different?

Array is a fixed sized list that can contain primitives and objects. ArrayList is a flexibly sized list that can only contain objects.

on(events, handler)

Attach an event handler to one or more events

AS: call AudioManager called audioManager > get Audio Manager service in context Audio Service > set int max volume to stream music > set int current volume to steam music > set max volume to max > set progress to current volume > set stream volume in onProgressChanged to progress

AudioManager audioManager; audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); int curVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); volumeControl.setMax(maxVolume); volumeControl.setProgress(curVolume); audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0);

JQuery first stable release date

Aug 2006

Converting a primitive value into an object of the corresponding wrapper class (for example, double to Double) is called:

Autoboxing

105. Which class do we use for listening location update?

B. LocationManager class

111. There are five different methods to store persistent data. They are: Shared Preferences. Internal Storage. External Storage. Network and __?

B. SQLite Database

98. On android, a layout can contain other layout?

B. True

89. Does HTML5 native support for local storage?

B. Yes

120. Which method to open a Hap connection to an Uri?

B. url.openConnection()

63. IntentFilters are typically defined via

Both of above

# IntentFilters are typically defined via

Both of above Via AndroidManifestxml file

The Android stack layers

Bottom layer - Linux Second layer - Native libraries Thirds layer - Application framework the top layer - Android apps

# What are 2 ways a Service can run?

Bounded and Unbounded

What are 2 ways a Service can run ?

Bouned and Unbouned

How should you read "Box<Integer>"?

Box of Integer

To help with debugging, you can stop code execution before a line of code. You do this by setting a ________________.

Breakpoint

# What class do you have to inherit from to be a broadcast receiver?

BroadcastReceiver

80. Android: Where we can create tables and columns to them, create views or triggers?

C. onCreate()

87. Which method to display a dialog?

C. show()

# In android intent. The activity can be embedded inside of another activity that hosts gadgets is belonged to

CATEGORY_GADGET

79. In android intent. The activity can be embedded inside of another activity that hosts gadgets is belonged to

CATEGORY_GADGET

In android intent. The activity can be embedded inside of another activity that hosts gadget is belonged to

CATEGORY_GADGET

This broadcast is typically used to check whether a change in network connectivity has occurred.

CONNECTIVITY_ACTION

A type name and ".class" refers to an object that represents the type itself. For example, Integer.class is a Class object representing Integer. What kind of literal is Integer.class?

Class literal

To access a member variable (called myVar) of an enclosing class (called ClassA) from an inner class (called ClassB), what is the correct syntax?

ClassA.this.myVar

A(n) ____________ is simply an object that groups multiple elements into a single unit.

Collection

# What is a Content Provider?

Content provider is an application component that provides a screen with which users can interact in order to do something

# The Intent object is passed to this method to deliver the message to all interested broadcast receivers

Context.sendBroadcast()

25. The Intent object is passed to this method to deliver the message to all interested broadcast receivers

Context.sendBroadcast()

The Intent object is passed to this method to deliver the message to all interested broadcast receivers

Context.sendBroadcast() Correct

24. The Intent object is passed to this method to launch a new activity or get an existing activity to do something new

Context.startActivity()

The Intent object is passed to this method to launch

Context.startActivity()

The Intent object is passed to this method to launch a new activity or get an existing activity to do something new

Context.startActivity() Correct

# The Intent object is passed to this method to initiate a service or deliver new instructions to an ongoing service

Context.startService()

11. The Intent object is passed to this method to initiate a service or deliver new instructions to an ongoing service

Context.startService()

The Intent object is passed to this method to initiate

Context.startService()

The Intent object is passed to this method to initiate a service or deliver new instructions to an ongoing service

Context.startService() Correct

AS: get data from SQLite where age is greater than 18 and name is Jon

Cursor c = usersDB.rawQuery("SELECT * FROM users WHERE age > 18 AND name = 'Jon'"), null);

115. What is not true about the Android application lifecycle

D. Each activity of an app is run in its own process

129. Android: Which statement does not correct about Activity?

D. None of above

94. Android: When a dialog is requested for the first time, which method will Android call from your Activity?

D. onCreateDialog(int)

To work with a database that's on your computer (not on a device or emulator), you can use a tool like the

DB Browser for SQLite

What is DDMS in Android?

DDMS. The Dalvik Debug Monitor Server (DDMS) is a more advanced debugging tool from the SDK that has also been integrated into Android Studio. This tool is able to monitor both a real device and the emulator. To open the DDMS perspective navigate to Tools. This would help see if you have memory leaks.

The onDown method of the GestureDetector.OnGestureListener interface is called on a(n) __________________ action when a touch occurs.

DOWN

The KeyEvent class contains constants for almost every possible hardware key on a device including the keys on a

DPad

# Android uses

Dalvik Virtual Machine

Dalvik executable files (.dex files) can be run by the ________________ .

Dalvik Virtual Machine

Where can you run Dalvik executable files?

Dalvik executable files can be run by the Dalvik virtual machine that's available from all Android devices.

What is a dangerous permission?

Dangerous permissions cover areas where the app wants data or resources that involve the user's private information, or could potentially affect the user's stored data or the operation of other apps. For example, the ability to read the user's contacts is a dangerous permission.

What is dependency injection in Android?

Dependency injection is a style of object creation in which an objects are created by an external entity, or technique whereby one object supplies the dependencies of another object. To but VERY SIMPLY, dependency injection is passing in an object into another object, and using "this.<object> = <paramOfObjectBeingPassedIn>" to collect the decencies to act on.

You can use the ________________ to publish your app and to manage its listing on Google Play.

Developer Console

slideToggle( )

Display or hide the matched elements with a sliding motion.

fadeToggle( )

Display or hide the selected elements by animating their opacity.

toggle( )

Display or hide the selected elements.

show( )

Display the selected element from the upper left to lower right

fadeIn( )

Display the selected elements by fading them to opaque.

slideDown( )

Display the selected elements with a sliding motion

AS: get text > parse to string > parse to double

Double doubleName= Double.parseDouble(stringName.getText().toString());

AS: Call download content from URL in onCreate

DownloadTask task = new DownloadTask(); String result = null; try { result = task.execute("http://url.com").get(); Log.i("Content of URl", result); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); }

A/an ________________ widget lets the user enter text.

EditText

Which class enables the user to enter text?

EditText

Which class is not a subclass of Button?

EditText

AS: find the email ID > edit text

EditText email = (EditText) findViewById(R.id.email);

An EditText widget can be referred to as a/an

Editable Text view and text box

How do you code the opening tag for a style named Label that inherits a style named TextView.

Either <style name="Label" parent="@style/TextView"> OR <style name="TextView.Label">

How to make a TextView to be editable?

Either set attribute editable = "true" or Use EditText class instead of TextView class

# How to make a TextView to be editable?

Either set its attribute editable ='true' or Use EditText class instead of TextView class

62. In HTML5, onblur and onfocus are:

Event attributes

How can two distinct Android apps interact?

External Intents Permission Integration (Google Fit and Fitness App)

101. What is NOT a new elements of input type in HTML5?

F. None of above

# Can you deploy executable JARs on Android?

False

# Do you run standard Java bytecode on Android?

False

# Is it possible to run java source code directly on Android?

False

# On android services, onStart() and onBind() are the same?

False

# The R.java file is where you edit the resources for your project

False

# The R.java file is where you edit the resources for your project.

False

(T/F) A class can directly inherit from multiple super classes?

False

(T/F) A nested class can only be declared public or package-private, similar to outer classes.

False

(T/F) All classes can be subclassed.

False

(T/F) Both checked and unchecked exceptions are subject to the catch or specify requirement.

False

(T/F) Default methods are like abstract methods, they do not have a method body.

False

(T/F) String is a primitive type

False

(T/F) Strings are mutable (they can be changed)

False

(T/F) The compiler will let you define two methods with the same name, same parameter lists, but different return types.

False

(T/F) The following code results in a compiler error: double myPrimitiveDouble = 12.34; Double myObjectDouble = myPrimitiveDouble;

False

(T/F) The throws keyword and the throw keyword are interchangeable.

False

(T/F) When implementing an interface in an anonymous class, you can pass arguments into the constructor.

False

(T/F) When overriding a superclass method in a base class, the @Override annotation is required.

False

(T/F) You can have two classes with the same name in the same package.

False

(T/F) the size of an array can grow or shrink

False

19. Is it possible to run java source code directly on Android?

False

5. The R.java file is where you edit the resources for your project

False

71. On android services, onStart() and onBind() are the same?

False

A local class can access all local variables in the enclosing class.

False

All three expressions of a for loop must be defined in the for statement: initialization, termination, increment.

False

Does Android support AWT and Swing

False

In Android, can we change the GPS setting by write my own Java code?

False

In Android, does Service create new thread in background

False

The R.java file is where you edit the resources for your project

False Correct

Prefix and postfix increment/decrement operators are at the same level of precedence in Java? (hint: look at the precedence table!)

False, postfix has higher precedence

It is considered a best practice to use the ________________ class to display tabs and tab content.

FragmentActivity

# Which of the following is layout that you can use in a window in an Android application?

FrameLayout

In Android, the process technical to convert an address into its latitude and longitude is called

Geocoding

________________ is the process of converting latitude/longitude coordinates to street addresses and back.

Geocoding

The __________________ interface notifies us of double taps or confirmed single taps.

GestureDetector.OnDoubleTapListener

next([selector]), prev([selector])

Get the next/previous sibling of each selected element or the first sibling of a specified type if the parameter is coded

attr(attributeName)

Get the value of the specified attribute from the first selected element

css(propertyName)

Get the value of the specified property for the first selected element

fadeOut( )

Hide the selected elements by fading them to transparent.

What is the difference between View.GONE and View.INVISIBLE?

INVISIBLE takes up space. GONE does not.

8. Intents do not name a target and the field for the component name is left blank

Implicit Intents

Intents do not name a target and the field for the component name is left blank

Implicit Intents Correct

tool windows

In Android Studio, the different parts of the main window are known as tool windows

Where can you define the icon for your Activity?

In the style xml file

Whats the difference between an implicit and explicit intent?

In this case you define an explicit intent targeting activityB and then use it to directly call it. Implicit Intents are used when you have an idea of what you want to do, but you do not know which component should be launched.

Which of the following provides for products within an app that have a one-time billing?

In-app billing

Given the following statement that creates a URL object, which statement can you use to open a stream to read data from that URL? URL url = new URL("http://www.murach.com/new_books.rss");

InputStream in = url.openStream();

# How to play a video in HTML5?

Insert <video> tag to HTML5 page and call .play()....Insert <video> tag to HTML5 page, and set attribute autoplay=true ....

How to play a video in HTML5 ?

Insert<video> tag to HTML5 page only, the video is played automatically

Which method would you use if you have a String that you wanted to convert to a primitive int?

Integer.parseInt()

AS: convert string to integer

Integer.parseInt();

What is a sticky intent?

Intent - is a message passing mechanism between components of Android, except for Content Provider. You can use Intent to start any component. Sticky Intent - Sticks with Android, for future broadcast listeners. For example if BATTERY_LOW event occurs then that Intent will stick with Android so that any future requests for BATTERY_LOW, will return the Intent. Pending Intent - If you want some one to perform any Intent operation at future point of time on behalf of you, then we will use Pending Intent.

What is an intent filter?

Intent filters are a very powerful feature of the Android platform. They provide the ability to launch an activity based not only on an explicit request, but also an implicit one. For example, an explicit request might tell the system to "Start the Send Email activity in the Gmail app". By contrast, an implicit request tells the system to "Start a Send Email screen in any activity that can do the job."

. In an activity, which of the following statements can you use to get the intent that started the activity and retrieve a string named title that has been stored in that intent?

Intent intent = getIntent(); String title = intent.getStringExtra("title");

. Given the following Uri object, which of the following statements creates an Intent object that you can use to place the specified phone number in the dialer without starting the call? Uri uri = Uri.parse("tel:123-456-7890");

Intent intent = new Intent(Intent.ACTION_DIAL, uri);

Given the following Uri object, which of the following statements creates an Intent object that you can use to view the specified URL in a web browser? Uri uri = Uri.parse("http://www.murach.com/");

Intent intent = new Intent(Intent.ACTION_VIEW, uri);

Inside an activity called MainActivity, when the user clicks on a button, the method goToSecondActiviy executes; that methods starts a new activity from the MyActivity class.

Intent myIntent = new Intent( MainActivity.this, MyActivity.class ); this.startActivity( myIntent );

# What are intent filters?

Intents filter are used to register activity, services, broadcast receiver as being capable of performing an action on a particular kind of actions

_____________ are like contracts that establish how software interacts, without the need to know how the software is implemented.

Interfaces

What are different ways to store data in your Android app?

Internal file storage: Store app-private files on the device file system. External file storage: Store files on the shared external file system. This is usually for shared user files, such as photos. Shared preferences: Store private primitive data in key-value pairs. Databases: Store structured data in a private database.

You can use Java and Android APIs to download a file by reading input from the ________________ and writing output to the ________________ .

Internet, file system

What is AsyncTask? Why is it used? What is a better replacement for it?

It can put processes that take more time in the background, like processing search queries. RXJava is a better idea than AsyncTasks

What does the following code do? ArrayList> data = new ArrayList>(); for (Books book : books) { HashMap map = new HashMap(); map.put("title", book.getTitle()); map.put("author", book.getAuthor()); map.put("price", book.getPrice()); data.add(map); }

It creates a variable named data that stores the data for an adapter

<fragment android:name="com.murach.newsreader.ItemsFragment" android:id="@+id/items_fragment" android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" /> Which of the following are true about this code?

It displays the fragment defined by the ItemsFragment class, It sizes the fragment so it's as tall as the parent container and This fragment has an ID of items_fragment

What is an input type in Android?

It helps with validation and changing the keyboard types when inputting different types of information.

Given a text view named helloTextView, what does this code do if the check box named helloCheckBox is checked?

It hides the text view.

Which of the following is true about a URI (Uniform Resource Identifier) for a content provider?

It includes a path to the content

What is Content Provider?

It is a means to share data between applications which are by default run in completely different space by Dalvik instances.

We used the GridLayout.Spec class in the chapter. What can we say about Spec?

It is a private, static, inner class of GridLayout.

# Which statement is NOT correct about PhoneGap?

It is close source framework to build mobile application

# Which statement is correct about web storage?

It is key/value data

# What is TRUE about localStorage?

It is never expired

In auto-generated code of an Android app, what is R class

It is the main controller of the app

What is the android:versionCode attribute in the AndroidManifest.xml file?

It is used to programmatically check if an application can be upgraded.

What happen if the latitude is less than -90 or greater than 90?

It returns an IllegalArgumentException

Assume the prefs object is a SharedPreferences object. What does the following statement do? deleteOldMessages = prefs.getBoolean("delete_old_messages", true);

It returns the default value for the preference with a key of "delete_old_messages".

What does the following statement do? startActivity(new Intent(getApplicationContext(), SettingsActivity.class));

It starts the activity that's defined by the class named SettingsActivity.

Which is true about a fragment?

It's a class that you can use to define part of the user interface, It can be reused in multiple activities, and It can also be referred to as a pane

The XML element for an item in a menu is __________________.

Item

What is the name of Android class do we need to use to build up an JSON object?

JSONObject

AS: Convert a string into a JSON object

JSONObject jsonObject = new JSONObject(string);

Assume that we have an Android object named stored in reader variable, and inside it has a child object named

JSONObject mainObj = reader.getJSONObject(&amp;quot;main&amp;quot;);

What needs to be installed on a machine in order to execute Java class files (essentially, what enables Java to be so cross-platform)?

JVM

# Android is based on which language.

Java

# Android is based on which language?

Java

The programming language for Android app development is:

Java

Which directory would you expand with the Project window to display Java code in an editor?

Java

You can use ________________ code to dynamically show or hide widgets.

Java

You can use ________________ code to register and unregister a broadcast receiver.

Java

println

Java code stands for Print Line

Map

Java code that maps a property to an object (or hashes one)

Toast

Java code that prints message to screen.

When the IDE builds a project, it compiles the ________________ into ________________ and then into________________.

Java source code (.java files), Java bytecodes (.class files), Dalvik executable files (.dex files)

Android is based on which language?

Java |

# PhoneGap applications are primarily written in which language?

JavaScript

# Which of the following is best choice for simple animations for your website?

JavaScript

PhoneGap uses HTML5, CSS, and __________ to write and deploy application.

JavaScript

Which of the following is best choice for simple animation for your website ?

JavaScript

How much height is allocated to the widget?

Just enough height to display the widget

How many activities are in focus at any time?

Just one

When a user presses a hardware button on a device, a/an ________________ event occurs.

Key

# Before Google and Nestle teamed up to call Android 4.4 "KitKat," what was it referred to as internally?

Key Lime Pie

AS: get users latitude and longitude as a new location

LatLng userLocation = new LatLng(location.getLatitude(), location.getLongitude());

What are "launch modes"? What type of launch modes are supported?

Launch modes allow you to define how a new instance of an activity is associated with the current task. You can define different launch modes in two ways: 1. Using the manifest file 2. Using intent flags When starting an activity, you can modify the default association of an activity to its task by including flags in the intent that you deliver to startActivity()

Once you install an app on a device or emulator, you can use its ________________ to restart it

Launcher Icon

A/An ________________ is a container that contains one or more child elements such as widgets and determines how they are displayed.

Layout

In Android development, a/an ________________ stores XML that defines the user interface.

Layout

which of the following file(s) is

Layout file

Android is a/an _______________-based operating system.

Linux

Android is a/an ________________-based operating system.

Linux

# What are the key components of Android Architecture?

Linux Kernel, Libraries, Android Framework, Android Applications

Java: create a list called family > make list contain strings > add 2 family members

List <string> family = new ArrayList<String>(); family.add("Tony"); family.add("CJ");

Java: create List named listName > add new array constructor to list > add numbers to list > remove number to list > log an index > log entire array as string

List listName = new ArrayList(); listName.add(1); listName.add(2); listName.add(3); System.out.println(listName.get(2)); listName.remove(2); System.out.println(listName.toString());

AS: Create new list for users address

List<Address> listAddresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); //1 means were getting 1 address

What is LiveData?

LiveData is an observable data holder class. Unlike a regular observable, LiveData is lifecycle-aware, meaning it respects the lifecycle of other app components, such as activities, fragments, or services. This awareness ensures LiveData only updates app component observers that are in an active lifecycle state. OnClickListener is a LiveData object; The Room persistence library supports observable queries, which return LiveData objects.

What is NOT correct about Store in Sencha Touch ?

Load data via a proxy

_______ classes are classes that are typically defined in the body of a method.

Local

AS: Get users last known location

Location lastKnownLocation = LocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); LatLng location = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());

What kind of object can you use to listen for location updates from Google Play services?

LocationListener

Which class do we use for listening location update ?

LocationListener class

AS: Create location listener

LocationListener locationListener = new LocationListener() {creates onLocation changed, statusChanged, onProviderEnabled, onProviderDisabled methods}

What kind of object can you use to check if GPS is enabled?

LocationManager

# Which class do we use for listening location update?

LocationManager class

AS: Create location manager

LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);

In Android, which is two location providers that you can use to obtain your position data?

LocationManager.GPS_PROVIDER and LocationManager.NETWORK_PROVIDER

What kind of object can you use to configure a request for location updates from Google Play services?

LocationRequest

To test a service, it's common to use the ___________ class to print messages.

Log

Given a variable named userID, which of the following statements prints a debug message to the LogCat view that displays the value of the userID variable?

Log.d(TAG, "userID: " + userID);

AS: get email ID text > parse to string > log email text

Log.i("Info", email.getText().toString());

A simple way to trace the execution of an app is to insert ________________ statements at key points in the code.

LogCat logging

for each loop

Loop iterates through an array and peforms an action on each index

for loop

Loop iterates through an array for a specific set of conditions

while loop

Loop iterates through an array while a condition is true

By convention, package names have what case?

Lower Case

A/an _______________ type is an Internet standard for defining types of content.

MIME

# What is the "brand" of the clock widget in Android 1.0?

Malmo

# Which file is used by the browser to fetch the appropriate data?

Manifest file

124. How many CSS files can be included in a Sencha Touch project?

Many

Java: store a new map in favorites > put favColor blue > put a favNum 7 > log favColor > remove favNum > log map size

Map favorites = new HashMap(); favorites.put("color", "blue"); favorites.put("num", 7); System.out.println(favorites.get("color")); favorites.remove("num"); System.out.println(favorites.size());

# Which activity class do you need to inherit to show Google map?

MapActivity class

Which activity class do you need to inherit to show Google Map ?

MapViewActivity class

# Which of the following native APIs is NOT currently supplied as a core PhoneGap API?

Maps

The ________________ key is necessary to access the Google Maps servers.

Maps API

AS: create new media controller named mediaController for video controls > Set mediaController as the anchor for the video view > set mediaController as the Media Controller for video view

MediaController mediaController = new MediaController(this); mediaController.setAnchorView(videoView); videoView.setMediaController(mediaController);

How would you fix memory leak in Android?

Memory leak is when garbage is not getting collected and starts to pile up. Anonymous classes are big culprits Detect using Leak Canary See where Observable Patterns can be used to help cut down on leaking

The XML element for a menu is __________________.

Menu

static

Method relates to whole class and not just instances

.split("");

Method splits string into an array

The name of the directory where we should place the icon file for the app is:

Mipmap

# What is Android?

Mobile Operating System

# What is android?

Mobile Operating System

What is MVP?

Model View Presenter

What is MVVM architecture?

Model View ViewModel *unlike MVP, ViewModel is not required to reference a View.

3 common use cases for intents

Moving to another app Moving to another activity inside the app Passing data from one app to another

# Which one is not a nickname of a version of Android?

Muffin

4. Which one is not a nickname of a version of Android?

Muffin

Which on is not a nickname of

Muffin

Which one is not a nickname of a version of Android?

Muffin Correct

# Which of the following is HTML5 based sketching app that works in all modern browsers

Muro

# For writing Android code using C/C++, you need to use__________

NDK

Are local variables assigned a default value if they are not explicitly initialized?

No

Do fields have to be initialized when they are declared?

No

Do we need to declare all of Controller in app.js with Sencha Touch ?

No

The constant of the Configuration class whose value is an integer that represents a horizontal orientation is __________________.

ORIENTATION_LANDSCAPE

What is ORM? How does it work?

ORM converts data between type systems that are unable to coexist within relational databases and OOP languages." It allows them to avoid the struggle of developing queries by concatenating strings or handling the connections with database manually.

# Android is based on which language?

Objective C

31. Android is based on which language?

Objective C

What is OkHTTP?

OkHttp is an open source library that is used to send http request and get response.

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

OnClickListene

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

OnClickListener

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

OnClickListener

What is contained within the Layout xml file?

Orientations and layouts that specify what the display looks like Correct

AS: Add new parse object called score > add new score of 86 > save in background

ParseObject score = new ParseObject("Score"); score.put("score", 86); score.saveInBackground(new SaveCallback() { @Override public void done(ParseException e) { if (e == null) { Log.i("SaveInBackground", "Success"); } else { Log.i("SaveInBackground", "failed" + e.toString()); } } });

AS: Get data from Parse server

ParseQuery<ParseObject> query = ParseQuery.getQuery("Score"); query.getInBackground("ObjectID", new GetCallback<ParseObject>() { @Override public void done(ParseObject object, ParseException e) { if (e == null && object != null) { Log.i("Value", object.getString("username")); } }});

What is the viewholder pattern?

Part of RecyclerView, Adapter, ViewHolder components for making a list.

Android provides ________________ that allow you to build an interface that's consistent with the user experience in other Android apps.

Preference APIs

preventDefault( )

Prevent default behavior. Example usage for data validation in a submit button. If data is wrong then you can use preventDefault when coding the submit function for the submit button and therefore prevent it from sending the data forward to the server

Java Type Categories

Primitive Types & Reference Types. It is possible for the user to create further reference types but there is a limited number of pre-defined Java primitive types.

Unless you have a good reason not to, use______ access modifiers for your members.

Private

Omitting an actual type argument when creating a parameterized type creates a _______ type.

Raw

What is 'this' in Android?

References one step up from the current scope.

In Android, which layout mode defines the positions of each component relative to each other

RelativeLayout

What type of object does Android use to display a layout in the process for the Home screen?

RemoteViews

removeClass([className])

Remove one or more classes. If you use more than one class as the parameter, separate them with spaces

# What are fragments in Android Activity?

Represents a behavior or a portion of user interface in an activity

In Android Studio, to view and work with a layout, you would expand the ________________ directory and double-click on the layout file to open it.

Res

In what class is the getConfiguration method?

Resources

The getResources method from the Context class returns a __________________ reference.

Resources

# What is NOT correct about Controller in Sencha Touch?

Responsible for responding to events that occur within your app

55. What is NOT correct about Controller in Sencha Touch?

Responsible for responding to events that occur within your app

What is NOT correct about Controller in Sencha Touch?

Responsible for responding to events that occur within your app\

# Activity results handled by the onActivityResult() method are differentiated from one another using which parameter?

Result Code

33. Activity results handled by the onActivityResult() method are differentiated from one another using which

Result Code

Activity results handled by the onActivityResult() method are differentiated from one another using which parameter?

Result Code

# Activity results handled by the onActivityResult() method are differentiated from one another using which parameter?

Result code

# <output> element presents ___________

Result of a calculation

A/an ________________ feed can be used to publish frequently updated works, such as blog entries and news headlines.

Rich Site Summary

# There are five different methods to store persistent data. They are: Shared Preferences. Internal Storage. External Storage. Network and __?

SQLite Database

There are five different methods to store persistent data. They are: Sharred Preferrences, Internal Storage, External Storage, Network and ... ?

SQLite Database

Inside a class that extends SQLiteOpenHelper , write the code for the delete method below. We want to delete the records in the emails table of question 17 with a last value equal to the value of the parameter of the method.

SQLiteDatabase db = this.getWritableDatabase( ); String sqlDelete = "delete from emails"; sqlDelete += " where last = '" + last + "'"; db.execSQL( sqlDelete ); db.close( );

Inside a class that extends SQLiteOpenHelper , write the code for the update method below. We want to update the records in the emails table of question 17 whose email value is email. We want to change the first and last names of that record to first and last.

SQLiteDatabase db = this.getWritableDatabase(); String sqlUpdate = "update emails "; sqlUpdate += " set first = '" + first + "', last = '"; sqlUpdate += last + "' where email = '" + email + "'"; db.execSQL( sqlUpdate ); db.close( );

AS: Create a new Users SQLite database

SQLiteDatabase myDatabase = this.openorCreateDatabase("Users", MODE_PRIVATE, null); AS: Create a users table myDatabase.execSQL("CREATE TABLE IF NOT EXISTS users(name VARCHAR, age INT(3))"); AS: Insert data into Users table myDatabase.execSQL("INSERT INTO users (name, age) VALUES ('Rob', 34)"); AS: Get name data from users database Cursor c = myDatabase.rawQuery("SELECT * FROM users", null); int nameIndex = c.getColumnIndex("name"); c.moveToFirst(); while (c != null) { Log.i('name", c.getString(nameIndex)); c.moveToNext(); }

What is the name of the class that we extend in order to manage database operations?

SQLiteOpenHelper

Which database is natively supported by android?

SQlite

# What constant value is returned from onStartCommand() method or services that indicates the services being explicit started and stopped as needed?

START_STICKY

find(selector)

Search the selected element and return descendant elements

:only-child

Selects all elements that are the only child of their parent.

What is the difference between Service and IntentService?

Service class uses the application's main thread, while IntentService creates a worker thread and uses that thread to run the service. IntentService creates a queue that passes one intent at a time to onHandleIntent(). ... IntentService implements onStartCommand() that sends Intent to queue and to onHandleIntent().

# What is service?

Service is another building block of android application it does not provide a UI | It is a program that can run in the background for an indefinite period

When you work directly with the XML for a layout, you can

Set properties of a widget, code comments, add widgets to a layout.

attr(attributeName, value)

Set the value of the specified attribute for each selected element

css(propertyName, value)

Set the value of the specified property for each selected element

html(htmlString)

Sets the HTML content of each selected element to the specified HTML string

How can I persist data in an Android device?

SharePrefs Broadcasts Observables

To permanently save values in your app, you can use the ________________ class.

SharedPreferences

What is SharedPreferences used for?

SharedPreferences is an API from Android SDK to store and retrieve application preferences. SharedPreferences are simply sets of data values that stored persistently. An example would be dark mode.

AS: create a new shared preferences instance > put username string: jon in it > get that string

SharedPreferenes sharedPreferences = this.getSharedPreferences("com.joncorrin.appName", Context.MODE_PRIVATE); sharedPreferences.edit().putString("username", "Jon").apply(); String username = sharedPreferences.getString("username", "defaultValue");

show([duration])

Show the selected elements. The duration parameter is the same as for the hide( ) method

For security reasons, all Android apps must be digitally ________________ with a certificate.

Signed

To display data in a ListView widget, you can use the ________________ class.

SimpleAdapter

Whats the difference between an Observable, Single, and Completable in RXJava?

Single represent Observable that emit single value or error. Completable represent Observable that emits no value, but only terminal events, either onError or onCompleted

6. Which of the following are UI elements that you can not use in a window in an Android application?

SliderBar

Which of the following are UI elements that you can not use in a window in an Android application?

SliderBar Correct

Read the following content and answer the question

SmsManager&lt

When using Android Studio to create a signed APK file for the release build of an app, what must you do?

Specify the location of the key store file and provide a password for that file, Provide the alias and password for the release key, and Specify the location and filename of the APK file for the app

The class for a custom adapter that extends the BaseAdapter class can supply the data for the

Spinner widgets and ListView widgets

The Android system architecture is also known as the Android ________________.

Stack

In the Frames window, a list of methods in the reverse order in which they were called is known as the

Stack Trace

Statement A: dp is the default units for fonts. Statement B: sp is the default measurement unit for views

Statement A is False, and Statement B is False

There are two statements

Statement A is False, and Statement B is False

Statement A: android.telephony.SmsManager class can send SMS on both GSM and CDMA network

Statement A is True, and Statement B is False

To develop your own service in Android, which of the following step you need to do?

Step 2 is: implements onStartCommand, onBind, onUnbind, onRebind, onCreate, onDestroy methods

Once you stop the execution of an app for debugging, you can use the Step Into button to ________________ the statements in the app, one statement at a time.

Step Through

stop([clearQueue][,jumpToEnd])

Stop the current animation for the selected element. The two parameters are Boolean with false default values. If set to true, the first parameter clear the queue so no additional animations are run. The second parameter causes the current animation to be completed immediately)

Java: create a Pattern with regex > use matcher to match Pattern to string > use while loop to print while matcher finds pattern

String river = "Mississippi"; Pattern p = Pattern.compile("Mi(.*?)pi"); Matcher m = p.matcher(river); while (m.find()) { System.out.println(m.group(1)); }

Java: Create a string with three names > split strings into array on spaces

String string = "Jon Tony CJ"; String[] splitString = string.split(" ");

Given an EditText widget named usernameEditText, which of the following statements gets the string that's stored in that widget?

String username = usernameEditText.getText().toString();

A/an ________________ is a collection of properties that specify formatting for a widget.

Style

A/an ________________ is a collection of styles that can be applied througout an application.

Style sheet

SRI

Subresource Integrity

# If the user leaves a task for long time

System will clear task of activities except root activity

Java: Log "Hello World"

System.out.println("Hello World");

Within the class for a fragment, you can use the ________________ class to get the tag for the current tab.

TabHost

The ________________ class provides a way to use a fragment to display the content for each tab.

TabManager

Within the class for an activity, you can use a/an ________________ object to add one or more tabs.

TabManager

What XML element represents a row in a TableLayout?

TableRow

When you ________________ an app, you run it to make sure that it works properly no matter what combinations of valid or invalid data you enter.

Test

# Which of the following are UI elements that you can use in a window in an Android application?

TextView

28. Which of the following are UI elements that you can use in a window in an Android application?

TextView

49. Which of the following are UI elements that you can use in a window in an Android application?

TextView

Which of the following are UI elements that you can use in a window in an Android application?

TextView

Which of the following are UI elements that you can use in a window in an Android application?

TextView Correc

Which of the following statements gets a reference to the widget?

TextView billAmountLabel = (TextView) findViewById(R.id.billAmountLabel);

The __________________ interface provides three methods that are called when the text changes inside a TextView.

TextWatcher

What class can you use to detect if there is change within the text of a TextView?

TextWatcher

What is NotificationManager class?

The NotificationManager class is used to display notifications on the device's status bar

What is the observer pattern?

The Observer Pattern is a software design pattern that establishes a one-to-many dependency between objects. Anytime the state of one of the objects (the "subject" or "observable") changes, all of the other objects ("observers") that depend on it are notified

What is the difference between serializable and parcelable? What is the best approach in Android?

The Serializable interface is simple to implement, however it's slow and creates lots of temporary objects for garbage collection. The Parcelable interface is unique in that it uses no reflection. The best approach is best for the app requirements. Maybe Serializable, maybe parcelable, maybe a custom serialization using writeObject() and readObject()

advantages and disadvantages of separating the display text in a separate XML file (android)

The advantage of this approach is that it's easier to create international apps that work in multiple languages. The disadvantage is that it takes a little extra work to set the display text Tor the user interface

Why use ContraintLayout?

The aim of the ConstraintLayout is to help reduce the number of nested views, which will improve the performance of our layout files.

# What is the android:versionCode attribute in the AndroidManifest.xml file?

The android:versionCode attribute is used to programmatically check if an application can be upgrade

What is the android:versionCode attribute in the AndroidManifest.xml file?

The android:versionCode attribute is used to programmatically check if an application can be upgrade

Given the following statements using openFileOutput function to store data into a file in Android:

The created file can be accessed by all the other applications at the same time.

@Override public void onCheckedChanged(CompoundButton widget, boolean isChecked) { deleteOldMessages = isChecked; } Assuming this method is wired to a CheckBox widget, what happens when the user checks that box?

The deleteOldMessages variable is set to true

What is the AndroidManifest.xml file used for?

The manifest does a number of things in addition to declaring the app's components, such as the following: Identifies any user permissions the app requires, such as Internet access or read-access to the user's contacts. Declares the minimum API Level required by the app, based on which APIs the app uses. Declares hardware and software features used or required by the app, such as a camera, bluetooth services, or a multitouch screen. Declares API libraries the app needs to be linked against (other than the Android framework APIs), such as the Google Maps library.

What are two key principles to follow in Android?

The most important principle to follow is "separation of concerns". It's a common mistake to write all your code in an Activity or a Fragment. These UI-based classes should only contain logic that handles UI and operating system interactions. By keeping these classes as lean as possible, you can avoid many lifecycle-related problems. Another important principle is that you should drive your UI from a model, preferably a persistent model. Models are components that are responsible for handling the data for an app. They're independent from the View objects and app components in your app, so they're unaffected by the app's lifecycle and the associated concerns.

How does Dagger work?

The name "Dagger" is inspired in part by the nature of dependencies in software development. The web of dependencies that occur between objects such as Parent, Child, OtherClass, etc., create a structure called a Directed Acyclic Graph. Dagger 2 is used to simplify the creation of such graphs in your Java and Android projects.

What is contained within the manifest xml file?

The permissions the application requires

# What is contained within the manifest xml file?

The permissions the application requires Correct

39. What is contained within the manifest xml file?

The permissions the application requires Correct

Subresource Integrity (SRI) checking

This helps ensure that resources hosted on the CDN haven't been tampered with

Application Framework layer

This layer is written mostly in Java, and it provides libraries that can be used by the top layer of the stack

With Android 4.0 (API 14) and later, an activity can include a/an ________________ that displays the activity's title and, optionally, buttons that perform actions.

action bar

By default, if you specify an icon for an item, Android uses that icon in the ________________, but it uses text for that item in the ________________

action bar, options menu

If a device doesn't have a physical Menu button, a/an ________________ is displayed on the right side of the action bar to display the options menu.

action overflow icon

The intents can communicate messages among any of the three core components of an application:

activities, services, broadcast receivers Correct

Within the class for a fragment, you can use a custom _________________ to display appropriate data for the current tab.

adapter

To add the Google Play services library to your project, you can

add a dependency for it

addClass(className)

add one or more classes to the selected elements and, if necessary, create the class. If you use more than one class as the parameter, separate them with spaces

In order to register a TextWatcher on a GUI component, we call the ____________ method.

addTextChangedListener

How to set position of a Sencha Touch component?

all of above

What does the apk file include

all of the files necessary to run your app on a device or emulator including the .dex files, compiled resources (the resources.arsc file), uncompiled resources, and a binary version of the AndroidManifest.xml file

Complete data validation

always done on the server. Then if any invalid data is detected, the form is returned to the client so the user can correct the entries.

What defines one screen of an app in android development

an activity

In what package is the Configuration class?

android.content.res

The SoundPool class, part of the __________________ package, enables us to load a sound and play it.

android.media

The AppCompatActivity class is found in the package

android.support.v7.app

# Which attribute will be used in XML if the Java code needs a reference to View?

android: id

Inside a RelativeLayout element, this code adds a row that contains an EditText whose id is age and is positioned to the right of the View whose id is name; its left edge is lined up with its parent View.

android:id="@+id/age" android:layout_toRightOf="@+id/name" android:layout_alignParentLeft="true"

Using a RelativeLayout, which attribute do we use to specify that a View's bottom matches the bottom of its parent View?

android:layout_alignParentBottom

Using a RelativeLayout, which attribute do we use to specify that a View goes below another View?

android:layout_below

The XML attribute for the bottom margin of a GUI component is __________________.

android:layout_marginBottom

The XML attribute for the right margin of a GUI component is __________________.

android:layout_marginRight

Which attribute do we use to specify the margin above a View?

android:layout_marginTop

In a table layout, which attribute can you add to have a widget span two columns? a. android:span="2" b. android:widget_span="2" c. android:layout_span="2" d. android:col_span="2"

android:layout_span="2"

When a button is clicked on by the user, we want the method foo to execute. How do we do it (inside the Button element of the activity_main.xml file)?

android:onClick="@activity/foo"

In a linear layout, which attribute can you add to switch to horizontal orientation? a. android:weight="horizontal" b. android:orientation="horizontal" c. android:gravity="horizontal" d. android:layout="horizontal"

android:orientation="horizontal"

When using a scale element for a scaling transition, what attribute do we use to define the x coordinate of a fixed point when scaling takes place?

android:pivotX

The name of the XML attribute that we use to specify that an app will run in horizontal orientation only is:

android:screenOrientation.

Which of the following menu item attributes displays the icon for the menu item in the action bar only when there's enough room in the action bar to fit the icon?

android:showAsAction="ifRoom"

Given the following code in the strings.xml file, which of the following properties sets the text on the widget to "Continue"? <string name="continue">Continue</string>

android:text="@string/continue"

You can create an instance variable that creates an object from a class that implements the listener interface. Since this class doesn't have a name, it's known as a/an ________________ class.

anonymous

You can create an instance of a listener interface without assigning it to an instance variable. This is known as a/an ________________ class.

anonymous inner

What occupies one or more cells on the Home screen and can display data and receive periodic updates?

app widgets

# Which file is entry point for Sencha Touch app?

app.js

57. Which file is entry point for Sencha Touch app?

app.js

Which file is entry point for Sencha Touch app?

app.js

When you chain the effects and animations they

are placed in a queue for that element and run in a sequence

A/an ________________ adapter can provide the list that a spinner should display.

array

A task that runs in a separate thread in the background and does not need to be synchronized with other threads is called a/an ________________ task.

asynchronous

one(event, handler)

attach an event handler and remove it after it runs one time

DOM manipulation methods

attr( ), css( ), addClass( ), removeClass( ), toggleClass( ), html( )

Basic HTML5 attributes for working with forms

autofocus - A Boolean attribute that tells the browser to set the focus on the field when the page is loaded placeholder - a message in the field that is removed when an entry is made in the field

A stack of all recently used activities, sorted in the order in which they were used is called a/an ________________.

back stack

To run an app on a device or emulator, the app must

be stored in an APK file (Android package file) and be signed with a digital certificate

Statements are grouped together by curly braces to form __________.

blocks

# What is the return value of onKeyDown() method?

boolean

IntentFilter are typically defind via

both of

IntentFilters are typically defined via

both of

The public field of the ViewGroup.MarginLayoutParams class defining a bottom margin is __________________.

bottomMargin

The Android operating system ________________ certain ________________ that occur as a device is being used.

broadcasts, actions

Before you can run a project, you must ...

build the project. Typically, the IDE automatically builds a project before running it.

The Click event is available from most widgets, but most __________ handle this event.

buttons

Which of the following declares a class for an asynchronous thread?

class GetItems extends AsyncTask<String, Void, String> {}

The View.OnClickListener interface can be implemented to handle a __________________ event on a View.

click

The built-in style called TextAppearance.Small.Inverse displays a small font size and inverse ________________.

color scheme

To define names for colors, you typically add a/an ________________ file to the res/values directory.

colors.xml

# This object is used to determine the type of network accessible to the app end-user?

connection

When you work with a content provider that's included with Android, you can import the classes that contain the ________________ for working with the content provider.

constants

Which is true about using signals from the cell network or Wi-Fi hotspots to determine location?

consumes less battery power than GPS, works indoors and outdoors, and less accurate than GPS

Which is true about listening to location updates that are being sent to other apps to determine location?

consumes more battery power and doesn't let you control when your app gets updates

A/an ________________ allows multiple apps to share the same data.

content provider

Which of the following URIs follows standard conventions for specifying a single row within a table of cities?

content://com.murach.weather.provider/cities/1

# __________ allows you to set some element to be editable inside the browser.

contenteditable

Widgets can also be referred to as

controls

Fields

controls that accept user entries

To display a map, you can

create an activity that extends the FragmentActivity class, declare an instance variable for the GoogleMap object, and add code to the onStart method of the activity to get the GoogleMap object

Given a SQLiteDatabase object named db and a constant named CREATE_CITIES_TABLE that contains a valid CREATE TABLE statement, what does the following code do? db.execSQL(CREATE_CITIES_TABLE);

creates the specified table

# _________ property returns the url of current audio/video

currentSrc

A type of thread that ends when the app ends is called a/an

daemon thread

37. What is the android:versionCode attribute in the AndroidManifest.xml file?

dai cmn nhat

Which of the following are true about Intent.

dai nhat

During development, the IDE automatically generates a/an ________________ key and uses it to sign the APK file.

debug

Fixing all the errors in an app is called

debugging

delay(duration)

delay the start of the next animation in the queue

dp or dip

density independent pixels, typically used for margins, padding etc.

In Android, what does dp unit stand for

density-independent

Although Android supports other units of measurement, it's a best practice to use

density-independent pixels (dp)

You can enable or disable a preference by using its ________________ attribute to link the preference to a corresponding CheckBoxPreference element.

dependency

In Android Studio, to view the layout in the graphical editor, click the ________________ tab.

design

# Which of the following properties is used to determine the operating system a PhoneGap application is running on?

device.platform

# This event is fired when the PhoneGap API is ready to be used within your application?

deviceready

# When application run on Dalvik Virtual Machine, java bytecode will be complile into file with extension

dex extension

13. Which of the following are true about Intent.CALL_ACTION?

dial + dialled

To run an app on an emulator or device, the app must be signed with a

digital certificate that has a private key.

Within a class for an asynchronous thread, which of the following methods is executed on the asynchronous thread?

doInBackground(Params...)

An unbound service

does not interact with other components such as activities, runs until it's stopped by another component, runs until it's stopped by itself (all of the above)

Java: create double called demo > make it equal to 5.50

double demo = 5.50;

Given a table data (click to see the figure). And assume that this is on a device at 160 dpi

dp * scaler = px

Add a widget (android)

drag a widget from the Palette onto the layout

To view a notification, the user can pull down on the notification area to open the notification ________________.

drawer

miscellaneous method

each( )

An EditText widget can be referred to as an

editable text view or a text box.

As discussed, there are 4 main components in Android application. And in AndroidManifest.xml file, you need to declare:

elements for configurations

HTML5 controls and descriptions, type = "HTML5 control here"

email - gets email with validation done by the browser url - gets URL with validation done by the browser tel - gets tel num with NO validation done by the browser number - when supported, gets a numeric entry with min, max, and set attributes, browser validation, and up and down arrows date - when supported gets a date entry with min and max attributes and may include a pop up calendar or up and down arrows time - when supported gets a time entry with min and max attributes and may include up and down arrows

An Android Virtual Device (AVD) is an

emulator

When a/an ________________ occurs on a widget, the appropriate method of the ________________ object is executed.

event, listener

The name of the method of the SQLiteDatabase class to execute insert, delete, or update SQL queries is

execSQL

What keyword is used in a class definition to inherit from another class?

extends

Is it possible to run java source

false

On android service, onStart() and onBind() are the same?

false

The R.java file is where you

false

AS: create new Handler > create new Runnable > run a log every second

final Handler handler = new Handler(); Runnable run = new Runnable(); @Override public void run() { Log.i("test", "run"); handler.postDelayed(this, 1000); } handler.post(run);

# Which of the following methods is used to return a View from a layout file given the ID of the View?

findViewById(int id)

Which of the following methods is used to return a View from a layout file given the ID of the View?

findViewById(int id)

JQuery methods for triggering events

focus( ), blur( ), change( ), select( ), submit( )

JQuery event methods for forms

focus(handler) - the handler runs when the focus moves to the selected element blur(handler) - the handler runs when the focus leaves the selected element change(handler) - the handler runs when the value in the selected element is changed select(handler) - the handler runs when the user selects text or textarea box submit(handler) - the handler runs when a submit button is clicked

Java: create a for each loop > create a String called name for each index in the family array > log the names

for (String name : family) { System.out.println(name); }

AS: create a loop to iterate through JSON array and get each part as an object

for (int i =0; i<arr.length; i++){ JSONObject jsonPart = arr.getJSONObject(i);

Java: create a for loop > count by 2s > start at 0 > end at 10

for (x = 0; x <= 10; x += 2) {}

To add more than one fragment to a layout, add two or more ________________ to a layout file.

fragment elements

One of the simplest and most efficient types of layouts, which often displays only a single widget is a ________________ layout.

frame

The AsyncTask class uses _____________ to allow a class to operate on various types of objects.

generics

You can use a FragmentManager object to

get a reference to a Fragment object and replace one fragment with another fragment.

# Which built-in HTML5 object is used to draw on the canvas?

getContext

# In HTML5, which method is used to get the current location of a user?

getCurrentPosition()

In Android, which method you can use to obtain the path of the external storage

getExternalStorageDirectory()

# How to get the form data in Sencha Touch?

getFormInstance().getValues();

68. How to get the form data in Sencha Touch?

getFormInstance().getValues();

How to get the form data in Sencha Touch?

getFormInstance().getValues();

# How to get the form data in Sencha Touch?

getFormInstanceagetValues();

76. How to get the form data in Sencha Touch?

getFormInstanceagetValues();

From a fragment or activity, you can call the ________________ method to get a FragmentManager object that you can use to find and work with the fragments in your app.

getFragmentManager

If you want to get String data from the intent for a broadcast action, what method of the Intent class can you use?

getStringExtra

The ________________ attribute aligns a widget with the top, bottom, center, left, or right of its linear layout.

gravity

When the layout for a ListView widget contains complex widgets such as a check box, you code a class that extends the layout. This allows you to

handle events that occur upon the widgets and display the widgets correctly.

When an activity is in the paused state, the activity

has lost the focus and may be partially hidden by other activities

An interface that defines a listener for a/an ________________ event is typically nested within the class that defines the widget. These listeners can only be wired to an appropriate widget.

high-level

The back stack for a particular task is called the task ________________.

history

What do you use to sub group elements linearly? (2)

horizontal or vertical linear layouts

The decodeResource method of the BitmapFactory class has this API: static Bitmap decodeResource( Resources res, int i ).The parameter named i represents the __________________ of a resource.

id

AS: Request location update on device using a build less than API 23 marshmellow

if (Build.VERSION.SDK_INT < 23) { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); }

AS: Check if location permission is granted > if it's not, request it > if it is, update location

if (ContextCompat.checkSelf(Permission(this, Manifest.permission.ACESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); } else { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); }

AS: Toast the country name of the users address

if (listAddresses != null && listAddresses() > 0) { String address = ""; if (listAddresses.get(0).getCountryName() != null) { address += listAddresses.get(0).getCountryName; }} Toast.makeText(MainActivity.this, address, Toast.LENGTH_SHORT).show(); //Same for all parts of address, just keep adding and put spaces in between

AS: log the users address

if (listAddresses != null && listAddresses.size() > 0) { Log.i("Address", listAddresses.get(0).toString()); }

Java: create if statement > if x is less than 5 > log x is less than 5 > else if x is greater than 5 > log x is greater than 5

if (x < 5) { System.out.println("x is less than 5"); } else { System.out.println("x is greater than 5"); }

camelCase

if more than one word, first letter of first word is lowercase, the remaining first word letters are uppercase; java convention

toggleClass(className)

if the class is present, remove it. Otherwise, add it

It's important to store your key store file in a secure location, because

if you lose it, you won't be able to update your app and if a hacker gains access to it, he or she can update your app

# Which is not a Android resource?

image

AS: animate ID image > change transparency to 50% > set change for 1 second duration

image.animate().alpha(0.5f).setDuration(1000);

AS: rotate element image once over 2 seconds

image.animate().rotation(360f).setDuration(2000);

AS: animate ID image > move image down vertically by 2000 pixels > do so over 2 seconds

image.animate().translationYBy(2000f).setDuration(2000);

AS: get image2 from drawable > set image resource of image ID as image2

image.setImageResource(R.drawable.image2);

One of the things we must do to handle touch events is create an object of a class that __________________ View.OnTouchListener.

implements

A/an ________________ intent specifies the action you want to perform, and can be used to view a URL in a web browser or to call a phone number.

implicit

Intents designate the target

implicit inten

AS: import media player file > create new audio named audio > play audio

import android.media.MediaPlayer; MediaPlayer audio = MediaPlayer.create(this, R.raw.laugh); audio.start();

Java: import all util framework

import java.util.*;

Within the onCreateOptionsMenu method, you typically use a MenuInflater object to ________________ the XML for the menu items into Java objects and store them in the Menu parameter.

inflate

Which method of the SQLiteDatabase class can you use to add a row to a table?

insert

To allow other apps to modify the data in your database, you can override the ________________ method(s) of the ContentProvider class.

insert, update, and delete

Java: create integer called demo > make it equal to 34

int demo = 34;

AS: get file name for raw file

int resourcesId = getResources().getIdentifier(ourId, "raw", "com.joncorrin.basicphrases");

What gets the current value of the seek bar?

int volume = volumeSeekBar.getProgress();

How do we access the width of a Bitmap object reference named b?

int w = b.getWidth();

Java: create a while loop > count by 1s > start at 0 > end at 10

int x = 0; while (x <= 10) { x++ }

Java: store integer as array

int[] numbers = {1, 2, 3, 4,};

A/an ________________ provides a description of an operation to be performed. This type of object can be used with the startActivity method to start activities.

intent

AS: method for getting variable from another activity

intent.getStringExtra("var");

AS: method for passing variable to other activities

intent.putExtra("var", "var passed");

SQLite database save data in

internal storage

What is an intent

is a bunlde

Android Studio

is an IDE that you can use to develop Android apps. Android Studio is based on IntelliJ IDEA. It's open-source, available for free, and runs on all modern operating systems. Although it's possible to use other IDEs, Android Studio is currently the official IDE for Android, replacing Eclipse with ADT. As a result, most Android developers use Android Studio for new development.

A soft keyboard

is an on-screen keyboard that you can use to enter text on touchscreen devices and emulators

Android Studio

is free, open source, and runs on all modern OS

Which statement is Not correct about PhoneGap ?

it doesn't support for Java phone

What is true about localStorage ?

it is never expired

Which is true about using GPS to determine location?

it is the most accurate method

Which is not true about the open-source version of MapQuest?

it provides more features than Google Maps

extends

java code for passing attributes

protected

java code for privately accessible to specific package

void

java code for return nothing

You do not need to import the package of the current file and __________, java will automatically import those for you.

java.lang

AS: get object from JSON as specific string

jsonObject.getString("string");

A/an________________ is a file that contains one or more digital certificates.

key store

The Android Debug Bridge (ADB)

lets your IDE communicate with an emulator or physical Android device.

To add the TabManager library to your project, copy the TabManager.jar file to the _________________ directory for your project. Then, make sure the project inlcudes a dependency for the .jar files in this directory.

libs

A ________________ layout displays a column or row of child widgets.

linear

JQuery Easing options

linear and swing. Swing is the default

An object that listens for an event is known as a/an

listener

An interface that defines the listener for a/an ________________ event is typically nested within the adroid.view.View class. These listerners can be wired to any type of widget.

low-level

AS: use blue default icon for google map marker

mMap.addMarker(new MakrerOptions().position(everest).title("Marker").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));

AS: Set map type to hybrid

mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID));

Assume you have the following constant value, a NotificationManager object named manager, and a Notification object named notification. Which of the following statements removes the notification? final int NOTIFICATION_ID = 999;

manager.cancel(NOTIFICATION_ID);

Assume you have the following constant value, a NotificationManager object named manager, and a Notification object named notification. Which of the following statements displays the notification?

manager.notify(NOTIFICATION_ID, notification);

How many css file can be included in a Sencha Touch project ?

many

You can distribute an app through a/an application ________________ such as Google Play, or you can distribute it directly to users via a website or email.

marketplace

If a TextView has not been displayed yet, it is possible to retrieve measurements about its width and height using the __________________ method.

measure

The action bar can include ________________

menu items

Easing for basic methods, fadeTo( ) and animate

methodName([duration][, easing][, callback) - basic fadeTo(duration, opacity[, easing][, callback) - fadeTo animate({properties} [, duration][, easing][, callback) - animate

To add a banner ad to your app, you need to work with a/an ________________ network that serves ads to mobile devices.

mobile advertising

Getting paid for an app is referred to as ________________ an app.

monetizing

@Override public void onItemSelected(AdapterView<?> parent, View v, int position, long id) { month = 0; } Assume that this method is wired to a Spinner widget that displays the 12 months in order (January, February, March, etc.). How can you change the statement in this method so that the month variable stores a value of 1 for January, 2 for February, 3 for March, etc.?

month = position + 1;

What statement selects the second item in the spinner?

monthsSpinner.setSelection(1)

Which of following is true?

myIntent is explicit intent

# Intent mylntent = new Intent(IntentACTION_VIEW Uri.pars("http://www.google.com")); startActivity(myIntent): Which of following is true?

myIntent is implicit Intent

78. Intent mylntent = new Intent(IntentACTION_VIEW Uri.pars("http://www.google.com")); startActivity(myIntent):

myIntent is implicit Intent

startActivity(myIntent):

myIntent is implicit Intent

Intent myintent = new Intent(this, ActivityTwo.class);

myIntent.putExtra("Value1", "This value one for ActivityTwo")

It's generally considered a good practice to define constants for the ________________ of the database

name and version number (both a and b)

Which statement correctly changes the nameLabel TextView to Nguyen Van A?

nameLabel.setText("Nguyen Van A") |

# Which statement correctly changes the nameLabel TextView to Nguyen Van A?

nameLabel.setText("Nguyen Van A");

44. Which statement correctly changes the nameLabel TextView to Nguyen Van A?

nameLabel.setText("Nguyen Van A");

AS: create a yes/no alert

new AlertDialog.Builder(this) .setIcon(android.R.drawable.ic_dialog_alert) .setTitle("Are you sure?") .setMessage("Do you want to do this?") .setPositiveButton("Yes", new DialogInterface.onClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i){ Toast ...; } } .setNegativeButton("No", null) .show(); }

AS: create new countdown timer from 10 seconds > Log seconds left every second > Log finished on finish

new CountDownTimer(10000, 1000) { public void onTick(long millisecondsUntilDone) { Log.i(String.valueOf(millisecondsUntilDone / 1000), "Left"); } public void onFinish() { Log.i("Done", "Finished"); } }.start();

In Android, which statement is NOT correct about AsyncTask

none of

Which is a map type?

normal, terrain, and hybrid

# This object is used to display native alert boxes and confirmation boxes as well as cause the device to beep or vibrate?

notification

A/an ________________ provides a way for a service to display a message even when another app is running.

notification

When it's first displayed, a notification appears as an icon in the ________________ at the top of the screen.

notification area

Which is the method you need to use to post a notification to be shown in the status bar?

notify(...)

What literal is used to denote an object is unavailable?

null

Java: get array length

numbers.length; //No parenthesis

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

onClickListener

What method is automatically called when the user rotates the device, provided the AndroidManifest.xml file is correctly coded?

onConfigurationChanged

When extending SQLiteOpenHelper, what methods must we override?

onCreate and onUpgrade

What are the event callback methods in Android

onCreate( ) onStart( ) onResume( ) onPause( ) onStop( ) onRestart( ) onDestroy( )

# Android

onCreate()

# Android: Where we can create tables and columns to them, create views or triggers?

onCreate()

# Android: where we can create tables and comlumns to them, create views or triggers

onCreate()

Android: where we can create tables and comlumns to them, create views or triggers ?

onCreate()

In class SQLiteOpenHelper class, there are 2 method we usually override. What are they?

onCreate() and onUpdagrade()

# In class SQLiteOpenHelper class, there are 2 methods we should usually override. What are they?

onCreate() and onUpgrade()

Which methods are called for a bound service?

onCreate(), onBind(), onUnbind()

Which methods are called for an unbound service?

onCreate(), onStartCommand(), onDestroy()

What methods of the Activity class (and in what order) are automatically called when an activity is first created?

onCreate, onStart, and onResume

When an app starts for the first time, Android calls the

onCreate, onStart, and onResume methods

# Android: When a dialog is requested for the first time, which method will Android call from your Activity?

onCreateDialog(int)

Android: When a dialog is requested for the first time, which method Android call from your Activity ?

onCreateDialog(int)

Android calls the ________________ method when it's time to display the layout for the fragment. This occurs after the onCreate method, but before the onStart method.

onCreateView

When it's time to remove the fragment's layout from the activity, Android calls the ________________ method. This occurs after the onStop method but before the onDestroy method.

onDestroyView

# This function should be implemented to safely initialize your application using the PhoneGap API after the app loads.?

onDeviceReady()

The postInvalidate method of the View class that has no parameter triggers a call to the __________________ method and refreshes the whole View.

onDraw

# Which of the following is NOT a life-cycle methods of an Activity?

onInit

21. Which of the following is NOT a life-cycle methods of an Activity?

onInit

Which of the following is NOT a life

onInit

Which of the following is NOT a life-cycle methods of an Activity?

onInit Correct

Which method is executed when the user selects one of the items in the ListView widget?

onItemClick

For a spinner, the ________________ method is executed when the spinner is first displayed and whenever a new item is selected.

onItemSelected

For a spinner, the ________________ method is only executed when the selection disappears.

onNothingSelected

Within a class for an asynchronous thread, which of the following methods is executed on the UI thread after the asynchronous thread has finished executing?

onPostExecute(Result)

For a seek bar, the ________________ method is executed as the user changes the value of the seek bar.

onProgressChanged

What method of an app widget does Android call when an action for the app widget is broadcast?

onReceive

When you code a class that defines a broadcast receiver, you override a method that's executed when the broadcast is received. What's the name of this method?

onReceive

The __________________ method of the Activity class is called when an activity is about to restart.

onRestart

To restore values you have saved in your app, you can override the ________________ method.

onResume

What method of an app widget does Android call when the user adds the widget to the Home screen?

onUpdate

# Which Android File API to create a file?

openFileOutput()

64. Which Android File API to create a file?

openFileOutput()

Which Android File API to create a file

openFileOutput()

Which Android File API to create a file?

opentfileoutput()

The orientation instance variable of the Configuration class represents the ____________ of the device.

orientation

In IntelliJ IDEA, what folder is automatically created when you run your Java project? This folder stores the generated .class files in a file hierarchy dependent on your project name and package name.

out

A common property for layouts is

padding, height, width

With this type of app, the customer pays a one-time fee before he or she can install the app.

paid app

A/an ________________ intent is an intent that can be passed to other apps so that they can execute the intent at a later time.

pending

Android can be used to develop which types of apps? a. Photography b. Reference c. Finance d. All of the above

photography, Finance, and Reference

The getDimensionPixelSize method of the Resources class returns the number of __________________ of a resource given its id.

pixels

In SQLite, a/an ________________ column requires that each row must have a value, and that value must be unique.

primary key

A pattern attribute

provides for data validation thought the use of a regular expression

Inside a class that extends SQLiteOpenHelper, write the code for the constructor; the name of the database we want to create is FRIENDS; its version is 3.

public DatabaseManager( Context context ) { // Your code goes here super( context, "FRIENDS", null, 3 ); }

When the user selects from the menu an item whose id is second, write the code to go to another activity of type SecondActivity.

public boolean onOptionsItemSelected( MenuItem item ) { // your code goes here int id = item.getItemId( ); if( id == R.id.second ) { Intent secondIntent = new Intent( this, SecondActivity.class ); this.startActivity( secondIntent ); }

AS: Create download content from URL class

public class DownloadTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... urls) { String result = ""; URL url; HttpURLConnection urlConnection = null; try { url = new URL(urls[0]); urlConnection = (HttpURLConnection) url.openConnection(); InputStream in = urlConnection.getInputStream(); InputStreamReader reader = new InputStreamReader(in); int data = reader.read(); while (data != -1) { char current = (char) data; result += current; data = reader.read(); } return result; } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; } }

AS: Download image via url

public class ImageDownloader extends AsyncTask<String, Void, Bitmap> { @Override protected Bitmap doInBackground(String... urls) { try { URL url = new URL(urls[0]); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.connect(); InputStream inputStream = connection.getInputStream(); Bitmap myBitmap = BitmapFactory.decodeStream(inputStream); return myBitmap; } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; } }

Which statement follows the best practices for defining a constant for an action that can be broadcast?

public final static String ACTION_NEW = "com.murach.weather.ACTION_NEW";

AS: create public View class called view that returns nothing > call it with clickFunction > Log "info" "Button pressed"

public void clickFunction(View view) { Log.f("Info", "Button Press"); }

Inside a class that extends SQLiteOpenHelper , write the code for the insert method below. We want to insert one record in the emails table of question 17 using the three parameter values of the insert method below.

public void insert( String email, String first, String last ) { // your code goes here SQLiteDatabase db = this.getWritableDatabase( ); String sqlInsert = "insert into emails"; sqlInsert += " values( '" + email + "', '" + first; sqlInsert += "', '" + last + "' )"; db.execSQL( sqlInsert ); db.close( ); }

Inside a class that extends SQLiteOpenHelper, write the code for the onCreate method; we want to create the table emails defined as follows: the key is email, a string; it has two other columns, first and last, both strings.

public void onCreate( SQLiteDatabase db ) {String sqlCreate = "create table emails ("; sqlCreate += " email text primary key, first text, last text )"; db.execSQL( sqlCreate );

AS: Listen for updates to location if permission is granted

public void onRequestPermissionsResult(...) { super.onRequestPermissionsResult(...); if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { locationManager.requestLocationUpdate(LocationManager.GPS_PROVIDER, 0, 0, locationListener); }}

When the user comes back to this activity from another activity, we want the method modifyThisActivity to execute. Override the appropriate method and make the call to the modifyThisActivity method inside it.

public void onStart( ) { modifyThisActivity( ); }

If you want to pass data to the receiver, what method of the Intent class can you use to store data in the Intent object?

putExtra

____________method is called when we add extended data to an intent

putExtra

A/an ________________ lets the user select one option from several options.

radio button

# Which input type defines a slider control?

range

When you need to use mp3 file in Android application, which folder you need to create and store mp3 file?

raw folder

The name of the method of the SQLiteDatabase class to execute a select SQL query is

rawQuery

Javascript load event = JQuery ...

ready(handler) <-- an event method

A broadcast _______________ is an application component that listens for a broadcast and executes code when it receives that broadcast.

receiver

Before you can use an Application object or a service, you must ________________ it.

register

Before distributing an app, you must generate a/an ________________ key and use it to sign the APK file.

release

off(events, [handler])

remove an event handler from one or more events

The removeAllViewsInLayout method of the ViewGroup class __________________ all the Views in the ViewGroup that calls it.

removes

HTML5 data validation attributes (attributes for data validation)

required - A boolean attribute that indicates that a value is required for a field title - text that is displayed in a tooltip when the mouse hovers over a field. This text is also displayed after the browser's default error message pattern - a regular expression that is used to validate the entry in a field novalidate - a boolean attribute that tells the browser that it shouldn't validate the form or control that it is coded for autocomplete - set this attribute to "off" to tell the browser to disable auto completion. This can be coded for a form or a control

Which of the following directories should you use to store a layout that's designed for landscape orientation? a. src/layout b. src/layout-land c. res/layout d. res/layout-land

res/layout-land

What directory should you use to store the info file for the app widget?

res/xml

<?xml version="1.0" encoding="utf-8"?> <resources> <item name="activity_main" type="layout"> @layout/activity_main_threepane </item> </resources> What file should you store this code in if you want it to display the activity_main_threepane layout instead of the activity_main layout only when device is in landscape orientation and the smallest side of the device is at least 720dp?

res\values-sw720dp-land\layout.xml

What directory is used to store the XML for a preferences screen?

res\xml

________________ is the process of using map data to provide directions.

routing

SQLite is an embedded database. This means that it

runs in the same process as the client app

In Android, a layout stores ...

s the XML that defines the user interface of an app.

sp

scale independent pixels, usually used for font sizes

For the textSize property, it's generally considered a best practice to use _____________ to specify the size of the text.

scale-independent pixels

The following instance variable of the Configuration class stores the height of the device in dp units, not including the status bar.

screenHeightDp

Given a TextView widget named secondsTextView and a Runnable object named updateSeconds, which statement updates the widget on the UI thread?

secondsTextView.post(updateSeconds);

A/an ________________ lets the user specify a value by dragging a/an ________________ to the right or left.

seek bar, thumb

:header

selects all elements that are headers (h1, h2...)

:last-child

selects all elements that are the last children of their parent elements

:nth-child

selects all elements that are the nth children of their parent elements

:odd

selects all elements that are the odd index within the selected set

:not(selector)

selects all elements that aren't selected by the selector

:has(selector)

selects all elements that contain the element specified by the selector

:lt(n)

selects all elements within the selected set that have an index less than n

:first

selects the first element within the set

:last

selects the last element within the selected set

# What method is used to send a broadcast event?

sendBroadcast(intent);

Which of the following statements can you code within the class for a fragment to indicate that the fragment contains menu items to contribute to the options menu for the activity?

setHasOptionsMenu(true);

After we have created a Toast, we need to call the __________________ method so that the Toast is visible.

show

# Which method to display a dialoge ?

show()

The ________________ qualifier allows you to select screens whose smallest width is at least as wide as specified width.

smallest-width

An on-screen keyboard is also known as a

soft keyboard

When you create a device definition for an emulator, you can

specify the screen size and resolution, the Android API for the device, and whether the device provides hardware buttons,

A/an ________________ allows the user to select an item from a list of items.

spinner

How will you launch an Activity

startActivity

# How will you launch an Activity within your application?

startActivity(intent);

What does 'static' mean in Java?

static means that the variable or method marked as such is available at the class level. In other words, you don't need to create an instance of the class to access it.

The Variables window shows the values of the variables that are in scope for the current method. This includes

static, local, and instance variables

In Android Studio, when you run an app with the debugger, and it encounters a breakpoint, Android Studio

stops before it executes the line of code at the breakpoint.

By default, UI component made in the UI editor should have text defined in file ?

string.xml

Which of the following attributes sets the style for the widget to the Spinner style?

style="@style/Spinner"

If necessary, you can use multiple ________________ files to set appropriate themes for the different API levels.

styles.xml

@Override public void onCheckedChanged(CompoundButton widget, boolean isChecked) { deleteOldMessages = isChecked; } If you decided to wire this event handler to multiple check boxes, which switch statement could you add to this method to compare the ID of the check box that was changed with the IDs of the check boxes on the layout?

switch (widget.getId()) { ... }

A/an ________________ service is a service that's provided by the Android operating system.

system

A ________________ layout displays widgets in rows and columns.

table

It's generally considered a good practice to define constants for the

table names, column names, and column numbers (all of the above)

A/an ________________ is a cohesive unit that can contain multiple activities.

task

In Android Studio, to view the XML for the layout, click the ________________ tab.

text

AS: show textView > hide it

textView.setVisibility(View.VISIBLE); textView.setVisibility(View.INVISIBLE);

Which of the following are UI elements

textview

he Android system architecture, which is also known as ...

the Android stack

<style name="TextView"> <item name="android:textSize">20sp</item> </style> <style name="Button" parent="@style/TextView"> <item name="android:textStyle">bold</item> </style> <style name="PrimaryButton" parent="@style/Button"> <item name="android:textColor">@color/primary</item> </style> The style named PrimaryButton inherits...

the Button style and the TextView style

In Sencha Touch, app folder contains

the Models, Views, Controllers and Stores for your app.

Best practice is to refer to static fields (class variables) using the name of:

the class i.e. Math.PI()

finish vs stop(true)

the finish( ) method is similar to stop( ) method with true coded for both parameters, except that the properties of all queued animations jump to their end values

In Android, what is the meaning of the following code in MainActivity class?

the main thread calls the UI thread

For an asynchronous task, within the inner class, you can access the context for the activity by coding

the name of the outer class, a period, and the this keyword

Easing

the way an animation is perforemed

Holo, Material, and Holo.Light.DarkActionBar are all names of ________________ .

themes

An AlertDialog.Buider constructor has this API public AlertDialog.Buider (Context context).Inside an Activity class, when using the constructor, what argument do we pass?

this

A/an ________________ is a single sequential flow of control within a program that often completes a specific task.

thread

Given a Timer object named timer and a TimerTask object named task, which of the following statements runs the task immediately and again every minute?

timer.schedule(task, 0, 60000);

Messages that are briefly displayed on the user interface are called

toasts

The different parts of the Android Studio main window are know as

tool windows

The public field of the ViewGroup.MarginLayoutParams class defining a top margin is __________________.

topMargin

Google Maps provide many features, including

traffic layers, 3D buildings, and street view

trigger(event)

trigger the event for the selected element

JQuery trimming method

trim( ) - removes all spaces at the start and end of the string

# A project is compiled into a single .apk file.

true

# Can an application be started on powerup?

true

# The Dalvik Debug Monitor Service (DDMS) is a key debugging utility that is integrated into the Eclipse, the favoured development environment for Android apps

true

Android Async Task create new thread in background

true

Can PhoneGap work with Contacts data of mobile device?

true

Choose whether the statement is TRUE or FALSE

true

Does CSS support to detecting device size and orientation?

true

Java: try creating new array > catch ArrayIndexOutOfBoundsException > catch general Exception

try { int[] array = new int[3] } catch(ArrayIndexOutOfBounds e){ //print error } catch(Exception e){ //print error }

# Which method to open a Hap connection to an Uri?

url.openConnection()

Which method to opena Http connection to an Uri?

url.openConnection()

To apply a color, you can

use a hex value, use a name for a user-defined color, or use a name for a built-in Android color.

To handle an event, you can

use the current class as the listener, use an anonymous inner class as the listener, and use a named class as the listener

setContentView

used inside onCreate to call resource

AS: delete 1 Jon user from users database

usersDB.execSQL("DELETE FROM users WHERE name = 'Jon' LIMIT 1");

Convert string to int

var age = parseInt($("#age").val( ));

Get the value of a checked radio button

var radioButton = $("input[name='contact_by']:checked").val( );

Get an array of selected options from a list

var selectedOptions = [ ]; selectedOptions = $("#selected_list :selected");

A parameter with a type that includes "..." represents an arbitrary number of arguments of that type. This construct is called:

varargs

If you make changes to the structure of the database, you can increment the ________________ for the database.

version number

What is the correct HTML5 element for playing video files?

video

SQLite is ________________-typed, meaning a column in a SQLite database does not reject a value of an incorrect data type.

weakly

AS: Display html webView data that says hello

webView.loadData("<html><body><h1>hello</h1></body></html>, "text/html", "UTF-8"); webView.loadUrl("https://www.url.com");

In a linear layout, the ________________ attribute determines how much space Android allocates to a widget.

weight

Typically, an event occurs when a user interacts with a/an

widget

There are three steps to handling an event. First, import the interface that defines a listener. Second, implement the listener. Third,

wire the listener to an event

Android: What is value on component's attribute "layout_width" and "layout_height" to display the component big enough to enclose its content only?

wrap_content

How do you specify a property name in the properties map ( for animate ( ) )

you use camel casing instead of the CSS hyphenation or you can enclose the CSS property in quotes ex. fontSize and "Font size"

You can use a GoogleMap object to

zoom in on a location, add one or more markers to a map, and display a series of connected lines on a map

What type of content can a WebView widget display?

Any type of content that a web browser can display

# Android is licensed under which open source licensing license?

Apache/MIT

Anonymous classes require a name of an interface to implement or a(n) ___________.

Class to extend

# Android programs are compiled into .dex files. DEX stand for:

Dalvik Executable.

A/an ________________ is a special type of method that's executed when an event occurs.

Event Handler

In HTML5, onblur and onfocus are:

Event attribute

# Intents designate the target component by its name and they are typically used for application-internal messages.

Explicit Intents

# What is base of all Sencha Touch component?

ExtComponent

# In android, normally SDCard is

External storage

In Android, normally SDCard is

External storage

# Android UI is threadsafe

False

(T/F) You can mix the types of the values in an array.

False

each(function)

Run the function for each element in an array

To parse XML files, you can use ________________ .

SAX (simple API for xcel)

# HTML is based on which language

SGML

# Which database is natively supported by android?

SQLite

59. Which database is natively supported by android?

SQLite

Three common types of widgets are

TextView, Button, EditText

Android UI is threadsafe

True

what stores the XML that defines the user interface for an activity?

a layout

A TextView widget can be referred to as

a text view or a label.

The height of the status bar

can be retrieved programmatically

To specify a color, you can use ________________ values to specify an RGB value.

hex

# In HTML5, which element is used to group heading elements?

hgroup>

hide( )

hide the selected element from the lower right to the upper left

effect methods

hide( ), show( )

DOM traversal methods

prev( ), next( ), find( )

A/an ________________ displays a visual indicator of the progress of an operation.

progress bar

In Android Studio, a/an ________________ contains all of the files for the app including the Java source code.

project

In a values directory, an alias

provides a way to avoid duplicating code in mulitple layout files and points to a layout file that's stored in a layout directory

sp

text pixel measurement

What is a signature permission?

The system grants these app permissions at install time, but only when the app that attempts to use a permission is signed by the same certificate as the app that defines the permission.

The getX method of MouseEvent returns:

The x coordinate of the touch within the View where the tough occurred

A/an ________________ is a collection of styles that apply to an entire activity or app.

Theme

True or False? It is possible to retrieve the height of the action bar programmatically.

True

There is a kind of animation that using an XML file to define a sequence of pictures using

Tween Animation

# If the action is ACTION_CALL. what the data field would be?

URI with the number to call

If the action is ACTION_CALL, what the data field would be ?

URI with the number to call

Where do you do version control with git and github in AS?

Under the VCS tab

# Eclipse shows an error in code by

Underlining the statement with the error in a red dashed line

# How will you pass data to sub-activities?

Use Bundles

26. How will you pass data to sub-activities?

Use Bundles

How will you pass data to sub-activities?

Use Bundles Correct

How to define a new Sencha Touch class ?

Use Ext.define()

# How to define a new Sencha Touch class?

Use Extdefine()

# How to set layout's attribute programmatically in android?

Use LayoutParams class

How to set layout's attribute programmatically in android ?

Use LayoutParams class

# How to set data for a Spinner control?

Use method setAdapter()

48. How to set data for a Spinner control?

Use method setAdapter()

How to set data for a Spinner control?

Use method setAdapter()

How do you make each property in an object a string when creating a list?

Use the <String> identifier in front of List on both sides of the equal operator

Which of the following are true about Intent.CALL_ACTION?

Used when a phone number is to be dialled without the user having to explicitly initiate the call. Incorrect

compareTo method

Uses a string, a dot, and the method name. When it returns 0, the two strings are equivalent; when it returns a positive number, the first string is greater than the second; and when it returns a negative value, the first string is less than the second.

# How Sencha Touch app can handle multiple screen resolution?

Using profile

How can you define the minimum version of Android required

Using the minSdkVersion attribute in the AndroidMan

Primitive arguments are pass by ____________.

Value

# How does Android system manage activity's life cycle

Via system activity stack

51. How does Android system manage activity's life cycle

Via system activity stack

How does Android system manage activity's life cycle

Via system activity stack Correct

The Model is the middleman between the __________________ and the Controller.

View

The ________________ class is the superclass for all widgets

View

# In android the user interface is built using?

View and view group objects

The direct superclass of LinearLayout and RelativeLayout is

ViewGroup

The superclass for layout classes is __________________.

ViewGroup

Version 2 of the Google Maps Android API

uses fragments to provide more flexibility for working with different screen sizes, displays faster than version 1, and uses less bandwidth than version 1

If a broadcast receiver uses permissions, you can request those permissions by adding an element to the AndroidManifest.xml file. What's the name of that element?

uses-permission

JQuery methods for getting and setting control values

val( ) - gets the value of text box or other form control val(value) - sets the value of a text box or other form control

What String method does the Java Tutorials state is "indispensible in converting user input strings to numbers"?

valueOf()

# Android: Which attribute will be used in XML if the Java code needs a reference to View?

vandroid:id

A ScrollView widget displays a/an ________________ scroll bar.

vertical

77. Is color a new HTML5 element of input type?

yes

AS: Add new items to menu in xml

<item android:title="Settings" android:id=@+id/settings"></item>

What is the correct definition of an item inside a style (assuming that the color abc is correctly defined in colors.xml)?

<item name="android:background">@color/abc</item>

Within a <style> element, which of the following elements would set the text size of the style to 15sp?

<item name="android:textSize">15sp</item>

# Which element provides a secure way to authenticate the user?

<keygen>

# Select the correct element for defining a navigation menu for your site

<nav>

# You must declare all application components in Manifest file in this way: <activity> elements for activities A <service> elements for services <receiver> elements for broadcast receivers and:

<provider> elements for content providers

Inside styles.xml, define a style named myStyle so that paddingBottom is 10dp, and the background color is red

<style name="myStyle"> <item name="android:paddingBottom">10dp</item> <item name="android:background">#F00</item> </style>

AS: Set user permissions for fine location

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

You can call any methods of a content provider from what object?

A ContentResolver object

# Which statements are correct about Broadcast receivers?

All of above

Why cannot you run standard

Android use dalvik

12. Why cannot you run standard Java bytecode on Android?

Android uses Dalvik Virtual Machine

# Which of the following is correct with respect to Android run time engine?

Android uses Dalvik as run time engine

"Gingerbread" is nickname of

Android version 2.3.x

# "Gingerbread" is nickname of

Android version 2.3.x

To register an app widget, add a receiver element to the ________________ file.

AndroidManifest.xml

You can open the ________________ file and edit it to apply a theme to the entire application or to a specific activity.

AndroidManifest.xml

What does the .apk extension stand for?

Application Program Kit Incorrect

ORIENTATION_PORTRAIT and ORIENTATION_LANDSCAPE?

Are constants of the Configuration class

121. Which statement is NOT correct about PhoneGap?

B. It doesn't support for Java phone

107. What is NOT correct about Store in Sencha Touch?

B. Load data via a Proxy

String[] args is an array of strings storing what?

Command line arguments

If a class that implements an interface does not include function definitions for all methods declared in the interface, what kind of error will occur?

Compiler

In auto-generated code of an Android app, what is R class?

Contains IDs of the project resources

CDN

Content Delivery Network

# What are the inputs to the onReceive() method of a broadcast receiver?

Context, Intent

The Intent object is passed to this method to deliver

Context.sendBroadcast()

# The Intent object is passed to this method to launch a new activity or get an existing activity to do something new

Context.startActivity()

What does Java do when you put a primitive in a string?

Converts it to a string

# Who developed the Android 2.1 gallery?

Cooliris

AS: get data from SQLite where the name starts has a k and limit it to the first result

Cursor c = usersDB.rawQuery("SELECT * FROM users WHERE name LIKE '%k%' LIMIT 1", null);

The getDefaultDisplay method from the WindowManager interface returns a __________________ reference.

Display

30. Can you deploy executable JARs on Android?

False

Regardless of the access modifiers of the members in a parent class, a child class inherits all members.

False

True True or False? A dialog box can have only one button inside.

False

(T/F) If you don't explicitly call a superclass constructor, a superclass constructor is never invoked.

False, its auto invoked in the default constructor

Given a FILENAME constant that specifies a valid filename for a file, which statement can you use to get a stream to write data to that file?

FileOutputStream out = openFileOutput(FILENAME, Context.MODE_PRIVATE);

Use the ___________ keyword to denote a method cannot be overridden in a sub class.

Final

When coding the class for a fragment, what class do you typically extend?

Fragment

What is FrameLayout best used for?

Fragments, because it handles a single child more efficiently since there is no particular ordering, beside from gravity assignment.

34. Which of the following is layout that you can use in a window in an Android application?

FrameLayout

122. Which are location providers in android

GPS

# What was the first Android version to have turn-by-turn GPS navigation?

Gingerbread

AS: solution to Error:Execution failed for task ':app:buildInfoDebugLoader' bug

Go to Run > Click clean and rerun

# Which company bought android?

Google

You can use a/an ________________ object to open and close a connection to Google Play services.

Google Api Client

Android apps can be distributed via:

Google Play

What kind of object can you use to add one or more markers to a map?

GoogleMap

You can use a/an ________________ object to display a series of connected lines on a map.

GoogleMap

The ________________ build script controls how Anrdoid Studio builds a project.

Gradle

What is Gradle?

Gradle is a custom build tool used to build android packages (apk files) by managing dependencies and providing custom build logic.

# What is the previous version of HTML, prior to HTML5?

HTML 4.9

slideUp( )

Hide the selected elements with a sliding motion.

hide([duration])

Hide the selected elements. The duration parameter can be "slow", "fast", or a number giving the time in milliseconds. By default, the duration is 400 milliseconds, slow is 600 and fast is 200

# What version of Android never came to phones?

Honeycomb

If you want to execute a task in the background once every hour, even if the app is no longer running, you can use ______________ to start a timer that runs the task.

a service

To distribute an app directly to the user via email or web site, you must have

a signed APK file

Every broadcast has a/an ________________ string that uniquely identifies the action.

action

# The intents can communicate messages among any of the three core components of an application: Select one:

activities, services, broadcast receivers

10. The intents can communicate messages among any of the three core components of an application:

activities, services, broadcast receivers

One way to monetize a free app is to

add advertising

Android: When will onUpgrade() be invoked?

all of

Linux layer

an open-source operating system that's portable and secure. This operating system provides low-level drivers for hardware, networking, file system access, and inter-process communication (IPC).

Android: which attribute will be used in XML if the Java code needs a reference to View ?

android: id

Add a line of XML so that the TextView is centered around a vertical axis within the View containing the TextView element

android:centerHorizontal="true"

Add a line of XML so that the text displayed is centered inside the TextView element

android:gravity="center"

41. Android: Which attribute will be used in XML if the Java code needs a reference to View?

android:id

Android: Which attribute will be used in XML if the Java code needs a reference to View?

android:id

The XML attribute that we use to give an id to a View is __________________.

android:id

Margins around a GUI component

can be set using the setMargins method of the MarginLayoutParams class

You can use a device's ________________ to find a device's current location.

cell signal, GPS (Global Positioning System), and Wi-Fi signal

How to change the main color of Sencha Touch application ?

change the $base-color variable in app.scss

gravity

How your content aligns in element

To get data from Webserver to Android application, which of the following class you need to use to establish connection?

HttpURLConnection

Which kind of application when creating with Sencha Touch?

Hubrid app

# Which kind of application when creating with Sencha Touch?

Hybrid app

60. Which kind of application when creating with Sencha Touch?

Hybrid app

AS: get ID name of button clicked

Id = view.getResources().getResrouceEntryName(id);

# Which is not a Android resource?

Image

AS: Execute image downloader class to download images on specific URL

ImageDownloader task = new ImageDownloader(); Bitmap myImage; try { myImage = task.execute("https://url.com").get(); downloadImage.setImageBitmap(myImage); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); }

AS: find image1 ID > ImageView

ImageView image = (ImageView) findViewById(R.id.image1);

AS: get image view that is clicked

ImageView image = (ImageView) view;

The ____________ statement allows you to use a simple name instead of a fully qualified name of a member in a different package.

Import

# Where does web workers script run?

In background

Which are location provider in Android ?

LBS

# How many CSS files can be included in a Sencha Touch project?

Many

What are some reasons to use a Number object rather than a primitive?

Passing arguments into methods that expect objects, to access class level constants, type and number conversions

You need to process when user clicks on a notification on upper left of Android screen

PendingIntent

AS: What does AsyncTask allow us to do?

Perform actions in the background in a separate thread from the Main thread

# What is a type of notification that is not supported in android?

Permission notification

When subclasses defined their own unique behaviors yet still share some functionality with the parent class, this is called __________.

Polymorphism

If the user interface for a fragment uses Preference objects instead of View objects, the fragment needs to extend the ________________ class instead of the Fragment class.

PreferenceFragment

# ___ class exposes methods to manage a SQLite database.

SQLiteHelper

The _________________ class provides the onCreate and onUpgrade methods that are used to create and upgrade the database.

SQLiteOpenHelper

# Which are the fonts that Android naturally provide?

Sans, Serif, Monospace

# What do you mean by SVG?

Scalable vector graphics

________________ provide a way for Android to adjust the size of the text so it scales correctly for different screen densities.

Scale Independent Pixel

[attribute]

Selects All elements with the named attribute

:parent

Selects all elements that are parents of other elements, including text nodes

:first-child

Selects all elements that are the first child of their parent.

:text

Selects all elements with the type attribute set to "text"

finish([queue])

Stop the current animation for the selected element, clear the queue, and complete all animations for the selected elements.

To determine which widget an event occured on, you use the ________________ method of the View class.

getID

AS: method used to retrieve a tagged element

getTag();

For most widgets, you can use which method(s) to get and set the text that's displayed on the widget?

getText and setText

Given a SQLiteDatabase object named db and a variable named taskID that contains a valid ID for a task, what does the following code do? String where = "_id = ?"; String[] whereArgs = { Integer.toString(taskID) }; this.openReadableDB(); Cursor cursor = db.query("task", null, where, whereArgs, null, null, null);

gets a Cursor object that contains a single row from the task table that corresponds with the specified task ID

Which is not true about the moveCamera method?

it animates the move to the location

# The root element of AndroidManifest.xml is

manifest

Java: tells us number of items in hash

map.size();

Within an XML file that defines styles, a property of a style is specified by a/an ________________.

item element

A menu can contain one or more ________________ .

items

public

java code for accessible across entire application

What is the name of the Java compiler?

javac

To detect screen orientation, you can create a values directory that uses the ________________ or ________________ qualifiers.

land, port

Write one statement to register that object on a TextView object named myTextView;

myTextView.addTextChangedListener( mw );

Form element attributes and meaning

name - A name that can be referred to by client side or server side code. action - The URL of the file that will process the data in the form method - The HTTP method for submitting the form data. It can be set to either "get" or "post". The default value is "get"

# Which statement correctly changes the nameLabel TextView to Welcome To FU�s name?

nameLabel.setText("Welcome To FU")

Android doesn't always save the data of an activity when you

navigate away from an activity to another activity or app and change orientation

You can ________________ one layout within another, but it can degrade performance.

nest

. It's common to code the class for an asynchronous thread as a/an ________________ class of the activity

nested inner

You can group preferences by ________________ one or more Preference elements within a PreferenceCategory element

nesting

Which method do you typically override to handle the event that occurs when a user selects an item from the options menu?

onOptionsItemSelected

The __________________ method of the Activity class is called when another activity starts and the current activity goes in the background.

onPause

What method of the TimerTask class do we need to override and is also called automatically?

run

A service

runs in the background

A bound service

runs only as long as another component is bound to it

A theme

s a group of styles that define the look of the layout. To set the theme for the layout, select the theme from the toolbar

# Which attribute enables a set of extra restrictions on any content hosted by the <iframe>?

sandbox

:contains(text)

selects all elements that contain the specified text

:even

selects all elements with an even index within the selected set

:empty

selects all elements with no children including text nodes

[attribute=value]

selects all elements with the named attribute and value

:gt(n)

selects all elements within the selected set that have an index greater than n

:eq(n)

selects the element at index n with the selected set

Given an Intent named intent for a broadcast action, which of the following statements sends the broadcast?

sendBroadcast(intent);

Good practice for the relative layout (android)

set the id property for the widget as soon as you add it to the layout. To do that click on the widget and use the properties window to set the id property

What method of the Activity class do you use to set the view for an activity?

setContentView

In Android, which of the following statement is CORRECT to reload a layout

setContentView(R.layout.some_layout)

What method do we use to set the number of rows in a GridLayout?

setRow

When using android.app.AlertDialog.Builder class to display a

show()

Which method to display a dialoge ?

show()

# ___________ function displays the Latitude and Longitude in geoLocation in HTML5.

showPosition()

The lifecycle methods of a fragment are ________________ to the lifecycle methods of an activity.

similar

On a small screen, an activity typically only displays a single fragment. This is know as a/an

single-pane layout

Installing an app from a source other than an established Android marketplace is sometimes referred to as ________________ an app.

slide loading

27. How will you launch an Activity within your application?

startActivity(intent);

Given the following Intent object for a service, which of the following statements starts the service? Intent serviceIntent = new Intent(this, WeatherService.class);

startService(serviceIntent);

The strings.xml file contains __________________ constants.

string

# By default UI components made in the UI editor should have text defined in file?

string.xml

# By default, UI component made in the UI editor should have text defined in file ?

string.xml

# By default, UI component made in the UI editor should have text defined in file?

string.xml

Does HTML5 native support for local storage?

true

On android, a layout can contain other layout?

true

The onCheckedChange method of the RadioGroup.OnCheckedChangeListener interface has the following API: void onCheckedChanged( RadioGroup group, int a ) What does group represent?

The RadioGroup to which the radio button that was clicked belongs

AS: Add marker to Geo location > add marker title

mMap.addMarker(new MarkerOptions().position(everest).title("Mount Everest"));

AS: clear the google map

mMap.clear();

AS: Move map camera to everest

mMap.moveCamera(CameraUpdateFactory.newLatLng(everest));

AS: zoom in on everest in map

mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(everest, 1));

JQuery versions

uncompressed, compressed, slim uncompressed, slim compressed

# What is not Components of a Screen ?

Activity

# Which are location providers in android

GPS

# SQLite database save data in

Internal storage

alpha

Level of transparency

:hidden

Selects all elements that are hidden.

SDK stands for ________________.

Software Development Kit

# __________ tag is used to specify an inline frame

<iframe>

Which of the following defines a valid String element? "<strings name=""my_name"">20dp</strings>" "<string name=""my_name"">20dp</string>" "<name string=""my_name"">16dp</name>" <my_name name="string"> 16dp **Not a good Question**

"<string name=""my_name"">20dp</string>"

# Attributes consist of a name and a value separated by _______ sign

"="

How many main approaches to build GUI of Android app?

1

109. If the action is ACTION_CALL. what the data field would be?

A. URI with the number to call

# Android MapActivity is

Base class with code to manage the boring necessities of any activity that displays a MapView

Android MapActivity is

Base class with code to manage the boring necessities of any activity that displays a MapView

The BitmapFactory is a factory class to create __________________ objects.

Bitmap

# IntentFilters are typically defined via

Both of above

73. IntentFilters are typically defined via

C. Both of above

113. Android: When will onUpgrade() be invoked?

D. All of above

Non-static nested classes are called __________ classes.

Inner

dp

Measurement for pixels

If we want to handle persistent data in an app, we can use the Model View Controller ____________ architecture

Store

# Seamless is a _________ type of attribute.

boolean

What statement is NOT correct about Canvas?

none of

Why would you use Kotlin instead of Java?

"Kotlin has way, way more to offer than Java 8. Here is just a sampling (in no particular order) Null-safety <---Important Type inference String interpolation Data classes Delegation Smart casts Conditionals as expressions Sealed classes The when expression Extension functions Co-routines Kotlin conciseness helps to increase a cut in the lines of code by approximately 40 %

When coding a URI, what character can you use as a wildcard to match any number?

#

# How to apply stylesheet with HTML element by id? Select one:

#id

67. How to apply stylesheet with HTML element by id?

#id

How to apply stylesheet with HTML element by id?

#id

How to prevent default on an event called "evt"

$("#faqs a").click(function(evt)) { evt.preventDefault( ); }); // end click

JQuery selector for CSS selector #faqs h2

$("#faqs h2")

Submit form method

$("#join_list").submit( );

Change sibling text method (object chaining)

$("#last_name").next( ).text("Last name is required");

Move focus method

$("CSS selector").focus( );

JQuery method syntax

$("CSS selector").methodName(parameters)

JQuery get value method

$("CSS selector").val( );

JQuery set value method

$("CSS selector").val("value to set here");

What are the three components of Google Maps for Android?

(1) the API, (2) the base maps, and (3) the servers to serve map tiles

Use the _________ symbol to import all the types in a particular package.

*

What JQuery offers

- Dozens of selectors, methods, and event methods that make it easier to add JavaScript features to your websites - Cross browser compatibility - Selectors that are compliant with CSS3 - A compressed library that loads quickly so it doesn't degrade performance

Choose right kind of layouts supported in Sencha Touch.

- Justify Layout

Sencha Touch is

- a Java framework

16. What is an Activity?

. A single screen in an application, with supporting Java code

Write the code to output to LogCat the current orientation of the device

// MA is a String constant storing a filter value if( config.orientation == Configuration.ORIENTATION_LANDSCAPE ) Log.w( MA, "Horizontal position" ); else if( config.orientation == Configuration.ORIENTATION_PORTRAIT ) Log.w( MA, "Vertical position" ); else Log.w( MA, "Undetermined position" );

Write the code to set the view to be inflated from portrait.xml if the device is in vertical position and from landscape.xml if the device is in horizontal position. Assume that you already have a Configuration reference.

// config is the Configuration reference if( config.orientation == Configuration.ORIENTATION_LANDSCAPE ) setContentView( R.layout.activity_main_landscape ); else if( config.orientation == Configuration.ORIENTATION_PORTRAIT ) setContentView( R.layout.activity_main );

Write the code to retrieve the width of the screen

// from inside an Activity class Point size = new Point( ); getWindowManager( ).getDefaultDisplay( ).getSize( size ); int screenWidth = size.x;

Write the code to get a Configuration reference

// from inside an Activity class Resources resources = getResources(); Configuration config = resources.getConfiguration();

AS: create a JSON array

//JSON has to be setup as an array with objects and properties JSONArray arr = new JSONArray(strings);

Inside the AndroidManifest.xml file, add an activity element of the type MyActivity class and whose label is the value of the string my_app (specified in the strings.xml file)

/activity> <!-- Your code goes here --> <activity android:name=".MyActivity" android:label="@string/app_name"> </activity> </application>

# How many main approaches to build GUI of Android app?

1

How can you align elements in AS? (4)

1) center of screen 2) relative to another element 3) corners 4) margin away from the above

Steps for downloading content from the internet (3)

1- Create download content class 2- Call class in onCreate 3- Set user permissions in AndroidManifest

Java: 8 types of primitives > bit size > purpose

1- boolean(true or false) 2- char(16-bit, unicode character) 3- byte(8-bit, save mem in large array) 4- short(16-bit, save mem large array) 5- int(32-bit, number) 6- float(32-bit, use for short decimals) 7- double(64-bit, decimal number) 8- long(64-bit, for large range values)

JQuery/ CSS Selectors Types

1. Descendants - $("#faqs p") - elements that are descendants of the main element 2. Adjacent siblings - $("h2 + div") - all div elements that are adjacent siblings to h2 3. General siblings - $("ul ~ p") - all <p> elements that are siblings of ul elements 4. Children - $("div > ul") - all ul elements that are children of div elements

Android Inc founded

2003

Google buys android

2005

The Open Handset Alliance is announced, This alliance consists of a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices Google releases Android code as open source under the Apache License. The Android Open Source Project (AOSP), led by Google, is tasked with the maintenance and further development of Android.

2007

# What year was the first Google I/O held?

2008

Android Software Development Kit (SDK) 1.0 is released. This kit contains all of the tools needed to develop Android apps. The first Android phones become available

2008

New versions of the Android SDK continue to be released. Android devices continue to proliferate. Millions of apps are developed, Billions of apps are downloaded.

2009-present

The red, green, and blue values of a gray shade are all equal. Including black and white, how many shades of gray are there?

256

# How many graphic object types are allowed by SVG?

3

We have three activities in an app: MainActivity, InsertActivity, and DeleteActivity. How many activity elements should we have in the androidManifest.xml file?

3

# An activity has essentially

3 states

# What version of Android is codenamed "Jelly Bean"?

4.x

# How many ways data stored in Android?

5

JQuery selectors for form controls (JQuery form control selectors)

:input - all input, select, textarea and button elements :text - all text boxes: input elements with type = "text" :radio - all radio buttons: input elements type = "radio" :checkbox - all check boxes ... "checkbox" :file - all file upload fields: ... "file" :password - all password fields: ... "password" :submit - all submit buttons: ... "submit" :reset - all reset buttons ... :image - all image buttons ... :button - all buttons ... :disabled - all disabled elements: elements that have the disabled attribute :enabled - all enabled elements: elements that don't have the disabled attribute :checked - all checked text boxes and radio buttons that are checked :selected - all options in select elements that are selected

# Which doctype is correct for HTML5?

<!DOCTYPE html>

58. Which doctype is correct for HTML5?

<!DOCTYPE html>

Which doctype is correct for HTML5?

<!DOCTYPE html>

Inside the AndroidManifest.xml file, add an activity element of the type SecondActivity class.

<activity android:name=".SecondActivity" </activity>

# How do you declare 4 components (Activity, Service, BroadcastReceiver, ContentProvider) of android in mainfestfile?

<activity>, <service>, <receiver>, <provider>

# What is the correct HTML5 element for playing audio files?

<audio>

AS: Change the color of the navbar

<color name="colorPrimary">#0A65D9</color>

AS: Add a new color variable in res/values/color.xml

<color name="menu_background">#666666</color>

<style name="TextView"> <item name="android:textSize">20sp</item> </style> <style name="Button" parent="@style/TextView"> <item name="android:textStyle">bold</item> </style> <style name="PrimaryButton" parent="@style/Button"> <item name="android:textColor">@color/primary</item> </style> Within the res/values/colors.xml file for the project, which of the following elements defines the color for the text of the PrimaryButton style?

<color name="primary">#141315</color>

# Which of the following elements is no longer supported in HTML5?

<font>

# In HTML5, which element is used to group heading elements?

<hgroup>

What character is used to denote an annotation?

@

What is the correct definition of an item inside a style (assuming that the color abc is correctly defined in colors.xml)?

@color/abc

# What is a Sticky Intent??

A Sticky Intent is a broadcast from sendStickyBroadcast() method | A Sticky Intent allow others to collect data from its

What is a ContentProvider and what is it typically used for?

A content provider manages a shared set of app data that you can store in the file system, in a SQLite database, on the web, or on any other persistent storage location that your app can access. For example, the Android system provides a content provider that manages the user's contact information. As such, any app with the proper permissions can query the content provider, such as ContactsContract.Data, to read and write information about a particular person.

the following content about Fragment

A fragment can be displayed without be embedded in an activity.

Package

A grouping of related types providing access protection and name space management.

What onListItemClick() function used for?

A method called when an item in a list is selected.

Whats the difference between a method and a function?

A method is similar to a function, but is internal to part of a class.

What is the main method in Java?

A method that runs when Java is executed

a regular expression

A notation for defining all the valid strings of a formal language or a special text string for describing a search pattern.

What element do you add to a project's AndroidManifest.xml file to register a broadcast receiver?

A receiver element

What is this in the following code? Intent myIntent = new Intent( this, DataActivity.class );

A reference to the current Activity

Following is the API for one of the load methods of the SoundPool class:int load( Context context, int i, int priority ) What does i represent?

A resource

# What is an Activity?

A single screen in an application, with supporting Java code

What is an Activity?

A single screen in an application, with supporting Java code Correct

What is a change Gravity?

A tool that changes the linear alignment of a control so that is is aligned to the left, center, right top or bottom of an

125. You must declare all application components in Manifest file in this way:

A. <provider> elements for content providers

92. What are 2 ways a Service can run?

A. Bounded and Unbounded

93. How to show or hide a Sencha Touch component?

A. Call .show() or .hide() method of component itself

88. How to change the main color of Sencha Touch application?

A. Change the $base-color variable in app.scss

112. What are location providers in Android?

A. GPS & Network

118. What is TRUE about localStorage?

A. It is never expired

97. Which of the following is best choice for simple animations for your website?

A. JavaScript

90. Which activity class do you need to inherit to show Google map?

A. MapActivity class

104. Do we need to register all of View classes in app.js with Sencha Touch?

A. No

108. How to define a new Sencha Touch class?

A. Use Extdefine()

74. How to register a broadcast receiver?

A. Via AndroidManifestxml file

119. How to listen to an event in Sencha Touch class?

A. Write event handler within listeners:{} body

127. In class SQLiteOpenHelper class, there are 2 methods we should usually override. What are they?

A. onCreate() and onUpgrade()

82. By default UI components made in the UI editor should have text defined in file?

A. string.xml

117. What is value on component's attribute layout_widtlf and layout_heighl to display the component big enough to

A. wrap_content

Which permission is required for a broadcast receiver for the CONNECTIVITY_CHANGE action?

ACCESS_NETWORK_STATE

This broadcast is typically used to resume activities that consume power.

ACTION_BATTERY_OKAY

This broadcast is typically used to start services that should always run.

ACTION_BOOT_COMPLETED

# Which chat protocol that Android 1.0 didn't support?

AIM

When an IDE builds a project, it puts the .dex files and the rest of the files for the project in an ________________.

APK File

# What's the acronym for Android's future (post-Dalvik) runtime?

ART

animate()

AS: Method changes the style properties of an element

translationXBy() / YBy()

AS: Method paired with animate() moves element vertically or horizontally

rotation()

AS: Method rotates the element clock-wise

# Android doesn't support which format

AVI

# Android doesn't support which video format?

AVI

What is the difference between an abstract class and interface?

Abstract class can have abstract and non-abstract methods. Interface supports multiple inheritance. Interface has only static and final variables. An interface can extend another Java interface only. Members of a Java interface are always public by default.

An EditorAction event typically occurs when the user presses a/an ________________ key on a soft keyboard.

Action

# What are the four essential states of an activity?

Active, Paused, Stopped, Destroyed

What are the four states of the Android Activity lifecycle?

Active/Running Paused Stopped Destroyed

# What is fundamental building blocks / components of Android ?

Activities, Services, Broadcast Receivers, Content Providers

# Which of the following is the parent class for the main application class in an Android application that has a user interface?

Activity

7. Which of the following is the parent class for the main application class in an Android application that has a user interface?

Activity

A/An ________________ stores the code for one screen of an app.

Activity

The AppCompatActivity's direct superclass is:

Activity

Which of the following is the based class for the main application class in an Android application that has a user interface?

Activity

Which of the following is the parent class for the main

Activity

What is the difference between an activity and a fragment?

Activity - The activity serves as the entry point for a users interaction with the app. Fragment - You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a "sub activity" that you can reuse in different activities). A fragment must always be hosted in an activity and the fragment's lifecycle is directly affected by the host activity's lifecycle. To manage the fragments in your activity, you need to use FragmentManager.

Which of the following is the parent class for the main application class in an Android application that has a user interface?

Activity Correct

# Where can you define the icon for your Activity?

Activity is to be declared in the manifest file

# Which are levels user interacts with UI in Android?

Activity level and view level

fadeTo( )

Adjust the opacity of the selected elements to the opacity set by the second parameter. The duration parameter must be specified with this method

# Which dialog box can you use in you Android application?

AlertDialog

# Which dialog boxes can you use in you Android application?

AlertDialog

46. Which dialog box can you use in you Android application?

AlertDialog

By convention, names of fields in an enum should be:

All caps

What is DataActivity in the following code? Intent myIntent = new Intent( this, DataActivity.class );

An Activity Class

<?xml version="1.0" encoding="utf-8"?> <resources> <item name="activity_main" type="layout"> @layout/activity_main_threepane </item> </resources> What type of resource does this XML code define?

An alias

Why use an anonymous class?

An anonymous inner class can be useful when making an instance of an object with certain "extras" such as overloading methods of a class or interface, without having to actually subclass a class

Which version of Android introduced fragments?

Android 3.0 (API 11)

Which of these is not part of the Android stack? a. Linux b. Android SDK c. Dalvik virtual machine (VM) d. Android apps

Android SDK

AVD

Android Virtual Device

What is an Activity

Asingle screen in an application , with supporting Java

81. "Gingerbread" is nickname of

B. Android versiov2.3.x

106. How to make a TextView to be editable?

B. Either set its attribute editable ='true' or Use EditText class instead of TextView class

96. In android, normally SDCard is

B. External storage

103. Android UI is threadsafe

B. False

95. Do we need to declare all of Controller in app.js with Sencha Touch?

B. Yes

123. Which attribute will be used in XML if the Java code needs a reference to View?

B. android: id

How do you implement GCM into your app?

By implementing firebase.

Native libraries in the Android stack are written in ________________.

C or C++

83. SQLite database save data in

C. Internal storage

85. How to set layout's attribute programmatically in android?

C. Use LayoutParams class

116. Intent myIntent = new Intent(this. ActivityTwo.class);

C. myIntent is explicit Intent

# How to show or hide a Sencha Touch component?

Call .show() or .hide() method of component itself

How to show or hide a Sencha Touch component ?

Call.show() or .hide() method of component itself

The getResources method

Can be called from the Activity class because Activity inherits it from Context

# How to change the main color of Sencha Touch application?

Change the $base-color variable in app.scss

# How to check if browser supports web storage?

Check if typeof(Storage) !== "undefined"

66. How to check if browser supports web storage?

Check if typeof(Storage) !== "undefined"

How to check if browser supports web storage?

Check if typeof(Storage) !== "undefined"

Which XML element do you use to code a preference that uses a check box?

CheckBoxPreference

The ________________ event of a check box or radio button occurs when a check box or radio button is checked or unchecked

CheckChanged

String

Class (not primitive) made of chars

In the "enhanced for" loop, what operator separates the control variable from the collection/array to iterate through?

Colon example: String s : stringArray

The getConfiguration method from the Resources class returns a __________________ reference.

Configuration

# What is the dialog box that is not supported in android?

ConfirmDialog

To check if a network connection is available to the device, you can use a/an ________________ object.

ConnectivityManager

By convention, when are underscores and all caps used in variable names?

Constants

Enum types are useful when you have a fixed set of:

Constants

To reduce the number of nested views, we can use a(n) ____________ (layout)

ConstraintLayout

Can a constructor be inherited?

Constructors are not members of classes and only members are inherited. You cannot inherit a constructor

Which of the following is a content provider that's typically included with Android?

Contacts

# <canvas> element is only a ____________ to the graphics

Container

In auto-generated code of an Android app, what is R class?

Contains ID of the project resources

# In auto-generated code of an Android app, what is R class?

Contains IDs of the project resources

50. In auto-generated code of an Android app, what is R class?

Contains IDs of the project resources

75. In auto-generated code of an Android app, what is R class?

Contains IDs of the project resources

# An application component that runs in the background, not interacting with the user, for an indefinite period of time

Content Provider

# What is Content Provider?

Content Providers are the only way to share data across Android applications | Content Providers store and retrieve data thus making it accessible to all | Content Providers are a separate league of components that expose a specific sets of data to applications

Which shortcut key we can use to change orientation in an AVD simulator?

Ctrl+F11

The __________________ class encapsulates a table returned by a select SQL query.

Cursor

The return type of the method rawQuery is

Cursor

91. Which statements are correct about Broadcast receivers?

D. All of above

110. Android MapActivity is

D. Base class with code to manage the boring necessities of any activity that displays a MapView

99. Which statement is correct about web storage?

D. It is key/value data

To format floating point values to a specified number of decimal places, use the ______________ class.

DecimalFormat

102. How many main approaches to build GUI of Android app?

E. 2

130. Android: Which statement is NOT correct about Toasts?

E. None of above

126. How to set position of a Sencha Touch component?

E. Only a & b

100. How to play a video in HTML5?

E. Only a & c

# What is not true about the Android application lifecycle

Each activity of an app is run in its own process

What is not true about the Android application lifecycle

Each activity of an apps is run in its own process

Which of the following is NOT a right codename of Android version?

Eclair

We say two objects are equal if they are the same object; two objects are ___________ if they store the same information.

Equivalent

Error: java.lang.NullPointerException

Error for trying to pass a null variable or instance

What is Android testing in Espresso?

Espresso is a testing framework for Android to make it easy to write reliable user interface tests.

# In HTML5, onblur and onfocus are: Select one:

Event attributes

Why can we position elements relatively in AS?

Everything is defined in RelativeLayout. Making all elements relative to one another

A(n) _______________ is an event that occurs during the executing of a program that disrupts the normal flow of instructions.

Exception

2. Intents designate the target component by its name and they are typically used for application-internal messages.

Explicit Intents

Intents designate the target component by its name and they are typically used for application-internal messages.

Explicit Intents Correct

What is base of all Sencha Touch component?

Ext COmponent

# What is base of all Sencha Touch component?

Ext.Component

70. What is base of all Sencha Touch component?

Ext.Component

What is base of all sencha touch component ?

Ext.Component

True or False? An XML element can have only 0 or 1 attribute.

False

True or False? The Color class in the android.graphics package is the same as the Color class in the java.XYZ.

False

True or False? We can test an app on a device only in vertical orientation.

False

True or False? We can use a View element to encode a line.

False

Can you deploy executable JARs on Android?

False Correct

(T/F) Declaring a reference variable creates an object.

False. Only a reference to the object

Constants declared in an interface are implicitly public, static, and ___________.

Final

What keyword is used to declare a variable constant?

Final

The _________ block always executes when the try block exits, regardless of what happens within the try block.

Finally

Where does the package statement go in a source file?

First Line

Which of the following is layout that you can use in a window in an Android application?

FrameLayout

# What are location providers in Android?

GPS & Network

What are location providers in Android ?

GPS & Wifi

# Before its release, what device was known as the "Nexus Prime"?

Galaxy Nexus

____________ enable types (classes and interfaces) to be parameters when defining classes, interfaces, and methods.

Generics

AS: Create a new geocoder with users location

Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault());

________________, formerly known as Android Market, is a digital marketplace for Android apps that's developed and maintained by Google.

Google Play

# What is NOT correct about Store in Sencha Touch?

Handling requests

What is a coroutine?

Helps create virtual asynchronous or non-blocking threads

What keyword denotes a class is going to adhere to an interface?

Implements

# Intents do not name a target and the field for the component name is left blank

Implicit Intents

AS: set ID image to 2000 pixels left on app startup

In onCreate method image.setTranslationX(-2000f);

# Where can you define the icon for your Activity?

In the manifest xml file

# Where will you declare your activity so the system can access it?

In the manifest xml file

17. Where will you declare your activity so the system can access it?

In the manifest xml file

Where will you declare your activity so the system can access it?

In the manifest xml file Correct

IDE

Integrated Development Environment

# Object in Android holds the contents of a message that is sent between modules

Intent

# Which of following is correct declare for intent?

Intent activityIntent = new Intent(this, NewActivity.class)

AS: create code for button to switch over to another acitivity

Intent intent = new Intent(getApplicationContext(), MainActivity.class); startActivity(intent);

Which statement is correct about web storage ?

It can be accessed by serveral web page running in the same domain

# Which statement is NOT correct about PhoneGap?

It doesn't support for Java phone

# If background image is smaller than the screen, what will happen?

It will be repeated

# What is Android Beam?

It's a hardware in Android Phone

It's generally considered a best practice to store the display text for your app in a separate file. This makes it easy to make your app work in multiple _______________.

Languages

Why would you use Java instead of Kotlin?

Larger community support Better full,clean builds (but not incremental)

AS: Add new Geographical location

LatLng geonName = new LatLng(111, 111);

What are advantages to using LiveData?

LiveData follows the observer pattern and ensures your UI matches your data state. No memory leaks, because observers are bound to Lifecycle objects and clean up after themselves when their associated lifecycle is destroyed. No crashes due to stopped activities If a lifecycle becomes inactive, it receives the latest data upon becoming active again, so data is always up to date.

# What is NOT correct about Store in Sencha Touch?

Load data via a Proxy

3. For writing Android code using C/C++, you need to use__________

NDK

For writing Android code using C

NDK

For writing Android code using C/C++, you need to use__________

NDK Correct

Which of the following is not a value of Paint.Style?

NONE

ImageView

Name of images

A class defined in another class is called a ___________.

Nested Class

Members of a class include fields, methods, and __________?

Nested Classes

# Do we need to register all of View classes in app.js with Sencha Touch?

No

# Does Android support AWT and Swing?

No

23. Does Android support AWT and Swing?

No

What is NOT a new elements of input type in HTML5 ?

Non of above

Instance variables are also known as what?

Non-static Fields

# Android: Which statement does not correct about Activity?

None of above

# Android: Which statement is NOT correct about Toasts?

None of above

# What is NOT a new elements of input type in HTML5?

None of above

# What statement is NOT correct about Canvas?

None of above

52. What statement is NOT correct about Canvas?

None of above

Android: Which statement does not correct about Activity?

None of above

What is a normal permission?

Normal permissions cover areas where your app needs to access data or resources outside the app's sandbox, but where there's very little risk to the user's privacy or the operation of other apps. For example, permission to set the time zone is a normal permission.

To display or remove a notification, you can use a/an ________________ object.

NotificationManager

To display a notification on upper left of Android screen, which of the following class you need to use?

NotificationManager + Notification

All objects are descendants of what class?

Object

AS: How does InputStreamReader read data and store from a URL?

One char at a time

# The sessionStorage object stores the data for ____________

One session

# How many way to share data across Android applications

Only one way to access data via Content Provider

The ________________ is an organization devoted to advancing open standards for mobile devices.

Open Handset Alliance

# Which the following types of menu that provided by Android?

Option menu & context menu

What is contained within the Layout xml file?

Orientations and layouts that specify what the display looks

# What is contained within the Layout xml file?

Orientations and layouts that specify what the display looks like

# What is contained within the layout xml file?

Orientations and layouts that specify what the display looks like

18. What is contained within the Layout xml file?

Orientations and layouts that specify what the display looks like

32. What is contained within the Layout xml file?

Orientations and layouts that specify what the display looks like

43. What is contained within the Layout xml file?

Orientations and layouts that specify what the display looks like

What is contained within the Layout xml file?

Orientations and layouts that specify what the display looks like

Android supports ________________ images

PNG, JPG, and GIF

Omitting an access modifier on your interface declaration defaults the access level to:

Package-private

java.lang and java.io are examples of ____________.

Packages

What class defines drawing styles and colors?

Paint

In Android Studio, you can use the graphical editor to add widgets to a layout by dragging them from the ________________ onto your layout.

Pallete

The AsyncTask class provides for these generic types:

Params, Progress, Result

In Android Studio, open projects are displayed in the ________________ window.

Project

Methods included in an interface have what implicit access modifier?

Public

The setOnCheckedChangeListener method of the RadioGroup class registers a listener on this ____________.

RadioGroup

AS: Create random number

Random random = new Random(); //Generates number -1 of given (50) randomNumber = random.nextInt(51);

:visible

Selects all elements that are visible

What is object serialization?

Serialization is the conversion of an object to a series of bytes, so that the object can be easily saved to persistent storage or streamed across a communication link. The byte stream can then be deserialized - converted into a replica of the original object.

# What is a service?

Service is a background operation

# Which of the following are UI elements that you can not use in a window in an Android application?

SliderBar

# What is database for android?

Sqlite

We want to be able to compare the starting coordinate of a touch with the ending coordinate of a touch. How can we do it?

Store the starting coordinate in an instance variable and compare it to the ending coordinate of the touch inside the onTouch method.

Which of the following Java data types does SQLite support?

String

Java: convert string into a substring for any indexes

String river = "Mississippi"; String riverPart = river.subString(2, 5);

AS: parse double ID'd euroAmount as 2 decimal string

String.format("%.2f", euroAmount)

What is AIDL?

The Android Interface Definition Language (AIDL).

# What does the time often denote in Android product shots?

The Android version number

Why is the main thread sometimes called the UI thread?

The Main thread, that is responsible for handling the UI events like Draw, Listen and receive the UI events. Ans also it is responsible for interact with running components of the UI toolkit for the corresponding application that belongs to.

# What is NotificationManager class?

The NotificationManager class is used to display notifications on the device's status bar

45. What is NotificationManager class?

The NotificationManager class is used to display notifications on the device's status bar

The menu whose code is automatically generated when using a Basic Activity template is placed in

The action bar

Where do images get stored in Android Studio?

The drawable folder

What attributes do you use to set the names and values of the items on an XML element for a list box preference?

The entries attribute and the entryValues attribute

Difference between Javascript onload vs JQuery ready( )

The event handler for the ready event will run any methods that it contains as soon as the DOM is ready, even if the browser is loading images and other content for the page. This works better than the JavaScript onload event, which doesn't occur until all of the content for the page is loaded

ready(handler)

The event handler runs when the DOM is ready

hover(handlerIn, handlerOut)

The first event handler runs when the mouse pointer moves into an element. The second element runs when the mouse pointer moves out

mouseenter(handler)

The handler runs when the mouse pointer enters the selected element

mouseover(handler)

The handler runs when the mouse pointer moves over the selected element

In Android, what is contained within the XML files in layout folder?

The layouts and direction of screen of the app

If you have a BroadcastReceiver defined, the method onReceive will run on which thread?

The main/ui thread. Always.

the following content

The method is addProximityAlert() is used for monitoring a location

Where do you input the function name of a button that responds when clicked?

The onClick property section

A/an ________________is a group of styles that define the look of the layout.

Theme

Android apps layer

These apps include pre-installed apps such as the apps that you can use to manage the Home screen, manage your contacts, make and receive calls, browse the web, and so on. In addition, you can download and install other apps. These types of apps are written in Java

Native libraries layer

These libraries are written in C or C++. They include the Dalvik virtual machine (VM), which works similarly to the Java virtual machine (JVM). However, the Dalvik VM was designed specifically for mobile devices and their inherent limitations, such as battery life and processing power.

Whats the difference between a unit test and functional test?

They all refer to the same thing. Functional testing is defined as the testing of complete functionality of some application. ... You might use a unit test to test an individual function and an integration test to check that two parts of the play nice. Functional tests are on a whole another level.

To create a thread that executes tasks after a specified delay or at a specified interval, use the ________________ class

Timer and TimerTask

How do you communicate between fragments and activities?

To allow a Fragment to communicate up to its Activity, you can define an interface in the Fragment class and implement it within the Activity.

AS: make toast for MainActivity > message "Toast Worked"

Toast.makeText(MainActivity.this, "Toast Worked", Toast.LENGTH_LONG).show();

Which of the following statements displays a message on the user interface that says, "Hello"?

Toast.makeText(this, "Hello", Toast.LENGTH_SHORT).show();

Android: Which statement is not correct about Toasts ?

Toasts are perfect for informing your users of event without forcing them

When a user touches a widget on a touchscreen device, a/an ________________ event occurs on the widget.

Touch

You can use Android to develop apps for ________________ mobile devices such as smartphones and tablet computers.

Touchscreen

# Android AsyncTask create new thread in background

True

True or False? Button is a subclass of TextView.

True

True or False? If we want to code the View programmatically and separate the View from the Controller, then we should have an instance variable representing the View inside the Controller so that we can call the methods of the View in order to update it.

True

True or False? In the following statement, c is a Canvas reference, b is a bitmap reference, r is a Rect reference, and p is a Paint reference. c.drawBitmap( b, null, r, p );The bitmap will be drawn in its entirety.

True

True or False? It is possible to filter the output inside Logcat.

True

True or False? It is possible to move a line drawn on the screen by moving your finger on the screen.

True

True or False? It is possible to pass data from one activity to another.

True

True or False? It is possible to preview a GUI XML file inside the environment without running the app.

True

True or False? The drawLine method of the Canvas class has this API: void drawLine( float a, float b, float c, float d, Paint paint ). In this API, ( a, b ) represents the coordinate of the starting point of the line and ( c, d )represents the coordinate of the ending point of the line.

True

True or False? The parameter of onConfigurationChanged allows us to retrieve the orientation of the device.

True

True or False? The setColor method of the Paint class takes an int parameter; when calling this method, it is possible to pass a hexadecimal number as its argument.

True

True or False? We can enable the user to move a TextView.

True

True or False? We can use the following method of the Toast class to create a Toast: static Toast makeText( Context context, CharSequence text, int d )

True

True or False? We want to code a View, but we do not know how many radio buttons are in the View because we are retrieving the data from a database. We should code that View programmatically, not using an XML file.

True

True or False? When we call the getSize method of the Display class, its Point parameter gets written too.

True

True or False? When we retrieve and modify the ViewGroup.MarginLayoutParams of a View, for example by calling the setMargins method, we actually modify the layout parameters of that View.

True

True or false? 3 is a prime number.

True

When you have two or more activities with the same INTENT FILTER action name, the Android OS will display a

True

(T/F) instanceof is an operator, not a method

True, compares an object to a specified type

Enclose code that might throw an exception with a ________ block.

Try

What are classes in Java?

Type of object definition

Inputs to type parameters (i.e. generics) are ___________.

Types

By default, an Android app uses a single thread, called the ________________, to display the user interface. Any task that can slow or stop the responsiveness of this should be run in a separate thread.

UI Thread

# How can you specify default text in an input field?

Using the 'placeholder' attribute

What is the permission you need to declare in AndroidManifes

WRITE_EXTERNAL_STORAGE

Given an Application object named WeatherApp, which of the following gets the Application object?

WeatherApp app = (WeatherApp) getApplication();

A/an ________________ widget uses a built-in browser to display web content.

WebView

What is the support library? Why was it introduced?

When developing apps that support multiple API versions, you may want a standard way to provide newer features on earlier versions of Android or gracefully fall back to equivalent functionality. Rather than building code to handle earlier versions of the platform, you can leverage these libraries to provide that compatibility layer.

What does the IDE do when it builds a project?

When the IDE builds a project, it compiles the Java source code (.java files) into Java bytecodes (.class files) and then into Dalvik executable files (.dex files).

get vs post method

When the get method is used to submit a form the URL that requests the file is followed by a question mark and name/value pairs that are separated by ampersands. These pairs contain the name attributes and values of the data that is submitted. When you use the post method, the data is hidden.

What are custom views?

When you need a completely custom layout and ConstraintLayout/LinearLayout/etc. aren't good for the app.

# How to listen to an event in Sencha Touch class?

Write event handler within listeners:{} body

# Graphics defined by SVG is in which format?

XML

61. Graphics defined by SVG is in which format?

XML

Does CSS support to detecting device size and orientation ?

YES

# Android: Do we need API key for displaying Google Maps in Android?

Yes

# Android: Is the main thread called the UI thread?

Yes

# Can broadcasts be received by receivers in an external process?

Yes

# Do we need to declare all of Controller in app.js with Sencha Touch?

Yes

Android: Is the main thread called the UI thread?

Yes

Do JQuery functions work in all browsers? cross function compatibility

Yes

Do we need to register all of View classes in app.js with Sencha Touch

Yes

Does HTML5 native support for local storage ?

Yes

If you use include in layouts, can you override properties? Can every property be overridden?

Yes If the <include> tag does not include both layout_width and layout_height

Given the following code AsyncHttpClient asynClient = new AsyncHttpClient()

Yes, if it is not yet completed (success or failed)

When you execute javac <name>, do you include the extension of the <name>, .java?

Yes, javac File.java then, java File

Android tries hard to _____low-level components, such as the software stack, with interfaces so that vendor-specific code can be managed easily

absract

The intent can communicate messages among

activities , services , broadcast receiver

What typically occupies a single cell on the Home screen and provides a way for users to start an app?

app icons

Any major release of Android a. is named after something sweet. b. corresponds with an Application Programming Interface (API) number. c. both a and b. d. none of the above.

both a and b

To allow other apps to query your database, you can override the ________________ methods of the ContentProvider class.

both a and b

A/an ________________ intent specifies a component such as an activity, and can be used to pass data from one activity to another.

explicit

Intents do not name a target

explicit inten

Can you deploy excu

false

IME

input method editor

A/an ________________ is a user control such as a soft keyboard that enables users to input data, often text.

input method editor (IME)

The Android Debug Bridge (ADB)

lets your IDE communicate with an emulator or a physical Android device.

On a large screen, an activity can display multiple fragments. This is know as a/an ________________ layout.

multi-pane

The TabManager class

must have its library added to your project before you can use it.

# Intent myIntent = new Intent(this. ActivityTwo.class); myIntentputExtra("Value1". "This value one for ActivityTwo "); myIntentputExtra("Value2". "This value two ActivityTwo"); Which of following is true?

myIntent is explicit Intent

When an activity is started, Android runs what method?

onCreate

An activity can include a/an ________________ that includes one or more ________________

options menu, menu items

The name of the instance variable of the Configuration class that stores the value of the device orientation is

orientation

A member with no access modifier is visible only within its own ___________.

package

Java: create class called "HelloWorld" > print "Hello World!"

public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } }

Write the class header of the MyDBManager class; inside that class, we intend to create a database and perform sql operations.

public class MyDBManager extends SQLiteOpenHelper

Which of the following creates an Application object named WeatherApp?

public class WeatherApp extends Application {}

What directory is used to store the XML for a menu?

res\menu

# Which method to display a dialog?

show()

To work with the Java code for an app, use ...

the Project window to expand the java directory, expand the package that contains the code, and double-click on the file.

In Android, an activity stores ...

the code for a screen of an app.

Can PhoneGap framework support for playing audio?

true

# Android: What is value on component's attribute "layout_width" and "layout_height" to display the component big enough to enclose its content only?

wrap_content

# What is value on component's attribute layout_widtlf and layout_heighl to display the component big enough to enclose its content only?

wrap_content

40. Android: What is value on component's attribute "layout_width" and "layout_height" to display the component big enough to enclose its content only?

wrap_content

Android: What is value on component's attribute "layout_height" to display the component big enough to enclose its content only ?

wrap_content

To test the database class, you can

write code that creates an instance of the database class and uses its public methods, display data on the user interface, display the data in the LogCat view (all of the above)

How to listen to an event in Sencha Touch class ?

write event handler within listeners:{} body

How to get the form data in sencha touch?

x-type.getValues()

Graphics defined by SVG is in which format?

xml

72. Android: Do we need API key for displaying Google Maps in Android?

yes

Is a class definition required for every Java application?

yes

Is color a new HTML5 element of input type?

yes

If the Hardware Keyboard option is not enabled for an emulator

you can use the soft keyboard to enter text

Android

• Android is a Linux-based operating system designed primarily lor touchscreen mobile devices such as smartphones and tablet computers. • Since the code lor Android is open-source, it can be customized to work with other types of electronic devices (readers, cameras, home appliances, vehicle systems)


Related study sets

ECO 2023 Exam 2 Review (Mod 5-7)

View Set

98-366 - Unit 4: Understanding Internet Protocol 1

View Set

Parenteral Nutrition Nclex review

View Set

LIFE 120 Chapter 10: Meiosis and Sexual Life Cycles

View Set

Function and Assessment of Problem Behavior

View Set

Biol 1107 exam 2 combination of other ppl

View Set