我想通过与Mirror API Get Directions菜单类似的方法,与Glass上的路线功能绑定.有没有办法通过GDK应用程序中的URI启动方向?
对于谷歌玻璃应用,我需要重写的快捷相机的按钮在谷歌眼镜.
让我解释一下这个场景:Google glass有快捷键相机按钮,有助于更快地捕捉图像.捕获可以通过电子邮件和其他选项共享的图像.对于应用程序运行时的项目要求,我需要使用户无法访问相机按钮,以便用户无法捕获图像并将图像发送给其他任何人.
如何在应用程序内部实现此选项?
我们正在尝试实施GDK玻璃器皿验证; 已将我们的测试版APK上传至Google Glass团队,并成功实施了我们的MyGlass登录页面.我们现在尝试通过此处列出的步骤访问令牌:https://developers.google.com/glass/develop/gdk/authentication#retrieving_accounts_on_glass
然而,最后一步,String token = future.getResult().getString(AccountManager.KEY_AUTHTOKEN);导致以下异常:
09-22 18:07:24.126: I/AccountManagerService(519): Sharing credentials is not allowed: canceling.
09-22 18:07:24.313: W/System.err(5822): android.accounts.OperationCanceledException
09-22 18:07:24.313: W/System.err(5822): at android.accounts.AccountManager$AmsTask.internalGetResult(AccountManager.java:1503)
09-22 18:07:24.313: W/System.err(5822): at android.accounts.AccountManager$AmsTask.getResult(AccountManager.java:1531)
09-22 18:07:24.313: W/System.err(5822): at android.accounts.AccountManager$AmsTask.getResult(AccountManager.java:1452)
09-22 18:07:24.313: W/System.err(5822): at com.mycom.app.MainActivity$5.run(MainActivity.java:234)
09-22 18:07:24.313: W/System.err(5822): at android.accounts.AccountManager$11.run(AccountManager.java:1427)
09-22 18:07:24.313: W/System.err(5822): at android.os.Handler.handleCallback(Handler.java:733)
09-22 18:07:24.313: W/System.err(5822): at android.os.Handler.dispatchMessage(Handler.java:95)
09-22 18:07:24.313: W/System.err(5822): at android.os.Looper.loop(Looper.java:149)
09-22 18:07:24.313: W/System.err(5822): at android.app.ActivityThread.main(ActivityThread.java:5061)
09-22 18:07:24.313: W/System.err(5822): at java.lang.reflect.Method.invokeNative(Native Method)
09-22 18:07:24.313: W/System.err(5822): at …Run Code Online (Sandbox Code Playgroud) android accountmanager google-glass google-mirror-api google-gdk
我可以在Glass上运行示例APK CompassActivity应用程序,但是LevelActivity或StopWatchActivity没有运气吗?我正在使用Eclipse.记录下面.有什么建议?
[2013-07-29 17:02:18 - LevelActivity] ------------------------------
[2013-07-29 17:02:18 - LevelActivity] Android Launch!
[2013-07-29 17:02:18 - LevelActivity] adb is running normally.
[2013-07-29 17:02:18 - LevelActivity] No Launcher activity found!
[2013-07-29 17:02:18 - LevelActivity] The launch will only sync the application package on the device!
[2013-07-29 17:02:18 - LevelActivity] Performing sync
[2013-07-29 17:02:28 - LevelActivity] Uploading LevelActivity.apk onto device '015DA7720F00D016'
[2013-07-29 17:02:28 - LevelActivity] Installing LevelActivity.apk...
[2013-07-29 17:02:29 - LevelActivity] Success!
[2013-07-29 17:02:29 - LevelActivity] /LevelActivity/bin/LevelActivity.apk installed on device
[2013-07-29 17:02:29 …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Google Glass中显示实时相机预览.
我正在使用所有相机默认设置(并且还尝试使用一些不同的图像格式;理想情况下,我可以使用其中一种YUV格式),但显示屏中显示的图像是乱码,如下所示:

布局很简单:
<?xml version="1.0" encoding="utf-8"?>
<TextureView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scan_preview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
Run Code Online (Sandbox Code Playgroud)
这是活动代码:
public class ScanActivity extends Activity {
private static final String kTag = ScanActivity.class.getSimpleName();
private TextureView mVideoCaptureView = null;
private Camera mCamera = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scan);
setTitle(R.string.title_scan);
mVideoCaptureView = (TextureView) findViewById(R.id.scan_preview);
mVideoCaptureView.setKeepScreenOn(true);
mVideoCaptureView.setSurfaceTextureListener(new VideoCaptureTextureListener());
}
@Override
protected void onPause() {
super.onPause();
stopVideo();
}
@Override
protected void onResume() {
super.onResume();
startVideo();
}
private void startVideo() {
if (mCamera != null) {
mCamera.release(); …Run Code Online (Sandbox Code Playgroud) 我有兴趣根据某些事件更改卡片的文字.是否可以在不调用setContentView()活动的情况下更改卡片的文本?
一旦将卡转换为视图并使用设置setContentView(),我还没有找到更改其内容的方法,而无需再次调用'setContentView()'.
getLastLocation()从LocationManager经常返回null的方法来选择最佳提供者是非常棘手的.文件说:
警告:不要使用LocationManager.getBestProvider()方法或常量GPS_PROVIDER或NETWORK_PROVIDER来侦听位置更新.Glass使用一组动态提供程序,仅侦听单个提供程序可能会导致应用程序错过位置更新.
如何获得最佳位置?
我有一个GDK浸入式应用程序,发射器Activity获取一个SCREEN_DIM_WAKE_LOCK WakeLock.该应用程序还有一个服务,它将接收聊天消息并启动Intent一个Activity以显示每个消息.每当Activity打开消息时,我想让屏幕变亮.但是,我发现的所有方法似乎都不起作用.
例如,添加以下内容onResume无效:
Settings.System.putInt(getContentResolver(), SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_MANUAL);
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 1.0f;
getWindow().setAttributes(lp);
Run Code Online (Sandbox Code Playgroud)
为了更好地说明问题,这是我的应用程序中的事件序列:
如何让屏幕变亮?