Reputation: 495
I have created sample set up for Google glass on android device and this works.
Then I have tried installing hello world glass app on android device For creating custom application such as Hello Glass using github's hello glass project which after installation should respond to voice command "hello glass" and show new card which shows "Hello Sir or mam!.." But This Hello Glass voice command is not recognized by glass(i.e. constructed glass setup on android device) and there is no response shown.
thanks in advance.
Upvotes: 0
Views: 163
Reputation: 1804
You can't run a Glass app on an Android app if the app uses Glass-specific API, so if you want to have a single app that runs on both Glass and a non-Glass Android phone, you should test to see if your app runs on Glass or not and apply different code when needed. For example, you can code like this:
try {
Class.forName ("com.google.android.glass.timeline.TimelineManager");
Log.v(">>>", "TimelineManager found");
}
catch (ClassNotFoundException e) {
Log.v(">>>", "TimelineManager ClassNotFound");
}
try {
Class.forName ("com.google.android.glass.timeline.LiveCard");
Log.v(">>>", "LiveCard found");
}
catch (ClassNotFoundException e) {
Log.v(">>>", "LiveCard ClassNotFound");
}
String manufacturer = Build.MANUFACTURER; String model = Build.MODEL;
Log.v(">>>", "Build: " + manufacturer + ", " + model);
And the output on Glass will be:
04-26 08:00:49.616: V/>>>(1988): TimelineManager ClassNotFound
04-26 08:00:49.616: V/>>>(1988): LiveCard found
04-26 08:00:49.616: V/>>>(1988): Build: Google, Glass 1
but on a Nexus tablet will be:
04-26 08:19:27.128: V/>>>(23528): TimelineManager ClassNotFound
04-26 08:19:27.128: V/>>>(23528): LiveCard ClassNotFound
04-26 08:19:27.128: V/>>>(23528): Build: asus, Nexus 7
Upvotes: 1