-1

I am working on a simple app that displays certain categories of string and i am using String array for this instead of using database. Is this a bad practice?

3 Answers3

0

According to this answer, everything which is written to disk is slow, being it DB or SharedPreferences, so your solution that uses String array is fine as long as your categories are limited in number.

phcaze
  • 1,707
  • 5
  • 27
  • 58
0

if your categories are limited of about 10 to 15 then you can use array otherwise you should prefer to use database to store categories. if your categories are limited always than it can be used but in future if you want to increase your categories you can directly increase it from Database

Sand'sHell811
  • 358
  • 3
  • 15
0

if you write in disk it automatically becomes slower so are databases. So, it's not a bad practice unless your categories are limited. For large categories it is obvious to use databases.

Dinesh Neupane
  • 382
  • 10
  • 19