Midterm Prep - CIST2381-Mobile Application Development
How many apps can be run concurrently on Windows Phone 7? A) 1 B) 2 C) 3 D) More than 3
A) 1
Which of the following is NOT the best example of encapsulation? A) A main function doing error-checking before setting a Rectangle's instance variables' values. B) A Rectangle having two instance variables: width and length. C) A Rectangle object displaying its own data onscreen. D) A Rectangle object setting its height value.
A) A main function doing error-checking before setting a Rectangle's instance variables' values.
Which of the following is an advantage of Android Studio over App Inventor? A) Android Studio allows you to develop more sophisticated Android Apps. B) Android Studio can be used by nonprogrammers. C) Android Studio allows you to develop for iOS in addition to Android. D) Android Studio is more intuitive to use.
A) Android Studio allows you to develop more sophisticated Android Apps.
Which of the following is NOT an Android life cycle event? A) Application_Closing() B) onStart() C) onCreate() D) onPause()
A) Application_Closing()
To add a string literal block to an app, on which tab do you find the
A) Built-in
To add a string literal block to an app, on which tab do you find the Text block? A) Built-in B) My Blocks C) Advanced D) Components
A) Built-in
Which language is NOT supported for development on Windows Phone 7? A) C B) Javascript C) C# D) Visual Basic
A) C
What is the correct order to start the emulator in the Blocks Editor window? A) Click 'New emulator', slide the green lock icon right to unlock, click 'Connect to Device', and select the emulator to start your app. B) Click 'Connect to Device', click 'New emulator', slide the green lock icon right to unlock, and select the emulator to start your app. C) Click 'New emulator', click 'Connect to Device', slide the green lock icon right to unlock, and select the emulator to start your app. D) Click 'Connect to Device', slide the green lock icon right to unlock, click 'New emulator', and select the emulator to start your app.
A) Click 'New emulator', slide the green lock icon right to unlock, click 'Connect to Device', and select the emulator to start your app..
In iOS, apps sit on top of which layer? A) Cocoa Touch B) Media C) Core services D) Core OS
A) Cocoa Touch
Which of the following is NOT created and loaded by UIApplicationMain() in the iOS app life cycle? A) Cocoa Touch B) Application object C) Application delegate D) User Interface
A) Cocoa Touch
What term is used to identify when an object hands off some functionality to another object? A) Delegate B) Client C) Slave D) Minion
A) Delegate
What are the more commonly used names for accessor methods? A) Getters and setters B) Makers and takers C) Pushers and pullers D) Givers and takers
A) Getters and setters
What happens to the grayed-out, temporary text displayed in a text box when a user begins to enter information?
A) It disappears.
Which of the following is NOT among the frameworks included in the Cocoa Touch layer? A) Location services B) User interface components C) Map kit D) Messaging kit
A) Location services
The Java programming language is considered what type of language? A) Object-oriented (OO) B) Scripting C) Event-driven D) Procedural
A) Object-oriented (OO)
Given the UML class diagram seen in the accompanying figure, what is the class's name? A) Rectangle B) double C) getArea D) Unknown
A) Rectangle
Which of the following is NOT an option for packaging an app?
A) Submit to Android Market
Which of the following is NOT an option for packaging an app? A) Submit to Android Market B) Show Barcode C) Download to this Computer D) Download to Connected Phone
A) Submit to Android Market
A child class can inherit the methods from its parent class (or super class) A) True B) False
A) True
All software of the Android architecture is free. A) True B) False
A) True
An app like Where's My Phone?, which waits for text messages and responds with the GPS location, is best suited to an Android Service. A) True B) False
A) True
Android Studio allows the user to choose the Android version(s) the app supports. A) True B) False
A) True
App functionality is primarily developed within the Block Editor. A) True B) False
A) True
Content providers are the only way to share data between apps A) True B) False
A) True
In an Android app, the four types of components that represent the entry point into your application are Activity, Service, Content Provider, and Broadcast Receiver. A) True B) False
A) True
MVC stands for Model-View-Controller, a design pattern that separates program tasks into different tiers. A) True B) False
A) True
The iOS life cycle is simpler than Android's because an iOS app has a single entry point. A) True B) False
A) True
When providing support for binding, a service must provide that funcationality in the onBind() method. A) True B) False
A) True
When retrieving values from components, App Inventor creates code that uses the getter method to access the value. A) True B) False
A) True
In Objective-C methods, arguments are separated with which punctuation mark? A) colons (:) B) commas (,) C) semicolons (;) D) pipes (|)
A) colons (:)
In the following onOptionsItemSelected() method, which id is most likely associated with starting a new session? public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.item1: new(); return true; case R.id.item2: open(); return true; case R.id.item3: close(); return true; case R.id.item4: info(); return true; default: return super.onOptionsItemSelected(item); } } A) item1 B) item2 C) item4 D) none, it will be handled by the default case
A) item1
Though you can write code for any of the life cycle event handlers, the most commonly used is which of the following methods? A) onCreate() B) onStart() C) onStop() D) onResume()
A) onCreate()
Which of the following is NOT a life cycle method in the Activity component? A) onInit B) onCreate C) onRestart D) onResume
A) onInit
In Android: Which of the following could be found in the file NewClass.java? A) public NewClass() { message = "Hello World!"; } B) public newClass() { message = "Hello World!"; } C) public newclass() { message = "Hello World!"; } D) public OtherClass() { message = "Hello, World! Good to see you again!"; }
A) public NewClass() { message = "Hello World!"; }
9.Assume that the value of TextBox1 will be set to the value of the variable temp. Which of the following sets of code will NOT set Label1.Text to the cube of the Text value of TextBox1?
B)
How much does it cost to deploy an Android application to the Android Market? A) $0 B) $25 C) $50 D) $100
B) $25
What is the default port number for the emulator? A) 80 B) 5554 C) 5555 D) 5556
B) 5554
Which of the following is NOT represented as a block? A) Methods B) Errors C) Properties D) Loops
B) Errors
Android is open-source software, which means that any modifications a developer makes must also be released as open-source software. A) True B) False
B) False
App Inventor can only be used to develop lightweight apps because you don't have to write code to use it. A) True B) False
B) False
Best practices are the result of finding the most successful set of test runs for an application. A) True B) False
B) False
C#, Java, and Objective-C have automatic garbage collection enabled by default. A) True B) False
B) False
Core applications on the Android platform are given preference over third-party apps. A) True B) False
B) False
Design patterns are just another name for best practices. A) True B) False
B) False
For security, Android applications are not able to access the existing messaging function of the phone. A) True B) False
B) False
In Android: The Random class gives access to a floating-point number between 1 and 100. A) True B) False
B) False
In C#, Java, and Objective-C, String objects are immutable, meaning that after strings are created, they can't be changed. Therefore, the following code is illegal: String str1 = "abc"; str1 = str1 + "123"; A) True B) False
B) False
In Java, Class instance variables must be declared at the beginning of the class definition. A) True B) False
B) False
In the Android app life cycle, a main() method is executed each time your app is started. A) True B) False
B) False
Java programs aren't native to the OS, so the Android platform includes the Java Virtual Machine (JVM) for running Android apps written in Java on Android devices. A) True B) False
B) False
Like object-oriented programs, procedural programs are data centered. A) True B) False
B) False
Services are stopped automatically and should not attempt to stop themselves. A) True B) False
B) False
To keep an Android application running, you must keep the app's screen visible. A) True B) False
B) False
Using blocks that fit together guarantee that your app will be error-free. A) True B) False
B) False
Given the UML class diagram seen in the accompanying figure, what is/are the class's data member(s)?
B) Length and width
The block in the associated figure is an example of which type of Built-In blocks? [AND test] A) Math B) Logic C) Control D) None of the above.
B) Logic
When using the Texting component, where do you find the block to include the automatically included messageText argument? A) Built-in B) My Blocks C) Advanced D) Components
B) My Blocks
What is the name for components that are not displayed to the user? A) Hidden B) Non-visible C) Spooled D) Background
B) Non-visible
Which is the correct definition of the term refactoring? A) Reducing a trinomial to a set of binomials B) Rewriting code to make it better without changing its behavior C) Rewriting code to add forgotten functionality or to remove unnecessary functionality D) Rewriting code to fix broken functionality
B) Rewriting code to make it better without changing its behavior
Which is not a possible outcome of an app with a memory leak? A) The app will run without issue. B) The app will close itself automatically when it reaches the memory limit. C) The app will crash. D) The system will crash.
B) The app will close itself automatically when it reaches the memory limit.
Given the inheritance tree in the accompanying figure, which is a list of all subclasses? A) UnpoweredVehicle, PoweredVehicle B) UnpoweredVehicle, PoweredVehicle, Bicycle, Skateboard, Motorcycle, Car C) Bicycle, Skateboard, Motorcycle, Car D) Cannot be determined from the diagram
B) UnpoweredVehicle, PoweredVehicle, Bicycle, Skateboard, Motorcycle, Car
Which of the following is NOT an example of a best practice? A) Using an Application Programming Interface (API) B) Using inheritance C) Using accessor methods D) Using the Model-View-Controller design pattern
B) Using inheritance
Testing the graphical user interface (GUI) during the early stages of development is best done using which of the following methods? A) Desk-checking B) Using the emulator C) On physical devices D) You can't test the GUI.
B) Using the emulator
Given the inheritance tree in the accompanying figure, which is a list of all superclasses?
B) Vehicle, UnpoweredVehicle, PoweredVehicle
Which section of the App Inventor workspace represents an Android phone's screen? A) Toolbar B) Viewer C) Components D) Palette
B) Viewer
Android Studio: What is inherited in the following code? public class DotSmasherCanvas extends View implements OnTouchListener { int dotX, dotY, score; //Other code here } A) class DotSmasherCanvas B) class View C) class OnTouchListener D) class int
B) class View
Given the UML class diagram seen in the accompanying figure, what is/are the class's data member(s)? A) Rectangle B) length and width C) getArea and getPerimeter D) Unknown
B) length and width
Which of the following is NOT a 'start' life cycle event? A) Application_Launching() B) onStart() C) InitializeComponent() D) application:DidFinishLaunchingWithOptions:
B) onStart()
What happens when you select the Show Barcode option from the Package for Phone menu? A) A label is created and printed. B) The app is converted to JavaScript. C) An image is created that shows a machine-readable URL pointing to the app. D) Construction instructions for a UPC code are created in XML format.
C) An image is created that shows a machine-readable URL pointing to the app.
On the iOS platform, where do life cycle events occur? A) Cocoa Touch B) Application object C) Application delegate D) User interface
C) Application delegate
Which Android component does NOT have life cycle events? A) Activity B) Service C) Content Provider D) Broadcast Receiver
C) Content Provider
The block in the associated figure is an example of which type of Built-In blocks? A) Math B) Logic C) Control D) None of the above
C) Control
The block in the associated figure is an example of which type of Built-In blocks? the "if" block
C) Control
Which is NOT part of the application life cycle? A) Started B) Being Destroyed C) Exited D) Running
C) Exited
The Blocks Editor is what type of application? A) JavaScript B) Java C) Java Web Start D) Eclipse Add-on
C) Java Web Start
Which is the correct argument sent to the onCreateOptionsMenu method to provide your own menu behavior? A) Activity act B) Class clss C) Menu menu D) MenuItem item
C) Menu menu
What is the correct way to retrieve the value from a component named TextBox1? A) TextBox1.Value B) TextBox1.getValue() C) TextBox1.Text D) TextBox1.getText()
C) TextBox1.Text
15.What is the correct way to retrieve the value from a component named Textbox1?
C) Textbox1.text
What property is used to set the text that will display in an app's top information bar? A) Label B) Text C) Title D) TopText
C) Title
Which term is used when an application on Windows Phone 7 is deactivated because it no longer has the focus? A) Killed B) Buried C)Tombstoned D) Sunk
C) Tombstoned
Which platform has no 'running' life cycle event? A) Android B) iOS C) Windows Phone 7 D) All three have a 'running' life cycle event.
C) Windows Phone 7
Android Studio: What interface is included in the following code? public class DotSmasherCanvas extends View implements OnTouchListener { int dotX, dotY, score; //Other code here } A) class DotSmasherCanvas B) class View C) class OnTouchListener D) class int
C) class OnTouchListener
Given the UML class diagram seen in the accompanying figure, what is/are the class's member method(s)? A) Rectangle B) length and width C) getArea and getPerimeter D) Unknown
C) getArea and getPerimeter
In the following onOptionsItemSelected() method, which id is most likely associated with accessing the application's help page? public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.item1: new(); return true; case R.id.item2: open(); return true; case R.id.item3: close(); return true; case R.id.item4: info(); return true; default: return super.onOptionsItemSelected(item); } } A) item1 B) item2 C) item4 D) none, it will be handled by the default case
C) item4
4.What happens when you select the Download to this Computer the Package for Phone menu?
D) An Android package, or .apk file, is downloaded to the user's computer.
Based on the associated figure, what might the code blocks shown imply about the intent of the application?
D) Calculate the number of gallons from the number of ounces
Based on the associated figure, what might the code blocks shown imply about the intent of the application? A) Count dozens of eggs B) Determine the number of hours from the number of minutes C) Calculate what power of two the number is D) Calculate the number of gallons from the number of ounces
D) Calculate the number of gallons from the number of ounces
Tapping the screen registers what event in the Android SDK and App Inventor? A) Tap B) Press C) Touch D) Click
D) Click
What property is used to set the text displayed temporarily in a text box before a user enters their own information? A) Label B) Tip C) HoverText D) Hint
D) Hint
What does JNLP (the type of file a Java Web Start application is stored in) stand for? A) Java New Language Processor B) Java NAT Layers Protocol C) Java Native Language Processor D) Java Native Launch Protocol
D) Java Native Launch Protocol
In Android: How are the properties of each component such GUI components stored? A) Class instance variables and their values in Java B) Comma separated values in a plain text file. C) Key/value pairs called attributes in JSON D) Key/value pairs called attributes in XML
D) Key/value pairs called attributes in XML
In Android: The Timer class method schedule uses which of the following units for its delay value? A) Hours B) Minutes C) Seconds D) Milliseconds
D) Milliseconds
In C#, Java, and Objective-C, what is the greatest number of subclasses a class can have? A) Depends on the language B) 0 C) 1 D) More than 1
D) More than 1
In an Objective-C method, arguments are specified by being placed within which punctuation mark? A) Parentheses ( ) B) Brackets [ ] C) Braces { } D) None
D) None
Which section of the App Inventor workspace lists components available for use in your app in expandable groups? A) Toolbar B) Viewer C) Components D) Palette
D) Palette
Which section of the App Inventor workspace allows the developer to modify certain aspects of components? A) Toolbar B) Media C) Components D) Properties
D) Properties
14.Which is the most efficient way to concatenate the two strings, "quick brown fox" and "jumped over the lazy dog" in Java?
D) StringBuffer buffer = new StringBuffer("quick brown fox"); buffer.append(" jumped over the lazy dog"); String string1 = buffer.toString();
Which is the most efficient way to concatenate the two strings, "quick brown fox" and "jumped over the lazy dog" in Java? A) String string1 = "quick brown fox"; string1 = string1 + " jumped over the lazy dog"; B) String string1 = "quick brown fox"; String string2 = string1 + " jumped over the lazy dog"; C) String string1 = "quick brown fox"; String string2 =" jumped over the lazy dog"; String string3 = string1 + string2; D) StringBuffer buffer = new StringBuffer("quick brown fox"); buffer.append(" jumped over the lazy dog"); String string1 = buffer.toString();
D) StringBuffer buffer = new StringBuffer("quick brown fox"); buffer.append(" jumped over the lazy dog"); String string1 = buffer.toString();
When an application interacts with data, which methods should be used? A) onStart() and/or onPause() B) onPause() and/or onResume() C) onStart() and/or onDestroy() D) onPause() and/or onDestroy()
D) onPause() and/or onDestroy()
Broadcast Receivers are only valid within the scope of which method? A) onCreate() B) onUnbind() C) onDestroy() D) onReceive()
D) onReceive()