Wia2007 T9
Wia2007 T9
1. Briefly explain the following App Data Storage available in Android Framework:
a) App-Specific Storage
- Use a dedicated directory in the phone’s internal storage to store the
application data
- Store data that is meant for the mobile app only
- The data will be removed when the mobile app is uninstalled
b) Shared Storage
- Store files that are meant to share with other applications: images,
documents
- Accessing other apps media files require permission
- No permission is required for documents and other files
- The files will not be removed when the mobile app is uninstalled
c) Preference
- Store private, primitive data in key-value pairs
- Do not need explicit permission to access the data.
- Other applications cannot access the data
- The data will be removed when the mobile app is uninstalled
d) Database
- Structured data is stored in the private database
- No need explicit permission to access the data
- Other applications cannot access the data
- The data will be removed when the mobile app is uninstalled
2. What are the considerations that we should have included when we are deciding
which App Data Storage type to use in the mobile application?
- Data type – is the data structured, semi-structured or
unstructured(media)
- Security – how sensitive is the data being stored
- Space – considering the size of data, device storage constraints and
storage optimization
- Access – certain storage types may require user permissions
3. Can we use more than one App Data Storage type in a mobile application? Explain
your answer by giving some suitable examples.
- Yes
- It is often necessary to combine different data storage types to meet
various requirement of the app.
- Social media app use local database to store user profiles, posts and
media for offline access. Using cloud storage to store large files like
1
WIA2007 MAD Tutorial 9 Sem 1, 24/25
images and videos. Secure storage is use to store sensitive data like
authentication.
4. State the differences between cache data, SharedPreference data, and Save Instance
State data in the Android Framework.
Cache data SharedPrefernce data Save Instance
Preserve data if they are Preserve data across user Preserve data within a
not cleaned by the system session and even when the single user session
or user application or device is
restarted
Suitable to be used for Suitable for personal data Suitable for more private
less important data but should be remember data and for one user
because the availability is across different user session only
uncertain session
Not stored in K-V pair Represented by K-V pair Represented by K-V pair
Submission
Submit Q1-Q4 to the submission link provided in Spectrum before the next Tutorial session.
Bring your answer for discussion.