Android Wear: How to install the application on mobile and Android Wear? - android

In Android Studio we have two folders
Mobile
Wear.
So which apk should I install on my smartphone, which would sync the corresponding setup to the Android Wear?

DEBUG :
You can install the Mobile apk on smartphone and Wear on your smartwatch, with ADB & plugged into USB
RELEASE :
Just install the Mobile apk on smartphone, this will sync to your wear

So which apk should I install on my smartphone, which would sync the
corresponding setup to the Android Wear?
That's true only when the apk is exported and signed with the production certificate. When you develop, you have to explicitly install the apk, on both devices. You just need to switch between the wearable and handheld application on AndroidStudio, in the drop down menu next to the run button, and choose the device, in the popup which prompt the attached devices

Easiest way to install wearable apk :
Make sure your package name of wearable and mobile are same.Go to AndroidManifest .xml file both these module and check whether these are same or not. If same then ok otherwise you have make them same.
Normally, There two apk's are available in wearable project one is "Mobile APK" and another is "Wearable APK".
We have to build signed apk for "Mobile apk". If any one doesn't know how to build signed apk you ca see this video - Click here
When APK build successfully you can find it in "Your_Project\mobile" folder.
Then send it to your phone which is connected to wearable device.
Then install it on your mobile.
When the handheld app will connect with the wear, it will install/update the wear-apk on the wearable device.
The mobile app can be empty, without Activities, but you have to declare the same package in AndroidManifest for both.

Related

CanĀ“t install android wear apk automatically from play store

I have created a demo project of wear in Android studio. So the two projects created automatically, the phone and the Android wear are linked correctly.
When I generate the apk of the phone project, the two apks are generated.
The phone apk I signed it and uploaded it to Google Play Alpha.
In generated phone apk, inside res/raw I can se wear apk. So the mobile apk contains the wearable apk properly.
I have real physical phone and Android wear emulator linked. When I link real device to emulator, in Android wear emulator my phones apps that have wearable version are installed automatically.
I download my app upload from play store alpha to my phone, but in my wear emulator wear version of my app is not installed.
Additional info:
-The wearable emulator does not contain any app with the same package name.
-I have done several tests creating a new emulator.
-In the emulator if I install the application directly with the play button of Android studio works correctly
The packaging and distribution of wearable apps changed with Android Wear 2.0. Wearable apps are no longer synchronized from the phone. Instead you need to upload a wearable APK to the Play Store.

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.

How is it possible to test a wear app is packaged correctly before publishing it to the play store?

The documentation for packaging wearable apps states:
"... If packaged properly, when users download the handheld app, the
system automatically pushes the wearable app to the paired wearable".
My question is how is it possible to test if the app is actually packaged properly? So that it will install correctly when its parent app is downloaded.
I thought I would be able to test it by:
- resetting the wearable device
- rooting the handheld device and placing the handheld apk in /system/app
- pair the device with the handheld and check the wearable app runs afterwards and thus it must have been installed.
However this didn't work as a test as the handheld app didn't run when placed in /system/app (I got a stopped running error, however the handheld app runs ok when installed normally via adb install).
So how is it possible to test the mobile app has been correctly packaged with the handheld app and will install before releasing it?
Simply check if under the raw package of your app was placed the apk of the wear app. You can open the apk with a simple zip. In addition you have to export your app signing with your key, install it on your smartphone. If the wear app is automatically installed on your smartwatch (or emulator) then the packaging is ok. No root or other operations are needed.

Installing wear only apk without ADB or Android studio or eclipse

I am working on an application, that is intended for Android wear devices only. I know Google play doesn't support apps that only run on wearable devices (not on handhelds), but this application is for internal purposes only.
I know these
1) I can install directly to wearable devices from eclipse/studio during debugging, just like I do it on handhelds
2) I can use adb command to install directly to wearable device.
But I have created a signed apk of the application, and I want to sent this build to client, who is not a developer and above 2 methods doesn't work. If I sent the apk to him by mail, is there any easy way for him to install it on his wearable?
Note : If it required, consider that client had a handheld device that can sync with this wearable.
You have to build the mobile-signed-apk.
It will contain also the wear-apk. You can send the mobile-signed-apk to your client /by email for example) and he has to install this apk in his handheld device as a normal apk.
When the handheld app will connect with the wear, it will install/update the wear-apk on the wearable device.
You can upload to your developer console it app as alpha and give access for client to alpha testing.

android - app installation

i developed a application and it works fine on the emulator, so tried to install it on my phone using a .apk of the file
(NOTE: It is a unSigned one).
on installing the app on the phone, during installation i get a error as installation failed.
(NOTE: Other applications from the market are installing without any errors, the ones downloaded from the internet are working fine, but one developed by me aren't)
tried to debug the application on my phone using USB debugging.
the app gets installed fine by USB debugging.
Still can't figure out how to install using the .apk file.
Thanks in advance. :)
You have to sign your application if you do not want to install it using adb. If you use Eclipse and ADT just click on your project folder, choose Android tools -> Export Signed Application Package. Then provide access (or create new) to your keystore file and choose key. After you've signed an application you can, for instance, send it by email and install it on a real smartphone.
What you can also do is copy the .apk to the phone via the ISB cable into the sim card out the SD card. Then you don't have to send any emails to yourself.

Categories

Resources