简体   繁体   中英

How to manage string resources in Android

I have to use many url strings in Android project.

First I stored them as class variable but there are so many strings so I tried to store them as string resources in strings.xml . However it's too hard since url includes a lot of special characters like &, /, % I have to convert them using <![CDATA[]> .

What is the most effiecient way to store those strings in Android?

If they are URLs, there is no point in storing them in strings.xml. Strings.xml is for internationalization and localization and URLs don't need that. So store them in a constants class like you were doing before.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM