【发布时间】:2014-09-22 04:22:46
【问题描述】:
我正在尝试为我现有的 Android 应用创建一个可穿戴应用。
使用 Android Studio,我能够一起创建移动应用和可穿戴应用。现在,我想在我现有的 Android 应用中使用这个可穿戴应用。
我们怎样才能做到这一点?
【问题讨论】:
标签: android eclipse android-studio wear-os
我正在尝试为我现有的 Android 应用创建一个可穿戴应用。
使用 Android Studio,我能够一起创建移动应用和可穿戴应用。现在,我想在我现有的 Android 应用中使用这个可穿戴应用。
我们怎样才能做到这一点?
【问题讨论】:
标签: android eclipse android-studio wear-os
将现有项目中的磨损模块(或手动构建)克隆为新项目。
添加您的settings.gradle 新模块。
你应该有这样的东西:
include ':myApp', ':wear'
在您的应用中,您必须在 build.gradle 中添加:
dependencies {
// your current dependencies
wearApp project(':wear')
// may be you have to use also gplay services lib. It depends by your app.
// compile 'com.google.android.gms:play-services-wearable:5.0.77'
}
注意包装。 穿戴和移动应用使用相同的包!
【讨论】: