Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed the watch apk into phone apk?

I have both wear apk & phone apk. I have deployed them via play store using multi-apk deployment.

My watch apk is not the standalone app its companion to the phone application. I want the phone apk to embed watch apk & once people install phone apk watch apk should get instantly updated.

So how to switch from multi-apk play store deployment to embedded watch apk deployment?

Reason I am doing this is when I provide updated version it always take much time to update watch apk using wear play console. I think when I will deploy as embedded apk it will get update faster.

I am using wearable:2.3.0 library.

like image 691
Prashant Avatar asked Jul 16 '18 09:07

Prashant


People also ask

Can you install APK on Samsung watch?

Yes, it is possible to sideload and install an APK on the Samsung Galaxy Watch 4. However, the process is slightly tedious- you need to enable ADB over Wifi on the watch, connect it to a third-party app on your phone, and then sideload the APK.

How do I open an .APK file?

On your device, tap Settings > Apps. Tap Special access > Install unknown apps. Tap the browser from where you will download the APK, such as Chrome. If prompted, toggle Allow from this source on.

How do I open APK files on Android?

Just open your browser, find the APK file you want to download, and tap it – you should then be able to see it downloading on the top bar of your device. Once it's downloaded, open Downloads, tap on the APK file and tap Yes when prompted. The app will begin installing on your device.


1 Answers

If you set the wear app to standalone=false in the AndroidManifest.xml of your wear module, the wear apk will be updated automatically with your phone APK:

Distribution to Wear 2.0 watches On devices running Wear 2.0, when a user installs a phone app that has an associated watch app (either an embedded APK or an APK uploaded via the Play Console), the user gets a watch notification about the available watch app. Tapping the notification opens the watch Play Store, giving the user the option to install the watch app. Additionally: When you update a phone APK with a new embedded watch APK, the user's watch APK automatically is updated. When you upload a watch APK via the Play Console, you can update your Wear APK independently from the phone APK, and users receive updates via the watch Play Store. For an embedded watch APK, the user's watch APK is automatically updated when the APK on the phone is updated. In the case of multi-APK, the update behavior depends on the Play Store setting (Auto-update apps). It is strongly discouraged to have both an embedded APK and multi-APK for your app if they are not the same version. Take an example where you have an embedded APK v1, and multi-APK v2. If the embedded APK is installed first, the multi-APK version will replace the embedded APK since it is a higher version. Later, if a developer updates the phone APK to v3, an embedded APK will be automatically installed, overriding the higher version delivered via multi-APK.

    <!--
           Set to true if your app is Standalone, that is, it does not require the handheld
           app to run.
    -->
    <meta-data
        android:name="com.google.android.wearable.standalone"
        android:value="false" />

when you create a release, your APK should contain a micro apk within your release apk:

analyzed APK

When extract that APK and binary compare it with your exported wear app, you will see that they are identical. So you can assume, that the bundled APK will be always deployed with your release APK at least for non-standalone deployments.

like image 158
Denis Loh Avatar answered Nov 14 '22 22:11

Denis Loh