159.336 MOBILE APPLICATION DEVELOPMENT
移动应用程序代写 Time Allowed is THREE (3) hours This paper contains FIVE (5) questions. Please answer all questions. Write your answers to all applicable
Time Allowed is THREE (3) hours
This paper contains FIVE (5) questions.
Please answer all questions.
Write your answers to all applicable questions in the Blue Answer Book supplied.
Calculators permitted with no restrictions.
Students may NOT remove any part of this question paper from the exam room.
The exam paper will be made available on the University Library website.
This exam contributes 60% to your final grade.
Question 1. 移动应用程序代写
a) What is an Intent? [2 marks]
b) Briefly describe what a support library is used for. [2 marks]
c) What is the Android Debug Bridge (ADB)? [2 marks]
d) What does the following do?
startActivity(new Intent(Intent.ACTION_SEND) .putExtra(Intent.EXTRA_TEXT, "Hello There") .setType("text/plain"));
[2 marks]
e) What is the purpose of the targetSdkVersion in a gradle build file? [2 marks]
f) When an Activity calls startActivityForResult(), how is the result returned to theActivity? [2 marks]
Question 2.
a) Given the following layout containing a TextView, an ImageView and 2 Buttons:
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). The buttons must have a width of 64dp. [3 marks]
b) What are the possible values for the layout_height attribute of a View? [2 marks]
c) What are the layout-port and layout-land resource folders used for? [1 mark]
d) Write a line of Java to make a view ‘v’ rotate 360 degrees clockwise over 500 milliseconds. [2 marks]
e) What does the following line of Java do?
view.setVisibility(View.GONE);
[1 mark]
f) What is the R class used for? [1 mark]
g) Which operations must be run on the UI thread and which operations should not. [2 marks]
Question 3. 移动应用程序代写
a) After the onStop() Activity method has been called, which methods may be called next? [2 marks]
b) An Activity acquires a Camera in onStart() and releases it in onPause(), what problems could this cause? [2 marks]
c) Which Activity methods are called when the user navigates to a different app (without pressing the back button)? [2 marks]
d) When is the onSaveInstanceState() method of an Activity called? [2 marks]
e) What does the showAsAction attribute of an App Bar menu item do? [1 mark]
f) What does the following do?
Toast.makeText(this,"Starting..",Toast.LENGTH_SHORT) .show(); [1 mark]
g) Write a line of Java to set the layout for an Activity to one specified in a layout resource named “activity_main.xml” [1 mark]
h) What are shared preferences? [1 mark]
Question 4. 移动应用程序代写
a) Write a simple getView() method that could be used for an Adapter to provide data to a ListView. Items in the list have a layout named “item_layout” containing a single TextView with the id “item_name”. The contents of the TextView should be set to the index of the item in the list. You don’t need to use a ViewHolder. [5 marks]
b) Briefly describe the advantages of using the ViewHolder pattern. [2 marks]
c) Draw a diagram to illustrate how a git merge is used to combine two branches. [2 marks]
d) What is an AsyncTask and when should you use one? [2 marks]
e) What is a Handler? [1 mark]
Question 5. 移动应用程序代写
a) Give Java code to find the names of all the Contacts on a device. The base URI for contacts is ContactsContract.Contacts.CONTENT_URI and the name is stored in ContactsContract.Contacts.DISPLAY_NAME. [3 marks]
b) Given a Canvas c, write a sequence of drawing calls to draw the following shape:
Assume a suitable Paint object named mPaint has already been created, the radius of the circles is 100 pixels and the line is 300 pixels long. Draw the shape to the top left of the Canvas. [3 marks]
c) What are the main differences between using a CustomView for drawing and drawing on a SurfaceView? [2 marks]
d) Briefly describe how an app can use a magnetic field sensor to determine where north is? [2 marks]
e) You are asked to write an app that checks a central server for weather events every hour. Briefly describe which app components you would use? [2 marks]
更多代写:Assembly代写 在家考托福 英国留学生课业辅导 mla论文格式 lab report怎么写 留学申请范文代写