同步移动应用程序到Android Wear应用程序、Android、Wear

由网友(咖啡不解酒的醉つ)分享简介:据商务部:包装我使用下面的code耐磨应用:According to the doc: Packing wearable Apps I am using the following code:dependencies {compile 'com.google.android.gms:play-services:5...

据商务部:包装我使用下面的code耐磨应用:

According to the doc: Packing wearable Apps I am using the following code:

dependencies 
{
  compile 'com.google.android.gms:play-services:5.0.+@aar'
  compile 'com.android.support:support-v4:20.0.+''
  wearApp project(':wearable')
}

我已经使用生成签名APK产生的发行版本。当我安装APK安装了Android应用程序磨损的第一次正确的事情正在按要求。

I have generated the release version using the Generate Signed APK. The first time when I install the apk the android wear app is installed properly things are working as required.

我卸载从我的移动应用程序。 Android的应用程序,磨损也将被卸载,没有任何问题,但如果我在我的手机重新安装应用程序,我没有看到在Android磨损的应用程序。我不知道为什么会这样。我曾尝试与相同的是采用Android穿那些做工精细兼容不同的应用程序。安装和卸载并重新安装,我可以看到他们在Android上的磨损模拟器。

I uninstall the app from my mobile. The android wear app also gets uninstalled without any issues, but if I install the app again in my mobile, I don't see the app in the android wear. I am not sure why this is happening. I have tried the same with different apps that that are compatible with android wear those work fine. Install and uninstall and install again, I can see them on android wear emulator.

下面是从我的应用程序文件夹中的文件build.gradle:

Here is the build.gradle file from my Application folder:

apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion '20.0.0'

defaultConfig {
    applicationId "com.ysk.notes"
    minSdkVersion 9
    targetSdkVersion 20
    versionCode 3
    versionName "1.02"
}
buildTypes {
    release {
        runProguard true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
 }
}

dependencies
      {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile project(':FacebookSDK')
        compile files('libs/activation.jar')
        compile files('libs/additionnal.jar')
        compile files('libs/mail.jar')
        compile 'com.google.android.gms:play-services:5.0.+@aar'
        compile 'com.android.support:support-v4:20.0.+'
        wearApp project(':Wearable')




        configurations
                {
                    all*.exclude group: 'com.android.support', module: 'support-v4'
                }
    }

有人可以让我知道我错了?

Can somebody let me know where I am going wrong?

推荐答案

我为你两个建议可能会有所帮助。

I have two suggestions for you that may help.

1)你提到,你正在使用的磨损模拟器,而不是一个真正的手表装置。我曾经历过与连接和同步模拟器的问题。尝试重置模拟器,并通过您的手机上Android Wear重新连接(又名运行的adb -d着TCP:5601 TCP:5601)。再次

1) You mention you're using the wear emulator instead of a real watch device. I have experienced issues with connecting and syncing the emulator. Try resetting the emulator and reconnecting through Android Wear on your phone (aka running adb -d forward tcp:5601 tcp:5601) again.

2)似乎有版本code在手机的一些缓存和它使用的知道,如果它需要重新同步和更新表的应用程序。尝试递增您的版本code,看看有没有什么帮助。

2) There seems to be some caching of versionCode on the Phone and it uses that to know if it needs to resync and update the app on the watch. Try incrementing your versionCode and see if that helps.

希望其中的一个帮助。

阅读全文

相关推荐

最新文章