Installing wear/mobile app on android wear device does not work - android

I have developed a android wear demo application. The Android wear description mentions that the wear application is automatically installed on the wear device when installed on the mobile device.
My problem is now that this does not work. The app was created with Android studio.
Wenn I start the waer (sided) app with debugging enabled it installs the app on the wear device and it works ok. Once I install the mobile app (which includes the waer app) the wear on the wear device is deleted, bit the waer not installed on the wear device anymore.
Same happens when I want to debug the apps. Whenever I debug the mobile app the app on the wear device is deleted but not installed.
As written the curios thing is that I can install the wear app directly from within Android stuudio.
All the settings look ok, created automatically by Android studio.
The mobile manifest looks like that:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.waldhoer.klemens.klemenswearsampleapp" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".KlemensActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".FallRecognitionService" android:enabled="true"></service>
<service android:name=".DataLayerListenerService" android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
<uses-permission android:name="android.permission.BODY_SENSORS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
The wear manifest like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.waldhoer.klemens.klemenswearsampleapp" >
<uses-feature android:name="android.hardware.type.watch" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault" >
<activity
android:name=".KlemensWearActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".WearFallRecognitionService" android:enabled="true"></service>
<service android:name=".DataLayerListenerService">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
<uses-permission android:name="android.permission.BODY_SENSORS" />
</manifest>
I also created a release version of the (mobile) app with Key signed, did not change anything.
Any idea what could be wrong? Thanks for help!

Related

Error parsing the package

This error keeps comes on my phone but it did not come before,I saw all the stack overflow methods but non of them could help me.
I get this error when I test the app from android studio to my phone.I tried on other phones too but still the problem exist.
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.patel.pritesh.smstimer">
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/sms_timer"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".Time_Picker"
android:theme="#style/AppTheme.NoActionBar" />
<receiver
android:name=".MyReceiver"
android:enabled="true"
android:excludeFromRecents="true"
android:exported="true"
android:process="remote"
android:taskAffinity="">
<intent-filter>
<action android:name="SEND" />
</intent-filter>
</receiver>
<receiver
android:name=".NotificationReciever"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="notification" />
</intent-filter>
</receiver>
<receiver
android:name=".deliveryReciever"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="notification_delivered" />
</intent-filter>
</receiver>
<activity android:name=".sms_list">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".sms_review" />
<service
android:name=".alarmService"
android:enabled="true"
android:exported="true"></service>
</application>
</manifest>
This error comes in the run tab:
Unexpected error while executing: am start -n "my.patel.pritesh.smstimer/my.patel.pritesh.smstimer.sms_list" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity
Main tag of manifest file must be manifest. Instead of xml tag, write something like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.dummy"
android:versionCode="100"
android:versionName="1.0.0" >
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/sms_timer"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
...
</application>
</manifest>
As you are using Android Studio, I believe that you are likely have the problem mentioned in this question, and as mentioned here in the answer this error happens when you change the build version for your project (like downgrading or upgrading):
I've been working on this same exact problem for the last 8
hours...you've had no issues after rolling back from 2.0 to 1.5.1?
I've noticed that, even with the error, running the app works fine
sometimes.
so you have to make sure that there is no problem with the new release you are using, then you have to clean and rebuild your project again like mentioned here.
Or you can use the following hint from this answer:
Remove the .idea folder and gradle folder, then click button sync
project with gradle gradle files, after this process finished, you are
able to run your app as normal.

Android app running when deployed via Android Studio but not installed on phone

When running my app on my device straight from android studio, its running fine when deployed but its not actually installing - as in no icon in the menu etc (but it is in the settings under apps). Any help to solve would be great.
manifest is below.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.uk.malleymob.morecheatsforsims4" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MainActivity" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".generalCodes"
android:label="#string/title_activity_general_codes" >
</activity>
<activity
android:name=".interactions"
android:label="#string/title_activity_interactions" >
</activity>
<activity
android:name=".skills"
android:label="#string/title_activity_skills" >
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity" />
<activity
android:name=".simCheats"
android:label="#string/title_activity_cheats" >
</activity>
</application>
</manifest>
thanks in advance
Contrary to popular belief the action of this intent filter is not supposed to contain the activity's class name. This should fix it:
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
It is definitely installed on the phone, if it was run on the phone.
You could try compiling the apk and manually installing with adb:
I assume you are using gradle to build:
From project directory root:
View build tasks:
./gradlew tasks
./gradlew assembleDebug
The apk would be created in app/build/outputs/apk/
Now cd to that directory and run:
adb install my-app.apk
Make sure your device or emulator is connected

Voice Capabilities in Android Wear

I am trying to add Voice Capabilities in Android Wear and following below URL
https://developer.android.com/training/wearables/apps/voice.html
Here is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demowearapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature android:name="android.hardware.type.watch" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-sdk
android:minSdkVersion="20"
android:targetSdkVersion="20" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".TaxiActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.google.android.gms.actions.RESERVE_TAXI_RESERVATION" />
</intent-filter>
</activity>
</application>
</manifest>
But when i am trying below voice commands in my LG G watch it doesn't open my activity...it just showing Google search results
"OK Google, get me a taxi"
"OK Google, call me a car"
Thanks.
The wearable doesn't know this is a wear app. Wear apps need this in their manifest: <uses-feature android:name="android.hardware.type.watch" />
Had the same problem. The solution was to add the category android.intent.category.DEFAULT to the intent filter:
<activity android:name=".TaxiActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="com.google.android.gms.actions.RESERVE_TAXI_RESERVATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
If you open the Android Wear app on the phone you can verify that your app is available under "Call a car" beneath "Voice actions".
For non-English speakers still having problems using the voice command you should double check the language used for voice commands on your device. Change it to English and try it out. If that still doesn't work you can try changing the device's language to English also.

App Not Showing in Apps

I'm debugging using my Samsung Galaxy S5 and every time I run it through Android Studio it works fine and it pops up the app, but then when I click out of it it doesn't show in all of my apps like other apps I've installed to my device. The app will show in my task manager after I close out of it but it still won't show in all of my apps. Really could use some help on this one, thanks.
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="us.bisonsoftware.tab" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="Husky Athletics"
android:theme="#style/CustomActionBarTheme">
<activity
android:name=".TabBarExample"
android:label="Husky Athletics"
android:icon="#drawable/ic_launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<data android:scheme="geo"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".FirstTab" />
<activity android:name=".SecondTab" />
<activity android:name=".ThirdTab" />
</application>
<uses-permission android:name="android.permission.INTERNET" ></uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
Try to make your activity name complete like this:
<activity
android:name="com.example.myapp.TabBarExample"
... >
</activity>
I dont know your package name. You have to fill it by yourself.

Googlemaps on android is showing grey screen

I've just gotten my google maps application to not crash on startup, but now, when it opens, it just shows a grey/white background and buttons for zooming. I searched the web and I found that this may be a problem with my API-key, so I got a new key from google, but this didn't work either.
Here's a screenshot of how it looks.
link to image (I'm a new user, so I couldn't post a picture here)
Here's my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidbasic12"
android:versionCode="1"
android:versionName="1.0"
>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="come.example.androidbasics12.permission.MAPS_RECIEVE"
android:protectionLevel="signature"/>
<uses-permission
android:name="com.example.androidbasics12.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/new_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- First xml to be loaded -->
<activity
android:name="com.example.androidbasic12.MainActivity"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Opens main menu after splash has loaded -->
<activity
android:name=".myMenu"
android:label="#string/app_name"
android:screenOrientation="portrait"> >
<intent-filter>
<action android:name="com.example.androidbasic12.CLEARSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Opens test -->
<activity
android:name=".tutOne"
android:label="#string/app_name"
android:screenOrientation="portrait"> >
<intent-filter>
<action android:name="com.example.androidbasic12.TUTONE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Opens map page -->
<activity
android:name=".map"
android:label="#string/app_name"
android:screenOrientation="portrait"> >
<intent-filter>
<action android:name="com.example.androidbasic12.MAPS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBcMOBc8WVLUIRUfs0Zgap3cnhwm4dWLag"/>
</application>
</manifest>
Anyone got any tips for this?
I've got the same problem as you, everything worked ok on emulator but on the real device it was gray surface with zoom buttons.
Then I tried other devices and it works. All other phones have original (stock) firmware, only I have one with custom firmware.
lease first check that everything works fine on emulator, then check on the device with stock firmware and let us know the result.
The problem may not be with your API key, but the authorized apps in the API console. Make sure you registered the correct key(s) and package names with the Google API console. Specifically, if you are compiling and launching directly from eclipse, you are probably signing in debug mode. If so, you need to add your debug key hash + package name to the allowed applications in the API console.

Categories

Resources