CS 4405 Mobile Applications

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

This layout code will change the font of the entry field: <TextView android:text="monospace:" android:layout_marginRight="4px" android:textSize="20sp" /> Select one: True False

False

Each platform defines its own visual style through color themes, icon styles, metaphors, and widget rendering. The use of a platform visual theme is more than an aesthetic choice. Platform themes establish user expectations that user interactions in the application will follow platform conventions. Select one: True False

True

Many popular mobile devices use touch and gestural input. Select one: True False

True

On phones, constrained screen sizes, coupled with large interaction targets, result in fewer controls per panel. Fingers and hands also obscure much more of the screen on a UI than a mouse pointer icon. Select one: True False

True

True or False: In Android, the Spinner is the equivalent of the drop-down selector. Select one: True False

True

True or False: Intents are ways of specifying something you want accomplished, then telling Android to go find something to accomplish it. Frequently, these are used to cause activities to spawn. For example, whenever you launch an application from the main Android application launcher, the launcher creates an Intent and has Android open up the activity associated with that Intent. Select one: True False

True

Given the Learning Activity 3.5 code, which line defines the SecretNum variable as an integer number? Select one: a. int SecretNum; b. integer SecretNum; c. SecretNum = 0; d. SecretNum == YourNumber

a.

Given the Learning Activity 3.5 code, which line prompts the user to enter a numerical value? Select one: a. YourNumber = input.nextInt(); b. import java.util.Scanner; c. Scanner input = new Scanner(System.in); d. SecretNum = (int) (Math.random()*1000);

a.

In addition to height and width, what is the third metric when dealing with mobile images or screens? Select one: a. pixel ratio b. coloring c. contrast d. optimization

a.

In the code from Question 9, which method is invoked when the activity is started? Select one: a. super.onCreate(icicle); b. btn.setOnClickListener(this); c. public void onCreate(Bundle icicle) d. public class Now extends Activity implements View.OnClickListener

a.

The building blocks of the Android user interface are: Select one: a. Activities b. Content Providers c. Services d. Intents

a.

The simplest Android Widget is a label. What is its name in the layout file? Select one: a. TextView b. android-label c. label.xml d. LabelView

a.

What allows you to package data files with your application, for things that do not change, such as icons or help files? Select one: a. Storage b. Network c. Multimedia d. GPS

a.

What is Learnability? Select one: a. An interface should be easy to use from the first time the user interacts with it b. Number of steps it takes for a user to complete a task c. Interface should be easier to use each time the user interacts with it d. User should never be allowed to make a mistake

a.

What is the Widget created by this code in the layout file? <?xml version="1.0" encoding="utf-8"?> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/icon" android:layout_width="fill_parent" android:layout_height="fill_parent" android:adjustViewBounds="true" android:src="@drawable/molecule" /> Select one: a. image b. android:id c. ViewBounds d. drawable/molecule

a.

What type of programming does Java implement? Select one: a. object oriented b. procedural c. no-SQL d. relational

a.

Which XML element of the Android manifest indicates security access your application will need to be allowed to function properly? Select one: a. uses-permission b. instrumentation c. uses-sdk d. application

a.

Which characteristic of mobile devices makes them challenging as web page clients? Select one: a. hardware characteristics b. users c. Services d. Intents

a.

Which element should you use in addition to TabHost and TabWidget in order to create a tabbed portion of a view? Select one: a. FrameLayout b. android:id c. ViewBounds d. drawable/molecule

a.

Which method shows words on a screen? Select one: a. System.out.println(); b. printnow(); c. screen(); d. GPS();

a.

While file in the root contents of an Android project describes the application being build (components, activities, services)? Select one: a. AndroidManifest.xml b. build.xml c. layout/main.xml d. assets/

a.

What mobile platforms are most common today? Select one or more: a. iOS b. SQL Server c. MySQL d. Android

a. d.

A level of abstraction for any data stored on the device that is accessible by multiple applications: Select one: a. Activities b. Content Providers c. Services d. Intents

b.

Given the Learning Activity 3.5 code, which line generates a number between 1 - 1000? Select one: a. import java.util.Scanner; b. SecretNum = (int) (Math.random()*1000); c. Scanner input = new Scanner(System.in); d. YourNumber = input.nextInt();

b.

Given the Learning Activity 3.5 code, which line makes external code available to our program? Select one: a. getCode(); b. import java.util.Scanner; c. if d. input.nextInt();

b.

If you need a user to type in a date, what Widget should you use? It will allow the user to select a date, which means you don't have to validate or explain the format like day/month/year or month/day/year, or four digit year 2013 or two digit year 13. Select one: a. TimePickerDialog b. DatePicker c. DatePicketDialog d. Chrono

b.

The keyboard in an Android app can be modified as needed. There are six basic configurations for the keyboard through the ndroid:inputType attribute. Which one is missing from this list? number phone datetime date time Select one: a. email b. text c. address d. calculation

b.

The primitive types in Java are byte, short, int, long, float, double, char, boolean. Which one can be used to represent a word like "Hello"? Select one: a. char b. none, the String object should be used c. double d. long

b.

What API (application programming interface) is available on most mobile devices? Select one: a. development and connection b. orientation and geolocation c. device restart d. linear-gradient

b.

What Java code can be used on the checkbox Widget? <?xml version="1.0" encoding="utf-8"?> <CheckBox xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/check" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="This checkbox is: unchecked" /> Select one: a. getCheckMark() b. isChecked() c. setCheckMark() d. getMark()

b.

What is Efficiency? Select one: a. An interface should be easy to use from the first time the user interacts with it b. Number of steps it takes for a user to complete a task c. Interface should be easier to use each time the user interacts with it d. User should never be allowed to make a mistake

b.

What is a basic unit of a Java program or an object? Select one: a. method b. class c. property d. public

b.

What is a valid property of a label widget? Select one: a. TextView b. android:typeface c. layout/main.xml d. LabelView

b.

What provides Internet access at any level you wish, from raw Java sockets all the way up to a built-in WebKit-based Web browser widget? Select one: a. Storage b. Network c. Multimedia d. GPS

b.

Which HTML meta tag is used to control layout on mobile devices? Select one: a. table b. viewport c. span d. element

b.

Which XML element of the Android manifest indicates the code that should be invoked on key system events? Select one: a. uses-permission b. instrumentation c. uses-sdk d. application

b.

Which element on a mobile platform is the key to web based apps? Select one: a. Settings app b. Web browser app c. Volume adjustment d. Google Maps

b.

Which files is an Ant script for compiling the application and installing on the device? Select one: a. AndroidManifest.xml b. build.xml c. layout/main.xml d. assets/

b.

Which mobile application element is not found on desktop computers? Select one: a. Textboxes b. Locality c. Volume adjustment d. Buttons

b.

Which technology holds great promise for web based mobile apps? Select one: a. WHATWG b. HTML5 c. MySQL d. W3C

b.

Will this if statement work? if (SecretNum = YourNumber ) Select one: a. Yes b. No

b.

What languages are used to develop native mobile apps? Select one or more: a. Cobol b. Java c. Objective-C d. Android

b. c.

What languages are used to develop web based mobile apps? Select one or more: a. C++ b. HTML c. JavaScript d. Objective-C

b. c.

If the name of the Java class is: class MyProgram What should be the name of the Java file? Select one: a. MyProgram b. myProgram.java c. MyProgram.java d. program

c

Given the Learning Activity 3.5 code, which line assigns a value to a variable? Select one: a. Int myNumber = 5; b. myNumber = 5; c. SecretNum = 0; d. 5 = myNumber;

c.

Given the following code in the layout file, where will the text be displayed in the Android app? <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="You were expecting something profound?" /> Select one: a. bottom left b. bottom right c. top left d. top right

c.

If a method does not return any value, what type would it take? Select one: a. Integer b. String c. void d. Intents

c.

Process intended to run independent of an Activity to check for updates or to play music even if the operating Activity is no longer active: Select one: a. Activities b. Content Providers c. Services d. Intents

c.

Since most mobile devices support the Touch event, what CSS pseudo class cannot be used on link objects? Select one: a. CSS :visited b. CSS :link c. CSS :hover d. CSS :touch

c.

The SlidingDrawer should contain two things: 1. A handle, frequently an ImageView and the second: Select one: a. large label b. a drop down list c. The contents of the drawer itself, usually some sort of container d. checkbox

c.

The following code creates an app which does what? Layout file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/dateAndTime" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <Button android:id="@+id/dateBtn" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Set the Date" /> <Button android:id="@+id/timeBtn" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Set the Time" /> </LinearLayout> Java code: public class ChronoDemo extends Activity { DateFormat fmtDateAndTime=DateFormat.getDateTimeInstance(); TextView dateAndTimeLabel; Calendar dateAndTime=Calendar.getInstance(); DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() { } }; TimePickerDialog.OnTimeSetListener t=new TimePickerDialog.OnTimeSetListener() { } }; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); Button btn=(Button)findViewById(R.id.dateBtn); btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { new DatePickerDialog(ChronoDemo.this, d, public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { dateAndTime.set(Calendar.YEAR, year); dateAndTime.set(Calendar.MONTH, monthOfYear); dateAndTime.set(Calendar.DAY_OF_MONTH, dayOfMonth); updateLabel(); public void onTimeSet(TimePicker view, int hourOfDay, int minute) { dateAndTime.set(Calendar.HOUR_OF_DAY, hourOfDay); dateAndTime.set(Calendar.MINUTE, minute); updateLabel(); } }); dateAndTime.get(Calendar.YEAR), dateAndTime.get(Calendar.MONTH), dateAndTime.get(Calendar.DAY_OF_MONTH)).show(); btn=(Button)findViewById(R.id.timeBtn); btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { new TimePickerDialog(ChronoDemo.this, t, } }); dateAndTime.get(Calendar.HOUR_OF_DAY), dateAndTime.get(Calendar.MINUTE), true).show(); dateAndTimeLabel=(TextView)findViewById(R.id.dateAndTime); updateLabel(); } private void updateLabel() { dateAndTimeLabel.setText(fmtDateAndTime .format(dateAndTime.getTime())); } } Select one: a. app displays two buttons, where users can type in date and time b. app takes current date and time and stores in two buttons c. app displays two buttons to set date and time, then presents a dialog based on dates and time for user to select the numbers. d. app displays date and time

c.

The following code creates the EditText Widget. What does this Widget look like in comparison to labels, images, or buttons? <?xml version="1.0" encoding="utf-8"?> <EditText xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/field" android:layout_width="fill_parent" android:layout_height="fill_parent" android:singleLine="false" /> Select one: a. large label b. a drop down list c. field to type something in d. checkbox

c.

To create an integer variable and assign a value, you would use: Select one: a. Int myNumber = 5; b. myNumber = 5; c. int myNumber; myNumber = 5; d. 5 = myNumber;

c.

What Android feature allows the user to play back music, take pictures with the camera, or use the microphone for audio note-taking? Select one: a. Storage b. Network c. Multimedia d. GPS

c.

What is Memorability? Select one: a. An interface should be easy to use from the first time the user interacts with it b. Number of steps it takes for a user to complete a task c. Interface should be easier to use each time the user interacts with it d. User should never be allowed to make a mistake

c.

What is Simplicity? Select one: a. An interface should be easy to use from the first time the user interacts with it b. Number of steps it takes for a user to complete a task c. Usual tasks should be easy and less common tasks should be possible d. User should never be allowed to make a mistake

c.

When developing Mobile Web pages for many devices, what is a good practice? Select one: a. rapid development b. testing on desktop browsers c. cross-browser development d. use of Flash

c.

Which XML element of the Android manifest indicates the version required for your application? Select one: a. uses-permission b. instrumentation c. uses-sdk d. application

c.

Which file contains GUI layout information like a list of buttons, text boxes? Select one: a. AndroidManifest.xml b. build.xml c. res/layout/main.xml d. assets/

c.

How many lines will this code display? System.print("Hello "); System.print("World"); Select one: a. 4 b. 3 c. 2 d. 1

d

Consider the following Java code, then answer: Which line is the activity? package com.commonsware.android.skeleton; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import java.util.Date; public class Now extends Activity implements View.OnClickListener { Button btn; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); btn=new Button(this); btn.setOnClickListener(this); updateTime(); setContentView(btn); } public void onClick(View view) { updateTime(); } private void updateTime() { btn.setText(new Date().toString()); } } Select one: a. super.onCreate(icicle); b. btn.setOnClickListener(this); c. public void onCreate(Bundle icicle) d. public class Now extends Activity implements View.OnClickListener

d.

Consider the following Java code: class Student { private String firstName; private String lastName; public Student(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } // Your code goes here } public class Main { public static void main(String[] args) { Student[] students = new Student[] { new Student("Morgan", "Freeman"), new Student("Brad", "Pitt"), new Student("Kevin", "Spacey"), }; for (Student s : students) { s.printFullName(); } } } What do we call printFullName() ? Select one: a. function b. static c. display feature d. method

d.

Given the code in the Java file and later in the layout file, what is the Widget being programmed and what is the event? public void someMethod(View theButton) { // do something useful here } <Button android:onClick="someMethod" ... /> Select one: a. Button, someMethod b. theButton, click c. someMethod, onClick d. Button, onClick

d.

Given the following code of the app, what is the app doing? Layout file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/selection" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <AutoCompleteTextView android:id="@+id/edit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:completionThreshold="3"/> </LinearLayout> The corresponding Java code is: public class AutoCompleteDemo extends Activity implements TextWatcher { TextView selection; AutoCompleteTextView edit; String[] items={"lorem", "ipsum", "dolor", "sit", "amet", "consectetuer", "adipiscing", "elit", "morbi", "vel", "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam", "vel", "erat", "placerat", "ante", "porttitor", "sodales", "pellentesque", "augue", "purus"}; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); selection=(TextView)findViewById(R.id.selection); edit=(AutoCompleteTextView)findViewById(R.id.edit); edit.addTextChangedListener(this); edit.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, items)); } public void onTextChanged(CharSequence s, int start, int before, int count) { selection.setText(edit.getText()); } public void beforeTextChanged(CharSequence s, int start, int count, int after) { // needed for interface, but not used } public void afterTextChanged(Editable s) { // needed for interface, but not used } } Select one: a. This application has an error and it will not run. b. As the user types, matches are shown in a selection list that, like with Spinner, folds down from the field. The user can type in the suggested word. c. As the user types, the text is comparing the entered text as a prefix against a list of previous entries. This is a spelling wizard. d. As the user types, the text is treated as a prefix filter, comparing the entered text as a prefix against a list of candidates. Matches are shown in a selection list that, like with Spinner, folds down from the field. The user can either type out an entry (e.g., something not in the list) or choose an entry from the list to be the value of the field.

d.

How many equal signs "=" are needed to compare values ? Select one: a. -1 b. 0 c. 1 d. 2

d.

Java expects the start of the program to be in which method? Select one: a. private Main {} b. private my Start(String[] args) c. public void start() d. public static void main(String[] args)

d.

Note, that you can declare a variable and initialize it in one statement: int SecretNum = 0; What will display if you execute immediately after this line? System.out.print(SecretNum); Select one: a. 3 b. 2 c. 1 d. 0

d.

System messages, running around the inside of the device, notifying applications of various events: Select one: a. Activities b. Content Providers c. Services d. Intents

d.

To assign a value, Java uses a single "=" sign, as in x=5. What symbol is used to compare variables or values in an if statement? Select one: a. .= b. =. c. ++ d. ==

d.

What Android feature can tell your applications where the device is on the face of the Earth and display maps or otherwise take advantage of the location data, such as tracking a device's movements if the device has been stolen? Select one: a. Storage b. Network c. Multimedia d. GPS

d.

What Android features allows your application to initiate calls, send and receive SMS messages? Select one: a. Storage b. Network c. Multimedia d. Phone services

d.

What Widgets are being created in this app: Layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/selection" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawSelectorOnTop="true" /> </LinearLayout> Java code: public class SpinnerDemo extends Activity implements AdapterView.OnItemSelectedListener { TextView selection; String[] items={"lorem", "ipsum", "dolor", "sit", "amet", "consectetuer", "adipiscing", "elit", "morbi", "vel", "ligula", "vitae", "arcu", "aliquet", "mollis", "etiam", "vel", "erat", "placerat", "ante", "porttitor", "sodales", "pellentesque", "augue", "purus"}; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); selection=(TextView)findViewById(R.id.selection); Which line is the activity? Select one: a. TextLabel, icicle b. Label, List c. List, Entry field d. Spinner, Label

d.

What does this app do? Layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <WebView android:id="@+id/webkit" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> The Java code: package com.commonsware.android.browser1; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class BrowserDemo1 extends Activity { WebView browser; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); browser=(WebView)findViewById(R.id.webkit); browser.loadUrl("http://commonsware.com"); } } Which line is the activity? Select one: a. Loads RSS feed b. Displays SDK c. Downloads services d. Shows the commonsware.com website

d.

What is Error Recovery? Select one: a. An interface should be easy to use from the first time the user interacts with it b. Number of steps it takes for a user to complete a task c. Interface should be easier to use each time the user interacts with it d. User should never be allowed to make a mistake

d.

What is Mapping? Select one: a. An interface should be easy to use from the first time the user interacts with it b. Number of steps it takes for a user to complete a task c. Interface should be easier to use each time the user interacts with it d. What the user expects to happen when they interact with the interface is exactly what should happen

d.

What is the name for the practice of detecting the type of the device, which is downloading your pages? Select one: a. spying b. declaring c. Multimedia d. user agent sniffing

d.

What is the property sent from the device browser to the server, along with the web page request, which tells us what type of device is used? Select one: a. http header b. http-version c. device-type d. user-agent

d.

What is the web browser used on iOS mobile devices? Select one: a. Web Toolkit b. Chrome c. Internet Explorer d. Safari

d.

What programming development language and environment is used to develop Android apps? Select one: a. C++ with Visual Studio b. Objective-C with XCode c. Cobol with Borland IDE d. Java with Eclipse

d.

When using the keyword private before a variable or a method, it means only the class itself can access the variable or method. What designation would allow access to the variable or the method from any part of the Java program? Select one: a. void b. Integer c. everyone d. public

d.

Which Widget can be used to create a time clock showing hours and minutes? Select one: a. clock_do b. android:clock c. getTime d. AnalogClock

d.

Which XML element of the Android manifest indicates the guts of the application that the manifest describes? Select one: a. uses-permission b. instrumentation c. uses-sdk d. application

d.

Which directory holds static files you wish to package with the application? Select one: a. AndroidManifest.xml b. build.xml c. layout/main.xml d. assets/

d.

Which modifier allows us to validate an email address in a TextView? Select one: a. android:inputType="number|numberSigned|numberDecimal" b. android:inputType="text|EmailAddress" c. android:inputType="text|textMultiLine|textAutoCorrect" android:minLines="3" android:gravity="top" d. android:inputType="text|textEmailAddress"

d.

Why should specific size images be loaded on appropriate mobile devices, instead of the same large image downloaded to the device and then resized by the browser? Select one: a. Activities b. image ratio c. copyright d. low or expensive bandwidth

d.


Set pelajaran terkait

Physics 101 Ch. 12 Electrostatics

View Set

Unit 11 Hypothesis Tests Two Populations Quiz 2

View Set

Chapter 6 - Land Use Regulations

View Set

Assignment Zero - Introduction to WileyPlus

View Set

Module 6 - Mechanical Material Handling

View Set

Chapter 20: Exposure and Technique Errors

View Set

Domestic and Intl. Banking Chp. 4

View Set