简体   繁体   中英

Android Wear - Launching Google Play on Phone

I have followed the sample here: https://github.com/googlesamples/android-WearVerifyRemoteApp . I ran the app on Wear Emulator (Android 6.0.1). I reached the point where the app is not installed on phone and want to launch the app link on Google Play on the device:

// Create Remote Intent to open Play Store listing of app on remote device.
            Intent intentAndroid =
                    new Intent(Intent.ACTION_VIEW)
                            .addCategory(Intent.CATEGORY_BROWSABLE)
                            .setData(Uri.parse(PLAY_STORE_APP_URI));

            RemoteIntent.startRemoteActivity(
                    getApplicationContext(),
                    intentAndroid,
                    mResultReceiver);

I attached the debugger and, yes, I reached this line, but nothing happens. Google Play is not launched on the phone. I am sure I am connected to the phone as other notifications from the phone (real device) appears on the emulator.

Edit:

Not clear why but connection from the phone to the emulator is really buggy. It's really frustrating and the issue was solved but disconnecting and reconnecting many times.

AFAIK, you need to have a phone APK and a watch APK in your Android Wear app then you must use the Multi-APK delivery method . which is, as mentioned,

Multiple APK support is a feature on Google Play that allows you to publish different APKs for your application that are each targeted to different device configurations.

If you haven't done so, try enabling Advanced mode in your application's APK files tab to be able to publish multiple APKs for your app.

For more information, see Packaging and Distributing Wear Apps .

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