IAT359 Mobile Computing / Instructor: Helmine Serban
Assignment 3 Sensors of the Device
Important naming requirements: your application should be named as follows: FirstnameLastName_A3
(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.
Create an application to display all the sensors of the device and show the data from each sensor.
a) 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 marks)
b) SensorDetailsActivity: When the user clicks on one of the sensors in the RecyclerView, another screen (implemented as an activity named SensorDetailsActivity) 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). (2 marks)
c) LightSensorActivity: Create a new activity named LightSensorActivity. This activity should be accessed from the main activity, from a button placed below the recycler view. In this activity you should check and display the value coming from the light sensor in a text view. If the device is not exposed to light, a beep sound should play. This sound should play only in this activity and only if the device is not exposed to light. As soon as the device is exposed to light, the beep sound should stop. (2 marks)
d) FlatCheckActivity: Create a new activity named FlatCheckActivity. This activity should be accessed from the main activity, from a button placed below the recycler view. In this activity, when the device is positioned flat on a table, it should beep for 5 seconds. Beeping 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 beep for 5 seconds. Any time the device starts beeping, a toast message should also come up with status text of ‘device flat – beep’. Display a text view that shows the status of the device (flat on table or not flat) (2 marks)
e) MovementCheckActivity: Create a new activity named MovementCheckActivity. This activity should be accessed from the main activity, from a button placed below the recycler view. Detect whether the user is moving or stationary. In this activity your code should detect whether the device is moving or stationary, and should display this status on a text view. (2 marks)
IAT359 Mobile Computing / Instructor: Helmine Serban
The main activity will contain the recycler view and below it, the three buttons: LightSensorCheck, FlatCheck and MovementCheck. Pressing each of the three buttons will trigger the corresponding activity, as described above. (1 mark)
Your application should not crash or throw exceptions. If your application crashes at any point during testing, 10 marks will be deducted.
Manage all resources properly (e.g., release resources that you have requested from the Android system). Add comments to your code, to explain what each section of the code does.
The application should be tested on the emulator. If you have a physical device available you can also test on a physical device, however for grading purposes your application will be tested on the emulator.
Deliverables:
Submit your code as a zip file. Check your files on Canvas to make sure that they have been submitted and in the proper format.
Submit a report in which you explain in detail your code, for each of the points a) to e) above.
Grading is based on the testing of your app and submitted documents. Proper attention should be given to the naming requirements specified above. Points are deducted (5% of total) if naming conventions are not respected.
The report should be submitted as a separate pdf file (do not include it in the same zip as the code). Late deductions apply to late deliverables and resubmissions due to incorrect file format. Application: 13 marks
Code: 3 marks
Report: 4 marks