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.
Related
I have uploaded an App on Google Play Store. I able to download it in mobile phone but it is not available for Tablets.
When i try to download it in Tablet its shows an error something like "This app is only design for phones"
Please help me.. what have i done wrong??
Here is my AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.AnTim.mediteam"
android:versionCode="3"
android:versionName="1.2" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="com.AnTim.mediteam.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.AnTim.mediteam.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="com.AnTim.mediteam.Controller"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.AnTim.mediteam.MainActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DELETE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="com.idrivecare.familypro" />
</intent-filter>
</activity>
<activity
android:name="com.AnTim.mediteam.Internet_connection"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Internet"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Preference"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.GuestMenu"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Privacy"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Terms"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Forgot_password"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Registration"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Sucessfull_register"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Patient_menu"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Web"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.AnTim.mediteam.Best_doctor"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.AnTim.mediteam" />
</intent-filter>
</receiver>
<service android:name="com.AnTim.mediteam.GCMIntentService" />
</application>
According to this:
http://arstechnica.com/gadgets/2013/11/google-play-rolls-out-designed-for-phones-tag-of-shame-on-tablets/
"Apps that don't include certain tablet enhancements will display a "designed for phones" tag on the tablet version of the Play Store, making users with tablets less likely to install them."
I guess this is the reason why you get this message. You probably didn't include those "tablet enhancements"
Your app uses feature "android.hardware.telephony". If the tablet doesn't have the dialer and a data network the app will not be compatible in that device.
I know I'm slightly late, but better late than never.
As suggested by #SauravGhimire it was the telephony access that broke compatibility.
This would be true if required = true. However, your code specifies required = false:
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
This shows that the app uses telephony on compatible devices, and on devices that doesn't have telephony access, your app has something set up that doesn't use telephony on unsupported devices. This would mean you maintain support for tablets.
The screen sizes supported would help Google Play see that you have added support somehow for tablets. AFAIK, declaring that tag and not adding special layouts doesn't show designed for tablets, nor does it show designed for phones. This is the point where your app supports both phones and tablets, but isn't specifically designed to take advantage of the extra room on tablets.
As #Hans1984 said, you may not receive installs if your app gets a "designed for phones label".
Not sure how this worked in 2015, but now you can download apps even if they are designed for phones. The "designed for phones" tag is just a way that tablet users can be "warned" that this app may not be as good on a tablet as on a phone.
I have downloaded "designed for phone" apps on my tablet, and I have done it on android 5, 6 and 7 without any problems. Maybe some devices have a warning like that (or some don't). Could also be a problem with the custom permission you have (com.AnTim.mediteam.permission.C2D_MESSAGE)
It is very hard to say why exactly you got the error, but you have done everything in the right way that should prevent the "designed for phones" label, and (assuming you don't have special tablet layouts) you will nto get the "designed for tablets" label either (the last label means it is also designed for tablets, that there is special support for it. There is also support for phones). Could be that an older version (beta/alpha/production (old version)) didn't support it and you tried to download too soon. Google Play needs a lot of time to process updates. Adding layouts for tablets is also a fix for this.
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!
My manifest file is as below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.demo.myglassapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
<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>
<service
android:name="com.demo.myglassapp.MainActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger_start" />
</service>
</application>
</manifest>
voice trigger start file
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="#string/its_demo" />
My strings.xml file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">myglassapp</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="its_demo">Hello Sir</string>
</resources>
As per my knowledge I have added a code block
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
in manifest file. I created a voice trigger file and set a variable in it.
Now i call that variable from strings.xml file.
So, basically it is all correct but i do not see "Hello Sir" added to my OK GLASS menu.
When I run my application from Eclipse IDE, i do not see my menu after OK GLASS menu option.
In stead, I see my app directly running like it runs in Android phone when we set it in debug mode.
Any idea why it is not working?
I agree with Nicole. Maybe if you move some stuff around it may work. But, it depends a lot on how you are building your app. In my case, for example, the voice trigger intent is define for my activity, not my service (Similar to Nicole's case). However, I have seen some examples where the trigger is on the service. You can check those examples by creating a sample Android project in Eclipse.
Now, the reason why your app is opening after you run it similarly to a mobile is because you have this on your manifest
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
You should remove that if you dont want that behavior
In your glass itself you say your application name it will show the list of app
Try this Hope this will help
I am new to glassware development.. but maybe try moving some things inside your application tag in manifest (instead of the service tag.. I do not have a service tag at all). Here's an example of my manifest file that works with voice recognition from the start menu...
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger_start" />
</activity>
</application>`
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.
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.