Question: Andy ( which is short for Android ) is an engineer at CS 4 0 7 Inc. His boss, Bucky, asks Andy to create an
Andy which is short for Android is an engineer at CS Inc. His boss, Bucky, asks Andy to create
an app to help students arrive at class faster using shortcuts around campus. The following
questions revolve around different design decisions Andy must make to produce a successful app.
Read the question details carefully before selecting an answer!
Some users may want to save routes for later, so Andy decides that his app must support
persistent storage. He decides to store the routes and history in a Room database locally on the
phone. However, Bucky thinks that this is a foolish design decision and suggests that Andy uses
SharedPreferences instead. Who is smarter: Bucky or Andy, and Why?
Bucky SharedPreferences take less time to code and are much faster than Room Database on Android.
Bucky The route information and history data is very simple and compressed data, and thus is not appropriate for
the overhead incurred by Room Database.
Andy Representing routes and saving history requires a more complex scheme than typically supported in
SharedPreferences.
Andy Room Database because databases are optimized for storing small keyvalue pairs, and using Room
databases is always more performant than SharedPreferences.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
