0

How does the android load the res(string)?

We all know that: the string resources are in the values folder.

There're some kinds folders.

Such as:

 values
 values-es
 values-mcc460

When the user change the language to Spanish, then the system would load the resource from the folder values-es. And when the user insert a sim card(mcc=460), then the system would load the resource from the folder values-mcc460.

I wanna know how the system exactly load the resource? How does the android implement the resource loading mechanism in the framework?
I'm not familiar with c/c++.

Help!

Harshid
  • 5,701
  • 4
  • 37
  • 50
android_su
  • 1,637
  • 4
  • 21
  • 30
  • I don't mean this. I wanna know how the system know that which folder should be used. – android_su Sep 07 '13 at 09:23
  • for that you will have to look at the source code implementation of resources class – Raghunandan Sep 07 '13 at 09:27
  • You're right. I find the method AssetManager.getResourceText returns the string. But it use a native method loadResourceValue. But I'm not familiar with c/c++, so I need help. – android_su Sep 07 '13 at 09:34
  • http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.1_r1/android/content/res/Resources.java. check this. try understanding the methods. I guess it uses a string table or string block. – Raghunandan Sep 07 '13 at 09:38

0 Answers0