简体   繁体   中英

Android Wear: How to install the application on mobile and Android Wear?

In Android Studio we have two folders

  1. Mobile
  2. Wear.

So which apk should I install on my smartphone, which would sync the corresponding setup to the Android Wear?

DEBUG :

You can install the Mobile apk on smartphone and Wear on your smartwatch, with ADB & plugged into USB

RELEASE :

Just install the Mobile apk on smartphone, this will sync to your wear

So which apk should I install on my smartphone, which would sync the corresponding setup to the Android Wear?

That's true only when the apk is exported and signed with the production certificate. When you develop, you have to explicitly install the apk, on both devices. You just need to switch between the wearable and handheld application on AndroidStudio, in the drop down menu next to the run button, and choose the device, in the popup which prompt the attached devices

Easiest way to install wearable apk :

  1. Make sure your package name of wearable and mobile are same.Go to AndroidManifest .xml file both these module and check whether these are same or not. If same then ok otherwise you have make them same.

  2. Normally, There two apk's are available in wearable project one is "Mobile APK" and another is "Wearable APK".

  3. We have to build signed apk for "Mobile apk". If any one doesn't know how to build signed apk you ca see this video - Click here

  4. When APK build successfully you can find it in "Your_Project\\mobile" folder.

  5. Then send it to your phone which is connected to wearable device.

  6. Then install it on your mobile.

  7. When the handheld app will connect with the wear, it will install/update the wear-apk on the wearable device.

  8. The mobile app can be empty, without Activities, but you have to declare the same package in AndroidManifest for both.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM