1

While getting familiar with a library project I stumbled upon this meta data:

<meta-data android:name="private_client_id" android:value="${private_client_id}" />

which is later accessed like this:

ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
Bundle bundle = ai.metaData;
String senderId = bundle.getString("private_client_id");

What is the exact value of private_client_id and when is that value set. Shouldn't meta data be set during compile time?

Noterezeck
  • 422
  • 4
  • 17
  • 1
    As described here https://stackoverflow.com/questions/38687159/what-is-metadata-and-what-is-the-use-of-it-in-android metadata is is basically an additional option to store information that can be accessed through the entire project. In this case,`` is defined outside `` tag and inside `` tag.. In your case as it is a string its value would be simply : **${private_client_id}** – amit Sep 25 '18 at 06:41
  • So there's nothing that is assigned to ${private_client_id} during compile. It's assigned later on in the work flow of the library. I see now. Thank you! – Noterezeck Sep 25 '18 at 06:48

0 Answers0