Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Google Glass Programmatically

From a native application how can we detect Google Glass verses a smart phone from code?

Moving correct answer to question:

boolean isRunningOnGlass() {
     return "Google".equalsIgnoreCase(Build.MANUFACTURER) && Build.MODEL.startsWith("Glass");
 }
like image 246
Patrick Avatar asked Sep 10 '13 15:09

Patrick


2 Answers

Another way of doing this would be to use the Build API:

http://developer.android.com/reference/android/os/Build.html

like image 186
jeffrey_t_b Avatar answered Nov 16 '22 16:11

jeffrey_t_b


Using the GDK, you could use:

 boolean isRunningOnGlass() {
     return "Google".equalsIgnoreCase(Build.MANUFACTURER) && Build.MODEL.startsWith("Glass");
 }

(The model check may be good if a new model of Google Glas comes out.)

like image 4
ErstwhileIII Avatar answered Nov 16 '22 16:11

ErstwhileIII