PRACTICE EXAMINATION FOR
159.336 MOBILE APPLICATION DEVELOPMENT
移动应用程序开发代写 Time Allowed: THREE (3) hours This paper contains FIVE (5) questions. Please answer all questions. This exam contributes 60% to your final grade.
Time Allowed: THREE (3) hours
This paper contains FIVE (5) questions.
Please answer all questions.
This exam contributes 60% to your final grade.
CALCULATORS PERMITTED
Question 1. 移动应用程序开发代写
a) What does the following mean in and Android manifest file:
minSdkVersion=16
[2 marks]
b) What is a Hardware Abstraction Library (HAL). [2 marks]
c) What is a Broadcast Receiver? [2 marks]
d) What does the following do?
startActivity(new Intent(Intent.ACTION_CALL).setData( Uri.parse(“tel:111”));
[2 marks]
e) What does setContentView() do? [2 marks]
f) How does an app load a native library? [2 marks]
Question 2.
a) Given the following layout containing a TextView, an ImageView and a Button:
i) Draw a tree to illustrate a possible View Heirarchy for this layout.
ii) Give the xml for this layout (omit the “android:” part of an attribute name for brevity). [5 marks]
b) What is the purpose of android:id=”@+id/mybutton” attribute for a ButtonView in an xml layout file. [2 marks]
c) What is the “gravity” property of a ViewGroup used for. [2 marks]
d) Give a situation where you might use a FrameLayout. [2 marks]
e) What is a Bundle? [1 mark]
Question 3. 移动应用程序开发代写
a) After onPause(), what are the three possible activity lifecycle methods than can be called for an activity. [3 marks]
b) Which is the only method that that all activities will implement. [1 mark]
c) onCreate() may be passed a Bundle, what does this Bundle contain? [2 marks]
d) When do onSaveInstanceState() and onRestoreInstanceState() get called. [2 marks]
e) What should an app do in onDestroy()? [2 marks]
f) What does the findViewById() method do? [2 marks]
Question 4. 移动应用程序开发代写
a) What is the UI thread? What operations can you only perform on the UI thread and what operations should you NOT perform on the UI [3 marks]
b) What is a Handler, what are handlers used for? [2 marks]
c) What is the purpose of the following git commands:
i) git add src/main.java
ii) git commit -m “source code”
iii) git merge -m “merge with test” testing [3 marks]
d) How are objects identified in a Git repository? [1 mark]
e) What is an Adapter? Briefly describe how an Adapter reuses views. [3 marks]
Question 5.
a) Given a Canvas c, write a sequence of drawing calls to draw the following:
The circle has a radius of 100 pixels and the line is 240 pixels long. The origin of the circle is at (200,200).
Assume a suitable Paint object named mPaint has already been created. [3 marks]
b) What are usually the main differences between the debug version of an app and the release version of the same app? [2 marks]
c) Outline how you would use the SensorManager to get input for a game where it is necessary to tilt the device to control a vehicle. [3 marks]
d) How can you call a Java method from a native function written in C++? [2 marks]
e) What is a Document Provider? [2 marks]