标签: google-glass

如何同时发送捆绑的卡?

我已经设置了一个Java应用程序,我正在创建一组4张卡片.问题是所有卡片都不会立刻进入.有时候只有一个出现,然后几秒钟或几分钟后出现其他卡片.如何让他们同时出现在耳机上?

编辑:我尝试了HTML分页,但是没有用,现在我觉得我更困惑了.所以在我的senario中,我想向用户发送一堆他们可以导航到的地标.我希望捆绑中的所有地标,我想要捆绑的捆绑包不是捆绑中的选项说"这里是你的地标",我希望捆绑包同时到达用户.我怎样才能做到这一点?

TimelineItem timelineItemEmpire = new TimelineItem();
timelineItemEmpire.setText("Empire State Building");

// Triggers an audible tone when the timeline item is received
timelineItemEmpire.setNotification(new NotificationConfig().setLevel("DEFAULT"));
Location empireLoc = new Location();
empireLoc.setLatitude(40.748492);
empireLoc.setLongitude(-73.985868);
timelineItemEmpire.setLocation(empireLoc);

// Attach an image, if we have one
URL url = new URL(WebUtil.buildUrl(req, "/static/images/empirestate.jpg"));
timelineItemEmpire.setBundleId(bundleId);

List<MenuItem> menuItemList = new ArrayList<MenuItem>();
menuItemList.add(new MenuItem().setAction("NAVIGATE"));
timelineItemEmpire.setMenuItems(menuItemList);

MirrorClient.insertTimelineItem(credential, timelineItemEmpire, contentType, url.openStream());

TimelineItem timelineItemCP = new TimelineItem();
timelineItemCP.setText("Central Park");

// Triggers an audible tone when the timeline item is received
timelineItemCP.setNotification(new NotificationConfig().setLevel("DEFAULT"));

// Attach …
Run Code Online (Sandbox Code Playgroud)

java google-glass google-mirror-api

7
推荐指数
1
解决办法
446
查看次数

如何测试镜像API订阅

https callbackUrl的限制以及整个订阅的性质使得看起来这只能通过可公开访问的URL来完成.

到目前为止,我遇到了两个可能使本地开发/调试更容易的潜在解决方案.

第一个是谷歌提供的订阅代理服务.此解决方法实质上允许您将SSL限制和代理订阅回调删除到自定义URL.

我发现在本地进行开发的第二个也是最有用的方法是将订阅回调请求(例如从可公开访问的服务器)捕获到日志中,然后使用curl使用类似的东西在本地/ dev机器上重现该请求:

curl -H "Content-type: application/json" -X POST \
  -d '{"json for":"the notification"}' http://localhost:8080/notify
Run Code Online (Sandbox Code Playgroud)

由于请求有时可能很大,或者您可能想要测试多个回调类型,我还发现将下标请求的JSON放入各种文件(例如:) timeline-respond.json然后运行很有用.

curl -H "Content-Type: application/json" \
  --data @timeline-respond.json http://localhost:8080/notify
Run Code Online (Sandbox Code Playgroud)

我很好奇其他人在本地测试他们的应用程序订阅.

google-glass google-mirror-api

7
推荐指数
1
解决办法
1006
查看次数

任何人都可以建议谷歌玻璃教程的良好链接?

我试图搜索,但找不到一个解释一切的好的,我发现的链接只提供了一些代码片段.

google-glass

7
推荐指数
1
解决办法
2449
查看次数

Google Glass Sample APK

我可以在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)

eclipse google-glass google-gdk

7
推荐指数
1
解决办法
2266
查看次数

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");
 }
Run Code Online (Sandbox Code Playgroud)

google-glass google-gdk

7
推荐指数
1
解决办法
577
查看次数

玻璃相机预览显示乱码

我正在尝试在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)

android android-camera google-glass textureview google-gdk

7
推荐指数
1
解决办法
2596
查看次数

如何使用Google Glass扫描二维码?

我想创建一个Google Glass应用程序,我想在其中扫描QR码.

我经历过这篇文章,但我无法理解.

阅读二维码

任何人都可以指导我如何扫描二维码并在谷歌眼镜中获取其内容.

谢谢

google-glass google-gdk

7
推荐指数
1
解决办法
1万
查看次数

使用GDK更新Google Glass中的卡片文字?

我有兴趣根据某些事件更改卡片的文字.是否可以在不调用setContentView()活动的情况下更改卡片的文本?

一旦将卡转换为视图并使用设置setContentView(),我还没有找到更改其内容的方法,而无需再次调用'setContentView()'.

android google-glass google-gdk

7
推荐指数
1
解决办法
1261
查看次数

如何可靠地获得Glass上的最后位置?

getLastLocation()LocationManager经常返回null的方法来选择最佳提供者是非常棘手的.文件说:

警告:不要使用LocationManager.getBestProvider()方法或常量GPS_PROVIDER或NETWORK_PROVIDER来侦听位置更新.Glass使用一组动态提供程序,仅侦听单个提供程序可能会导致应用程序错过位置更新.

如何获得最佳位置?

google-glass google-gdk

7
推荐指数
1
解决办法
684
查看次数

内置ScrollView,可以头部运动滚动

说"ok glass"会显示一个命令列表,根据用户的头部动作自动滚动.

GDK中是否有内置的UI元素来实现这一点?或者我是否必须编写自己的使用传感器的代码?

google-glass google-gdk

7
推荐指数
1
解决办法
1564
查看次数