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_gradledirectory to the<ProjectName>/Application/configs/platformsdirectory 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/kzbplayerdirectory rename theKZBPlayer.javafile to the name of your application.For example, if your project is called
MyProject, rename theKZBPlayer.javafile toMyProject.java.In the
android_gradle/app/src/main/java/com/rightware/kanzidirectory rename thekzbplayerdirectory to the lowercase name of your application.For example, if your application is called
MyProject, rename thekzbplayerdirectory tomyproject.In a text editor open the
<project_name>.javafile and edit the file to include the references to your application.For example, if your application is called
MyProject:Change
com.rightware.kanzi.kzbplayerto
com.rightware.kanzi.myprojectChange the class
KZBPlayerto
MyProjectChange 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.xmlfile and edit the file to include the references to your application.For example, if your application is called
MyProject:Change
com.rightware.kanzi.kzbplayerto
com.rightware.kanzi.myprojectChange
activity android:name=".KZBPlayer"to
activity android:name=".MyProject"
In a text editor open the
android_gradle/app/src/main/res/values/strings.xmlfile 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.txtfile 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.gradlefile and edit the file to include the name of your application.For example, if your application is called
MyProject, set the value of therootProject.nameto"myproject".In a text editor open the
android_gradle/app/build.gradlefile and edit the file so thatapplicationIdpoints to you application.For example, if your application is called
MyProject, set theapplicationIdto"com.rightware.kanzi.myproject".In a text editor open the
android_gradle/gradle.propertiesfile 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>.cppfile change:class <ProjectName>: public ExampleApplication
to
class <ProjectName>: public Application
In the
<project_name>.cppfile add aModule::registerMetadataOverridecallback 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>.cppfile in theApplication::onConfigurecallback function remove references to theExampleApplicationclass: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.