代写 android IAT359 Mobile Computing / Instructor: Helmine Serban

IAT359 Mobile Computing / Instructor: Helmine Serban
Assignment 2
How to submit: Online submission through Canvas only. Email submissions are NOT accepted. Late submission / incorrect submission policy:
Late penalties apply as follows:
• 1 min to 24 hrs late: 25% deduction
• 24 hrs to 48 hrs: 50% deduction
• 48 hrs to 72 hrs: 75% deduction
• More than 72 hrs late: mark is zero.
Each student is responsible to check the correctness of the submitted documents (proper files, correct format). Incorrect submissions are subject to 20% penalty plus late penalty on each day until the correct files are submitted.
Illness or Emergency:
If you have an emergency (illness or family emergency) please let us know before the assignment is
due and submit documentation as proof. There are no exceptions to the above.
This assignment is based on the topics we covered so far in lectures and it also requires you to do reading and research on topics such as: adding components programmatically to the UI, generating sounds, vibrating a device, detecting motion and external noise.
Sensors of the Device (25 points)
Important naming requirements: your app should be named as follows: FirstnameLastName_A2 (for example: JohnSmith_A2). The name of the app can be changed by modifying the ‘app_name’ string in the strings.xml file of the res/values folder. Points are deducted (1 mark) if naming conventions are not respected.
Create an application to display all the sensors of the device and show the data from each sensor.
a) RecyclerView: In the main activity display each sensor of the device in a RecyclerView. The RecyclerView should show all sensors of the device. Keep in mind that your application needs to work on variety of devices; therefore it is important that you do not hardcode the list of sensors. (4 points)
b) Sensor Data: When the user clicks on one of the sensors in the RecyclerView, another screen (implemented as an activity) will open and it will display information from the sensor. You must display current sensor values, along with all the other information for the sensor (sensor type, maximum range, resolution, etc). (3 points)
c) Light Sensor: When the light sensor is fully covered by the user’s hand, play a beep sound. This action should be triggered in the main activity and in no other activity. (2 points)

IAT359 Mobile Computing / Instructor: Helmine Serban
d) Flat device: When the device is positioned flat on a table, it should vibrate for 5 seconds. Vibration should stop after 5 seconds and not start again if the device is still flat. However, if the device has been moved out of the flat position and then set flat again, the device should again vibrate for 5 seconds. Any time the device starts vibrating, a toast message should also come up with status text of ‘device flat – beep’. If the device does not have the ‘vibrate’ functionality, only the toast message should be shown, with text stating that there is no vibration option for this device and that the device is flat on table. This action should be triggered only in the main activity. (3 points)
e) Moving or stationary: Detect whether the user is moving or stationary. Implement an activity with a button and a text view. On clicking the button, your code should detect whether the user is moving or not, and should display this status on the text view. It is up to you where you place this activity – it could be triggered from the main page for example, from a ‘Status’ button. (3 points)
Your application should not crash or throw exceptions. If your application crashes at any point during testing, 10 marks will be deducted.
The app should display properly when the device is rotated, and it should run on physical devices. Manage all resources properly (e.g., release resources that you have requested from the Android system). (2 marks)
Add comments to your code, to explain what each section of the code does. We will test your app on our physical devices.
Deliverables:
Submit your code as a zip file.
Submit a report in which you explain in detail your code, for each of the points a) to f) above.
Grading is based on the testing of your app on a physical device and submitted documents. Proper attention should be given to the naming requirements specified above. 1 mark will be deducted if app is not named as required.