How to deploy phone app dependent android wear apps? - android

I want to deploy this App (https://github.com/pocmo/SensorDashboard) on my Phone and Wearable. Deploying the App on my Phone works fine. When I try to deploy the App on my watch like I deploy it on my Phone, I get the following Error: Error running wear: Default Activity not found.
I think that this Error is caused by the fact, that the App isn't a Standalone Wearable App and can't be deployed by selecting a deployment target as you would with a phone . When I look in the AndroidManifest.xml the meta-data tag looks like this:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
How can I deploy this App on my watch?
(I want to know how the deployment works manually and I don't want to download the App from the Play Store)

The project has no activity because it's a service. In such a Project one has to go in Android Studio under Run/Edit Configurations -> General -> Launch -> select the option "Nothing". After this the app can be deployed on the watch by selecting a deployment target as you would with a phone.

Related

Running a app-debug.apk or app-release.apk on Samsung Galaxy S10

I am developing an application Android Studio 4.1.1 and debugging on a Samsung Galaxy S10.
I can successfully debug the application on the S10 from the Studio.
When I use the Studio to create an app-debug.apk or app-release.apk and use Apps -> Special Access -> Install unknown apps -> Cx File Explorer, I get the following:
a. Blocked by Play Protect ---> Install anyway
b. Package Installer - "Done" is highlighted, but "Open" is greyed out
c. Apps - shows the apk and its memory, etc but is not executable
I've tried most of the procedures shown in recent posts but with the same results.
How can I install the app on my phone to use and test without trying to go through Play Store?
Somehow android:name="android.intent.action.MAIN" got changed to android:name="android.intent.action. MAIN" in the AndroidManifest.xml.
A space between action. and MAIN

Android: missing feature watch error

I developed wear app and mobile app separate with the same package name. After that I embedded the signed wear apk to the Mobile app SDK.
After embedded when I try to run into mobile am getting an error "MISSING features watch"
For embedded am following
1. Copy the signed wearable app to your handheld project's res/raw directory
2. Create a res/xml/wearable_app_desc.xml
<wearableApp package="wearable.app.package.name">
<versionCode>1</versionCode>
<versionName>1.0</versionName>
<rawPathResId>wearable_app</rawPathResId>
</wearableApp>
Add a meta-data tag to your handheld app's application tag
Am not getting why the issue occurs.am using all the user permission which i used in the wear sdk in mobile sdk
Please help me to solve the issue
Solution 1:
I don't know whether you are giving the below feature tag in the AndroidManifest.xml file in the wearable app module. If not, please give it which will solve your problem.
<uses-feature android:name="android.hardware.type.watch"/>
Solution 2:
If you are having different flavours for your mobile app and having only one flavour for the wear app, you need to use the application id of the flavour you used in mobile app in the wear app.
For example: Say you are having two flavors for mobile app
1. com.wear.app.prod
2. com.wear.app.dev
If you are using com.wear.app.prod, the same should be used for your wear app. If you changed to com.wear.app.dev, then the application id of the wear app should be changed to com.wear.app.dev.
Note: This is for apps having only one flavour for wear app and multiple flavours for the mobile app.
in android studio beside device chose, you can chose your package, select the app , not the wear module and run the project.

Run Android wear app

I want to create an Android wearable app on Android studio. I have installed the apk file on mobile to test run it. I would like to know how I can run the same apk on wearable device.Also, apk file created on Studio is different for wearable and mobile devices. How can we run it? Thanks in advance!
As it mentioned at official website you need to create special package signed by release key. See more info about packaging here.
When developing, you install apps directly to the wearable like with handheld apps. Use either adb install or the Play button on Android Studio.
Note: The automatic installation of wearable apps does not work when you are signing apps with a debug key and only works with release keys.
During the development period, do not use release key for signing. Instead, you should build your app which would result in two apks, one for the phone and one for the wear device. Then install each of them separately on the corresponding device using adb or Android Studio. Make sure you are using the same package names for both apks.
When you are done with your development, then build the app with your release key; then the wear apk will be embedded inside your phone apk and installation of your phone apk on a phone will result in the installation of the embedded wear apk on the wear device (make sure you remove the dev apks from both devices prior to this step otherwise installation will fail due to different keys).
Trying to debug through Android Studio as suggested by Julia and Ali, but it is always showing me Parse error while installing or running the code.
I have created a project for both mobile and wear. While running for mobile it works fine in the mobile device but while running the code in the wear it always shows Parse error.
I am using Moto 360 for running and debugging.

Android wear packaging 1 compatible device

I had an app uploaded in google play, but now I have done a update with Android Wear. I have my project in Android Studio with the mobile and the wear APK in the same project and with the same package. It runs perfectly in debug mode. I can export the new update of my app with the Android Wear app embebed, but when I upload it with the Google developer console shows that there are only one compatible device.
Attached Images:
How can i make my wear app to be compatible with more than 1 device? :-)
You shouldn't have the permission android.hardware.type.WATCH in the Play Store permissions.
This is only required for the wear application.
Remove it from your AndroidManifest.xml mobile application, it looks like:
<uses-feature android:name="android.hardware.type.watch" />

"No, missing feature: WATCH" when I try to run my smartphone app with wear app?

I have a smartphone app with a wear app that has been packaged inside of it, similar to the first two steps of this section:
https://developer.android.com/training/wearables/apps/packaging.html#Studio
I was originally told that my smartphone wasn't running an SDK large enough to support the app (my phone was using KitKat, apparently I needed API 20), so now I am using my Nexus 7 with Android L preview, and this problem has appeared:
I have a smartwatch emulator and tablet running, and both are connected using the adb -d forward tcp:5601 tcp:5601 trick, so I have no idea how to fix this now!
How can I get the smartphone app to run and automatically allow the wear app to install onto the emulator?
Please look at this!
May be you should select the APP item before you launch your app.
In your project you have two applications:
Mobile
Wearable
Mobile app should be installed on mobile device (phone/tablet) and Wearable app should be installed on Android Wear device.
This message No, missing feature: WATCH means that you're trying to install Wearable app on mobile phone - you shouldn't do that, your mobile device is not a WATCH. So once again: just launch Mobile app on mobile and Wearable app on Android Wear.
I was originally told that my smartphone wasn't running an SDK large
enough to support the app (my phone was using KitKat, apparently I
needed API 20), so now I am using my Nexus 7 with Android L preview,
and this problem has appeared:
Only the Wearable app should require API level 20, but Mobile app can target any other SDK level (like 10, 14 etc.). You don't need to set higher SDK level for Mobile app only because it supports Wearable app.
How can I get the smartphone app to run and automatically allow the
wear app to install onto the emulator?
As described in the tutorial that you've linked:
If packaged properly, when users download the handheld app, the
system automatically pushes the wearable app to the paired wearable.
But please read the note at the top of this page:
Note: This feature doesn't work when you are signing your apps with a
debug key when developing. While developing, installing apps with adb
install or Android Studio directly to the wearable is required.
This means that automatically installing Wearable app after installing Mobile app (with Wearable app packaged inside) will only work after signing app with your publishing certificate (and not with the debug one - as is done during standard application Launch from Android Studio/Eclipse).
I had the same error when I tried running non wearable application on my device and the error was due to some Android Studio issue with misreading the uses-feature attribute in the Manifest (it reads required false as true):
<uses-feature
android:name="android.hardware.type.watch"
android:required="false"/>
If you remove it from the manifest the error will disappear. I think that it should be already fixed in Android Studio 1.4.1 or 1.5.
Check if you have not open any other android project. I also faced same issue which got solved after I closed android project which has target API greater than watch's.

Categories

Resources