The trema:exportAndroid goal exports a Trema database into XML files suitable to be used in Android applications. This goal is available as of version 1.1.6.1 of the Trema Maven Plugin.
A file for each language is created which looks like this:
<?xml version="1.0" encoding="utf-8"?> <!-- Generated file - do not edit --> <resources> <string name="helloworld">Hallo Welt!</string> <string name="byeworld">Tsch�ss & bis bald!</string> </resources>
For more information about the android resources file format see http://developer.android.com/guide/topics/resources/string-resource.html
Important
' is replaced with \\' \' is replaced with \\' & is replaced with &
The snippet below shows a minimal configuration needed to export the Trema database (*.trm file) into several Android string resource XML files:
<build> <plugins> ... <plugin> <groupId>ch.netcetera.nca-236-0</groupId> <artifactId>trema-maven-plugin</artifactId> <executions> <execution> <goals> <goal>exportAndroid</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
The following defaults apply here:
In case the above defaults are not suitable, the goal can be configured. The following sample shows a more sophisticated configuration of the goal.
<build> <plugins> ... <plugin> <groupId>ch.netcetera.nca-236-0</groupId> <artifactId>trema-maven-plugin</artifactId> <executions> <execution> <goals> <goal>exportAndroid</goal> </goals> </execution> </executions> <configuration> <tremaFile>${project.basedir}/src/main/resources/android/text.trm</tremaFile> <exportPath>${project.build.directory}/generated/android-resources/</exportPath> <defaultlanguage>de</defaultlanguage> </configuration> </plugin> ... </plugins> </build>