How Should I Integrate a Wear Android Project Into Kony Visualizer 7.2.1?

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

I have an android project where I have integrated a functionality with android watch. How do I integrate this with Kony Visualizer

It is highly recommended that you create standalone Wear APKs and no longer embed your Wear apps with with mobile apk.But you can still integrate Android wear project in kony visualizer and embed wear apk with mobile apk in 2 ways:

A. Manually packing android wear(1.x) apk as resouce.

1. Use wearable apk(we have used android studio to create wearable apk in our case) and and sign it with private key.

2. Include all the permissions declared in the manifest file of the wearable app to the mobile app in the kony IDE. For example, if you specify the VIBRATE permission for the wearable app, you must also add that permission to the mobile app.

3. Ensure that both the wearable apk and mobile app have the same package name and version number.

4. Copy the signed wearable app to the Kony project's "workspace\app_name\resources\mobile\native\android\raw" directory. We'll refer to the wearable APK as wearable_app.apk.

5. Create a "waer_app_desc.xml" file that contains the version and path information of the wearable app. For example:

<wearableApp package=<package_name>>

<versionCode>1</versionCode>

<versionName>1.0</versionName>

<rawPathResId>wearable_app</rawPathResId>

</wearableApp>

The package, versionCode, and versionName are the same values specified in the wearable app's AndroidManifest.xml file. The rawPathResId is the name of the wear apk.

Copy the above created xml file in the "workspace\app_name\resources\mobile\native\android\xml" directory.

6. Add a meta-data tag to your kony project's tag to reference the waer_app_desc.xml file as mentioned below:

<meta-data android:name="com.google.android.wearable.beta.app"

android:resource="@xml/wearable_app_desc"/>

To add meta-data tag to kony project, go to project's properties and click on Native tab and then android tab. Goto tag tab in manifest properties and add the above meta data in application tag.

7.Build the app in release mode in Kony IDE and sign the unsigned-release apk with same private key with which wearable app was signed.

For more information, please refer "Package a Wear 1.x app manually" section from the link(https://developer.android.com/training/wearables/apps/packaging.html) and sample app testweraexport.zip is attached at the end of the post

B. Package android wear project as module:

1.Ensure that both the watch and phone app modules have the same package name.

2.Copy the android wear project to visualizer app project.

3.Write a precompile task with below mentioned steps:

a.copy android wear module to build location.

b.Declare a Gradle dependency in app's build.gradle file that points to the watch app module as shown belown

dependencies {

wearApp project(':wearable')

}

c.Add "include ':wearable'" to settings.gradle.

Below is the snipet for androidprecompiletask.xml:

<target name="PreCompileSetup" >

<copydir dest="${app.dir}/wearable"

src="wearable"

/>

<concat destfile="${app.dir}/settings.gradle" append="true">${line.separator} include ':wearable'</concat>

<concat destfile="${app.dir}/build.gradle" append="true">${line.separator} dependencies { ${line.separator} wearApp project(':wearable') ${line.separator} }</concat>

</target>

4. Build the app in release mode in Kony IDE and sign the unsigned-release apk with private key.

For more information, please refer from the link(https://developer.android.com/training/wearables/apps/packaging.html) and sample app samplewearexport.zip is attached here.

This post is empty, no comment was left. Hopefully better content is forthcoming.