CS计算机代考程序代写 database android 15/06/2021 Week 8: Workshop Quiz: Attempt review

15/06/2021 Week 8: Workshop Quiz: Attempt review
FIT2081 Mobile application development – S1 2021
Dashboard / My units / FIT2081_S1_2021 / Assessments / Week 8: Workshop Quiz
Started on Monday, 26 April 2021, 10:14 PM
State Finished
Completed on Monday, 26 April 2021, 11:59 PM
Time taken 1 hour 45 mins
Grade 7.78 out of 10.00 (78%) Print friendly format
Question 1
Complete
Mark 7.78 out of 10.00
Question 1
Q1 – Suppose you are developing an application that uses the ‘Room’ database to manage its local database. The app also exports its data using a ‘Content Provider’. Briefly explain how does the Content Provider class uses the Room database layers to achieve its tasks.
Using provider class in order to achieve the required functionality from the room database by making use of the database tables and by making use of the procedures I can perform all the functionalities in a database without having any difficulties in order to retrieve the data from the Room database.
I can specify the procedures in the provider class in order to extract the required values from the database and we can normalize the database in order to have the databases and that are sorted and organized.
Comment:
(Q1=63% Q2=80% Q3=80% T4=100% )
Question 2 Complete Not graded

https://lms.monash.edu/mod/quiz/review.php?attempt=19546633&cmid=8331154 1/4

15/06/2021 Week 8: Workshop Quiz: Attempt review
Question 2
Q2 – Develop a piece of code that inserts a new record in a database that is available in another application and can be accessed via the authority “fit2081.week8.workshopq2”. The new record, which is detailed below, must be saved in a table named ‘customers’.
‘name’:’David’ ‘age’:25 ‘address’:’Melbourne’
public void onRefreshBtn(View view){ showCustomersNumber( );
}
private void showCustomersNumber( ){
Uri uri = Uri.parse(“content://fit2081.week8.workshopq2″); Cursor result= getContentResolver().query(uri,null,null,null); tV.setText(result.getCount()+””);
}
public void addNewCustomer(View view){
String name = “David”;
String age = “25”;
String address = “Melbourne”;
ContentValues values= new ContentValues(); values.put(“cunstomerName”, name); values.put(“cunstomerAge”, age);
values.put(“cunstomerAddress”, address);
Uri uri = Uri.parse(“content://fit2081.week8.workshopq2”);
Uri uri2= getContentResolver( ).insert(uri,values);
Toast.makeText(context: this, uri2.toString( ), Toast.LENGTH_LONG).show( );
}
Question 3 Complete Not graded
Question 3
Q3 – Briefly explain the role of the ‘UriMatcher’ class in an application that needs to share its data with other apps.
Urimatcher is a utility class that aids in matching URIs in content providers. Using the ‘UriMatcher’ class gives each URI a unique code that will be used later by the content provider’s methods to tell which table to use or to retrieve the requested ID.

https://lms.monash.edu/mod/quiz/review.php?attempt=19546633&cmid=8331154 2/4

15/06/2021 Week 8: Workshop Quiz: Attempt review
Question 4 Complete Not graded
Question 4
Q4 – List two advantages and two disadvantages of using the Google Firebase database in Android applications.
Two advantages:
1. It Allows data to be synced in real-time and it is a NO-SQL database. In addition, it can keep Real-time storage and synchronization of user data
2. The Firebase database is hosted in the cloud, so we do not have to maintain and operate the server. In addition, we can use the database offline and get started easily and quickly.
Two disadvantages:
1. This database has a very limited query and index issues.
2. It works only with devices having Google play services installed in it.
Question 5 Not answered Not graded
Question 5

https://lms.monash.edu/mod/quiz/review.php?attempt=19546633&cmid=8331154 3/4

15/06/2021 Week 8: Workshop Quiz: Attempt review
◄ Week 7: Workshop Quiz
Jump to…
Week 9: Workshop Quiz ►
https://lms.monash.edu/mod/quiz/review.php?attempt=19546633&cmid=8331154
4/4