I'm currently developing an app mainly for WearOS which needs a phone companion to work. Due to the phone app needing quite powerful permissions (BIND_NOTIFICATION_LISTENER_SERVICE, QUERY_ALL_PACKAGES) I'll not have a good time releasing this on the PlayStore.
I want to release it open source on GitHub. This means I'll have the hassle of explaining the user how to sideload a WearOS app.
Is there a way to remotely install the WearOS app from within the phone app?
Related
I am new to application development for Android Wear. My company needs to deploy to the customer our Android Wear application without using Play Store.
I have read this
https://developer.android.com/training/wearables/apps/packaging.html
but I don't understand if it is possible to use the embedded method like wear 1.x on wear 2. I tried the embedded method but when I install the phone application and if I check the log of wear I can see this message:
I/PackageChangesService: App is not installed
Before posting this thread I read on Stack Overflow many possible solution for this, like using the same name space, same permission on phone and wear etc. But I can't find a solution that works.
So on an Android Wear 2 smartwatch it is not possible to use the packaging method?
From this article,
A Wear 2.0 user must visit the Play Store on their watch to install apps. There is no auto-install like on Wear 1.X. Wear 2.0 apps
get full network access and can be installed completely separately
from the handheld app so the focus is much more on standalone Wear
apps than the handheld centric 1.X Wear apps.
I have an Android Wear app (a watchface) that was originally created before Wear 2.0, so it is embedded in a phone APK. I am working on porting it to 2.0, and keeping it backwards compatible. It is standalone and requires zero connection to a phone.
I understand that for Wear 2.0, the only thing needing to be published for a standalone app is the Wear APK. I have been reading through Google's documents and recommendations for moving 1.x apps to Multi-APK instead of embedded. They are a bit vague, however, on if a standalone Wear 1.x app even needs a companion app. I'm asking about this because it seems strange that we would need a dummy app on the phone that does literally nothing, if the Wear app is now its own APK.
From my understanding, that is the case, unfortunately. Since there is no Play Store app on Wear 1.0 watches, it's not possible to install the standalone app directly. So a user needs to install the companion app on the phone, and Play Services should install the Wear app if there is a Wear 1.0 watch connected.
I have developed an android wear application and generated a signed mobile apk with a wear apk embedded in it. Currently it's under alpha testing.
Once after installing the app, the phone app is getting installed on the phone and the wear app is getting pushed to the wear device.
Phone app is a dummy app with only hello world text, I have created this dummy phone app with the purpose to push the wear app to android wear.
Now the question is after installing the app, how can I extract only the wear apk to android wear without installing the dummy phone app on phone?
Because it might not be a good experience for an user to see a helloworld text in the phone app.
Three-part answer:
First, with the arrival of Wear 2.0, "companion" apps will no longer be needed for distribution. Full details here: https://developer.android.com/training/wearables/apps/packaging.html
Second, while you're still supporting Wear 1.x, you could do something useful with your companion app's launcher Activity - even if it's only displaying some text like To use this app's functionality, run it on your watch. Because there will always be some less-knowledgeable users who expect to run an app from the launcher, and need some hand-holding.
Third: why do you even have an Activity with the launcher intent at all? Why not simply remove it from your package, or at least your manifest?
According to the Android Wear 2.0 guide, Android Wear 2 apps will be installed separately, one from the Play Store on the phone and one from the Play Store on the watch, unlike Android Wear 1.x apps which are packaged together
So guidelines suggest that app should notify user if companion application is required, but not installed on the connected device.
However, not all watches will get 2.0 upgrade and some will stay at 1.x. Those watches install apps companion automatically and if one is missing, it just means app takes a while to install through Bluetooth connection. Displaying "install companion app" notification would be meaningless on these watches as there is nothing user can do to speed up the process (there is on Play Store on older watches).
Now, the issue is that I can't find a way to display warning if connected 2.x watch does not have the app and at the same time not displaying the warning if connected watch is running 1.x.
Is there a good way to distinguish between the two different connected Android Wear versions?
There's not a good way to do this right now. It's been discussed a couple of times on the Wear developers G+ community, and the best we came up with is:
Go ahead and send the RemoteIntent to open the Play store.
Attach a RemoteIntent.ResultReceiver when you do so.
If the watch is running Wear 1.x, this will return with a resultCode of RESULT_FAILED, and you can show your user a message accordingly.
This is obviously not ideal; it involves a useless step (trying to open the Play store) for 1.x users, and there's also no way to distinguish any other possible failure modes. But as of today, it's the best we have.
Discussions:
https://plus.google.com/+SterlingUdell/posts/XJZ8mAsaZ8B
https://plus.google.com/u/0/+SterlingUdell/posts/WWBVxjcD7vT
I want to publish android wear2.0(standalone) apk to the playstore.My phone app is already published on the playstore with wear1.0.4 embedded apk.
Right now I am running wear2.0 apk on emulator for testing.
But I have no clue how to sync it with my android phone(without using bluetooth) or an iphone.
Please guide me.
The same way as Wear 1.0. The way I've been publishing the phone app and the wear app is that my wear app's version code is one higher than the phone app but since it differentiates by feature (watch), both are on the Play store simultaneously. The embedded apk for wear 1.0 goes to the watch with the phone app but wear 2.0 watches show a notification for the user to download your (wear 2.0) app from the watch play store.
As long as the package names are the same, you can sync data using the Data APIs. Less recommended but since the watch has Internet now, you can even sync in other ways.