Manually playing Android Wear APK package

Source: Internet
Author: User

If you use the Google official recommended integrated development IDE Android Studio development, will automatically generate two projects, one on the phone side, one is the watch side.

But if you use the Eclipse environment, if you want to hit your watch apk into your phone apk, you need to be aware of the following points:

1. The permission in the wearable app should also be added in the mobile app;

2, ensure that the wearable app and mobile app have the same package name and version number;

3. Put the signed wearable app in the Res/raw directory of the mobile app project, assuming the wearable app uses the name wearable_app.apk;

4. Create a Res/xml/wearable_app_desc.xml file that includes the version and path information of the wearable app

<wearableapp package= "Wearable.app.package.name" > <versionCode>1</versionCode> <versionname& Gt;1.0</versionname> <rawPathResId>wearable_app</rawPathResId></wearableApp>

where Package,versionvode and versionname need to be the same value in the androidmanifest.xml of the wearable app.

Respathresid is the name of wearable apk, for example: wearable_app.apk respathresid for Wearable_app.

5. Add <meta-data> to indicate Wearable_app_desc.xml file in the <application> tag in the mobile app's Androidmanifest file

<meta-data android:name= "Com.google.android.wearable.beta.app" android:resource= "@xml/wearable_app_desc"/>

6. Build Signature mobile App

7. Turn off asset compression

Many compilation tools compress files in the Res/raw directory. Since the APK package has been compressed into the zipped format, many of the compilation tools will be compressed again, causing the wearable app installer to not be properly left alone in the wearable app, prompting the following error:

Packageupdateservice: "This file cannot was opened as a file descriptor, it is probably compressed."

Android Studio does not compress the wearable apk again by default, but you need to be aware of this with other compilation tools.


Manually playing Android Wear APK package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.