Search code examples
androidstringresourcesandroid-auto

Storing Conversation Messages for Android Auto in strings.xml


I have seen that in the following android auto sample - https://developer.android.com/samples/MessagingService/index.html

message conversations are stored in an array in Conversation.java class. I know that in real world it should be done using a content provider. But, currently, i want to make it simple.

Is it possible that i can store such messages in strings.xml file in android project? (I mean in the resource folder), reason being I want to trigger such messages based on some condition I have received on my broadcast receiver.

Thanks in advance for the help!


Solution

  • Storing it in strings.xml itself is fine. Another option is to have a static array of those strings.

    strings.xml will be more flexible when it comes to localization