1 of 1 people found this helpful
It is not available via the build.yml at this time. One (not so ideal but may be better then modifying the source each time) is to have a 'dummy' native extension defined in your project that does not do anything. You can then following the detail on how to included modifications to the manifest via the native extensions:
In the extensions ext.yml, you essentially specify a android manifest.xml file that will be merged with the one that comes from the rhodes source. be sure to include this 'native extension' on your build.yml so that it builds and includes it with your project. Then this way you can at least control including this at the project level.
Hope this helps.
Make changes to application AndroidManifest.xml
You can specify changes to AndroidManifest.xml in the ext.yml file as a path to the files with the changes. There are three formats recognized by the build system, depending on the file extension:
- .xml – xml file with common AndroidManifest.xml format; its tags will be merged into the final manifest.
- .erb – ruby templates which will be injected into the final manifest.
- .rb – ruby script which will run by manifest erb generator.
manifest_changes: - ext/yourextension/platform/android/AndroidManifestAdds.xml - ext/yourextension/platform/android/ApplicationTagAdds1.erb - ext/yourextension/platform/android/ApplicationTagAdds2.erb - ext/yourextension/platform/android/ManifestTagAdds.erb - ext/yourextension/platform/android/AndroidManifestScript.rb
This is the simplest way, if you know how your manifest has to look. Add the final AndroidManifest.xml to the extension and specify it in ext.yml. The build system will try to merge all the tags from the file into the final AndroidManifest.xml. Tags which exist in both Rhodes and extension manifest will be overwritten from the extension manifest.
android: manifest_changes: ext/yourextension/platform/android/AndroidManifest.xml
The extension method looks promising, but adding an extra attribute to the <application> tag does not seem to be possible. I've tried to merge the following xml to the manifest:
<?xml version='1.0' encoding='UTF-8'?> <manifest xmlns:android='http://schemas.android.com/apk/res/android'> <application android:hardwareAccelerated='true'> <service android:name='com.company.test'/> </application> <test>This is a test</test> </manifest>
The file was referenced correctly in the ext.yml, because the resulting manifest contained the <service> and <test> tags, but the android:hardwareAccelerated attribute was missing.
The ERB template and RB script methods both describe ways to add tags to the application or manifest tags, but there is nothing about adding attributes to these tags. So I assume that this is not possible and we have to edit the master template.
In next release there will be special capability to accelerate RhodesActivity.
In current rhodes you may edit <rhodes>/platform/android/Rhodes/AndroidManifest.xml.erb
Add the android:hardwareAccelerated attribute to either <application/> or <activity android:name="RhodesActivity"/> tag to accelerate whole application or just main activity.
I recommend to add the attribute to the just main activity tag in order to be safe.
I'll be looking forward to the next release!
Until then we'll edit the AndroidManifest.xml.erb.