Kanzi 3.6.6 migration guide¶
Use this migration guide to update Kanzi applications from Kanzi 3.6.4 and 3.6.5 to Kanzi 3.6.6.
Migrating Kanzi 3.6.4 and 3.6.5 applications to use the Android platform package¶
The Android platform package does not support the V8 library. Before you migrate your Kanzi application, disable or remove JavaScript from the Kanzi application that you want to migrate.
To migrate Kanzi 3.6.4 and 3.6.5 applications to use the Android platform package:
Extract the Kanzi Android platform package zip file to the
<KanziWorkspace>
directory. When you extract the zip file, skip duplicate files instead of overwriting those files.Copy the
<KanziWorkspace>/Engine/applications/kzb_player/configs/platforms/android_gradle
directory to the<ProjectName>/Application/configs/platforms
directory of the Kanzi application that you want to migrate to the new Android platform package.In your Kanzi application, edit the Java resources:
In the
android_gradle/app/src/main/java/com/rightware/kanzi/kzbplayer
directory rename theKZBPlayer.java
file to the name of your application.For example, if your project is called
MyProject
, rename theKZBPlayer.java
file toMyProject.java
.In the
android_gradle/app/src/main/java/com/rightware/kanzi
directory rename thekzbplayer
directory to the lowercase name of your application.For example, if your application is called
MyProject
, rename thekzbplayer
directory tomyproject
.In a text editor open the
<project_name>.java
file and edit the file to include the references to your application.For example, if your application is called
MyProject
:Change
com.rightware.kanzi.kzbplayer
to
com.rightware.kanzi.myproject
Change the class
KZBPlayer
to
MyProject
Change the
TAG
"KZBPlayer"
to
"MyProject"
Change
Debug.startMethodTracing("kzbplayer")
to
Debug.startMethodTracing("myproject")
In a text editor open the
android_gradle/app/src/main/AndroidManifest.xml
file and edit the file to include the references to your application.For example, if your application is called
MyProject
:Change
com.rightware.kanzi.kzbplayer
to
com.rightware.kanzi.myproject
Change
activity android:name=".KZBPlayer"
to
activity android:name=".MyProject"
In a text editor open the
android_gradle/app/src/main/res/values/strings.xml
file and edit the file to include the name of your application.For example, if your application is called
MyProject
, change<string name="app_name">KZB Player</string>
to
<string name="app_name">MyProject</string>
In your project, edit the build scripts:
In a text editor open the
android_gradle/app/CMakeLists.txt
file and edit the file to include the name of your application and the path to the C++ application source file.For example, if your application is called
MyProject
:Change
project(kzb_player)
to
project(myproject)
Change
add_executable(${PROJECT_NAME} src/main/cpp/kzb_player.cpp)
to
add_executable(${PROJECT_NAME} ../../../../src/myproject.cpp)
In a text editor open the
android_gradle/settings.gradle
file and edit the file to include the name of your application.For example, if your application is called
MyProject
, set the value of therootProject.name
to"myproject"
.In a text editor open the
android_gradle/app/build.gradle
file and edit the file so thatapplicationId
points to you application.For example, if your application is called
MyProject
, set theapplicationId
to"com.rightware.kanzi.myproject"
.In a text editor open the
android_gradle/gradle.properties
file and replace:org.gradle.jvmargs=-Xmx<size>m
with
org.gradle.jvmargs=-Xmx4608m
In your application, edit the C++ source files:
In the
Application/src/<project_name>.cpp
file change:class <ProjectName>: public ExampleApplication
to
class <ProjectName>: public Application
In the
<project_name>.cpp
file add aModule::registerMetadataOverride
callback that does not contain V8Module registration:class <ProjectName>: public Application { public: ... void registerMetadataOverride(ObjectFactory& /*factory*/) override { Domain* domain = getDomain(); KanziComponentsModule::registerModule(domain); } };
In the
<project_name>.cpp
file in theApplication::onConfigure
callback function remove references to theExampleApplication
class:void onConfigure(ApplicationProperties& configuration) override { Application::onConfigure(configuration); configuration.binaryName = "<project_name>.kzb.cfg"; configuration.extensionOutputEnabled = true; configuration.defaultSurfaceProperties.antiAliasing = 0; configuration.defaultSurfaceProperties.bitsDepthBuffer = 0; configuration.defaultSurfaceProperties.bitsStencil = 0; }
Build and deploy your Kanzi application using either Android Studio or the command line interface. See Building and deploying Kanzi applications from Android Studio and Building and deploying Kanzi applications from the command line.