[TIMOB-5076] Android: update timodule.xml documentation to explain token substitutions
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-24T12:41:05.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Sprint 2012-02, Release 2.0.0, Release 1.8.1 |
Components | Android |
Labels | modules, timodule |
Reporter | Bill Dawson |
Assignee | Ingo Muschenetz |
Created | 2011-08-22T13:40:30.000+0000 |
Updated | 2014-02-04T00:45:54.000+0000 |
Description
(The wiki page that needs updating is: https://wiki.appcelerator.org/display/guides/tiapp.xml+and+timodule.xml+Reference ).
Module developers can now include tokens in their timodule.xml file's section. These tokens will be replaced with real values from an app's tiapp.xml when building an app that includes the module. For example, if the module includes a new android , the
android:name
of that permission may require the app id of the application *using* the module, which of course the module developer cannot know beforehand. So with this new tokening feature, the module developer can put a token in which will be replaced when the application is built.
E.g.,
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<permission android:name="${tiapp.properties['id']}.permission.MY_NEW_PERMISSION"
android:protectionLevel="signature" />
</manifest>
</android>
As you can see, the token looks like:
${tiapp.properties['id']}
So in that example, tiapp.properties
refers to a collection of all of the top-level element names you always find in tiapp.xml, such as <id>
, <name>
, <version>
, <publisher>
etc. To access a member of the collection -- like we've done in the example with "id" -- use square brackets with the property name in quotes inside.
When an app with id "com.appcelerator.bogus" which contains the module is built using the above example, the app's AndroidManifest.xml will end up with a ...
<permission android:name="com.appcelerator.bogus.permission.MY_NEW_PERMISSION"
android:protectionLevel="signature" />
... in it.
I updated the page. Please review: https://wiki.appcelerator.org/display/guides/tiapp.xml+and+timodule.xml+Reference#tiapp.xmlandtimodule.xmlReference-timodule.xml
Exactly!
There are no QE needs for this, so closing entirely.