Voice command not working on my glass app - android

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>`

Related

unfortunately package installer has stopped android

I want to create a live wallpaper in android. My app works fine on emulator but on my phone, I am not able to install it.
Here is my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.BIND_WALLPAPER"
android:supportsRtl="true"
android:debuggable="false"
android:theme="#style/AppTheme">
<service
android:name="GIFWallpaperService"
android:enabled="true"
android:label="Wallpaper Example "
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" >
</action>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/wallpaper" >
</meta-data>
</service>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
wallpaper.xml :
<?xml version="1.0" encoding="UTF-8"?>
<wallpaper
xmlns:android="http://schemas.android.com/apk/res/android"
android:label="GIF Wallpaper"
android:debuggable="false"
android:thumbnail="#mipmap/ic_launcher">
</wallpaper>
Whenever I try to run my code on emulator everything works fine but when I copy
"app-debug" to my phone and try to install it does not work.
After installation is complete I get two options :
Open the app.
Done.
If I click Done nothing happens and afterwards if I click my installed app icon it says app is not installed.
If I click open at the end of installation it says unfortunately package installer has stopped android
Debuggable is set to false right? Does not that mean that you can not debug with it? Try removing 'android:debuggable="false",'and see if it works.
I found my answer here :
Android Permission Denial starting Intent for Wallpaper Settings
I had android:permission="android.permission.BIND_WALLPAPER" at the wrong place.

Android multi-process application

I have been wondering 1 thing about running multi-process app on Android.
Say, I have a setup in the manifest file as follow..
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.multiprocess">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MainService"
android:process=":main" />
<service
android:name=".SubService"
android:process=":sub" />
</application>
</manifest>
With this, when I start both services with startService() and I will see each process listing separately on system's "Running services" page. (See image below)
I would like to know how can I get both processes list under 1 name like Google Play services does? (see image below)
Probably, they use android:sharedUserId for all of their processes. But in any case you can figured that out by extracting AndroidManifest.xml from Google Play *.apk file and analyze it

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.

stuck application at the same view even the class of that view is removed

Im working with an android application ,even if I change the names of classes at AndroidManifest.xml the application still work and installing on the tablet but the weird thing that even I removed the launcher activity from the manifest I still got it when I run the app the same xml view !!!
As an indication Im using Maven too.
I think the problem comes from Maven
this is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapps.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity android:name="com.myapps.android.project.login.Connection"
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="com.myapps.android.project.login.Connection" >
</activity>
</application>
</manifest>
I tried:
removing the R file
undeploying the application from the device with this comand:
mvn android:undeploy -Pandroid-15 -Dandroid.device=usb
Uninstall the application manually from the device
removing maven android folder from .m2/repository
I still got the same activity while deploying the application to the device
First of all, there is a little problem in your manifest: you are defining the same activity twice:
<!-- First time definition of "com.myapps.android.project.login.Connection" -->
<activity android:name="com.myapps.android.project.login.Connection"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Second definition of "com.myapps.android.project.login.Connection" -->
<activity android:name="com.myapps.android.project.login.Connection" >
you should remove the second one, it doesn't make sense to have a duplicated definition.
Did you change the Connection.java and/or Connection.xml and nothing hapened?

app appears in Manage Applications, but not on the main menu

I'm using Eclipse to make an Android app. I've used it before and not had this problem. The console says everything installed ok, so I'm a little confused. I'm not sure what is relevant from logcat, but I can post it if you think that would help.
I've restarted Eclipse, ADB, the emulator, and the Mac several times in various orders and nothing has helped. I know it must be something simple but I haven't played around with this in a few months.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hyser.pinpoint"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
</application>
<activity android:name=".pinpoint" android:label="pinpoint">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Your Activity needs to be inside of your application tag in your manifest
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name=".pinpoint" android:label="pinpoint">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
It's a similar issue to this:
Unable to start Service Intent
Your <activity> tag needs to be in the <application> block.
Is it possible your manifest does not refer to any activities? If you install an app with no activities in the manifest you will get this behavior.

Categories

Resources