Reputation: 239
I have installed new android wear SDK. Also have downloaded Android wear app from play store on my phone. I am able to connect my phone with Android wear simulator.
Now I want to give android wear support to an exisitng app. How do I achieve this?
Thanks in advance.
Upvotes: 23
Views: 8549
Reputation: 429
If anyone would still struggle the issue.
Short answer. Add this feature to your app manifest:
<uses-feature android:name="android.hardware.type.watch" />
Longer answer. It depends. I'm assuming that you have a mobile app, and you just want to to publish for the wear. In that case you need to create separate flavor of your app, which includes the feature from above and changes the target API. FYI Wear ecosystem is a bit different from mobile, ex before 23 there is no direct internet access, no keyboard and no accounts. So you probably want to target minApi 23 for wear flavor.
Further reading: https://developer.android.com/training/wearables/apps/standalone-apps
Upvotes: 2
Reputation: 69025
There are two parts to adding a wear module to existing android app. 1. Adding the module itself 2. Packaging it with existing android module
Marty has already explained the 1st part let me add details of the 2nd one -
dependencies {
compile 'com.google.android.gms:play-services:5.0.+@aar'
compile 'com.android.support:support-v4:20.0.+''
wearApp project(':wearable')
}
References
Upvotes: 4
Reputation: 1081
You need to import an Android Wear module. Right click on the your project and select "Open Module Settings" Then click the "plus" button which should bring up a wizard to add a Wear Module.
Upvotes: 16