• CONTEST ALERT - Experience the power of DDR5 memory with Kingston Click for details

About : Android favorites option


Right off the assembly line
actually in our project there is an option of favorites.
what i want to do is i want all those applications that has been
visited several times to be in favorites.
for this im going to use shared preferences.
i have thought having a counter
i will increment that counter
everytime a particular application is being accessed.
This counter value will get reflected in the sharedpreferences for
each application.
As soon as the counter reaches to a certain value that application
will be in the list of favorites.
But i dont know how to proceed.
So if anyone can guide then it will be a great help.
thanks alot


The Chosen One
Are you developing a launcher app?

Assuming yes-
I think favorites should be user select-able, and you can add a most used section.
(Just a opinion)

For tracking favorites or most used apps, use SQLite.
Store app package names which are in the launcher menu.
Your counter approach is fine. Also add a last accessed time in the table.
So it would be package name, counter, accessed time for the table structure.
Here is the Android Developer reference on SQLite-
Data Storage | Android Developers
Top Bottom