• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Can I use string resources to store Firebase Database keys?

EAkio

Lurker
Could I use the strings.xml resources to have it stored some Firebase Database keys so I can retrieve data directly into these keys instead of retrieving them on database?

Let me explain: my app focus on three main topics, within these topics i have different sub-topics (for example pages, articles, musics, and so on), so there are few topics, i was thinking if i could save the keys from these topics on my strings.xml so everytime i would need to get an item from a sub-topic, i would already have the topics key, but idk if this is a good implementation, is it?
 
What are the chances that the list of topics/sub-topics might change?

If they're going to always be the same, then I can see doing it that way. For things like that, I create a configs.xml resource file that I use to store that sort of data. I can't speak for how others (more experienced) may do it.

If there's a reasonable chance they could change, then you might want to look at a different way to get them dynamically from the DB.
 
The topics are really difficult to change, the app focus mainly on 3. What concerns me is the security of sharing it so visible on source code and if at anytime i would need to recreate them and so i would need to patch an update to the app so it can get the new reference... this sounds poorly, doesn't it?
 
I can't really help with the security aspect - I don't know what can be seen in the APK, and you would have to determine the repercussions of that info being seen, and how that could impact you.

The patch update is a real concern, which is why I asked about them changing. If it's really locked in that there are three and only three, then maybe that's not a major issue. Again, you would need to determine how much of an impact it would make to have to do that sort of change.
 
Uhum! Ty 23tony, i really needed someone to confirm what i was thinking it was a problem (the patch updates). I did made some chages which increased performance and reformulated the db to serve the new model, and this really satisfied my question. Ty for your help :)
 
Back
Top Bottom