Ers*_*III 5 google-glass google-gdk
我想创建一些实用程序类,以便在Android手机和Google Glass上使用(使用GDK).在Glass上运行时需要注意一些差异(例如获取位置).
是否有一些静态方法调用可以使用或以其他方式确定代码是否在Glass上运行?
好的..这是一种可以用来确定代码是否在 Google Glass 设备上运行的方法(汇总来自 Jeff Tang 的信息):
/** Determine whethe the code is runnong on Google Glass
* @return True if and only if Manufacturer is Google and Model begins with Glass
*/
public boolean isRunningOnGlass() {
boolean result;
result = "Google".equalsIgnoreCase(Build.MANUFACTURER) && Build.MODEL.startsWith("Glass");
Log.d(getLocalClassName(), "Running on Glass = " + result + "Manufacturer is " + Build.MANUFACTURER + ", Model is " + Build.MODEL);
return result;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
351 次 |
| 最近记录: |