标签: google-glass

Google Glass镜像客户端api使用限制问题

我一直在为Google Glass开发应用程序.该项目工作正常,直到几天前.现在它给出了一个错误,在检查后我发现我已超出当天的配额.

错误如下:

Uncaught exception from servlet
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403
{
  "code" : 403,
  "errors" : [ {
    "domain" : "usageLimits",
    "message" : "Daily Limit Exceeded",
    "reason" : "dailyLimitExceeded"
  } ],
  "message" : "Daily Limit Exceeded"
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
Run Code Online (Sandbox Code Playgroud)

现在的问题是,即使在我说我的配额到期后一天,我仍然会看到同样的错误.

Mirror API上是否有总使用上限?

如何增加每日使用限制?

google-glass google-mirror-api

3
推荐指数
1
解决办法
614
查看次数

在Fastboot中看到GLASS的问题

我可以在adb中看到我的GLASS ID,adb reboot-bootloader似乎可以正常工作.我无法在fastboot中看到我的设备ID,而fastboot oem unlock在"等待设备"上挂起.按相机按钮会重启设备.

有没有其他人/看过这个问题,你做了什么来补救?

我目前在XE7上进行调试.我之前有侧载apk,没有问题通过adb.我想知道任何可能的解决方案,以便能够在fastboot中看到我的GLASS.

我的解决方案 - 我在Win 8上遇到了问题所以我换了OS X安装,拔掉所有USB外设,然后运行"./adb reboot bootloader",在"./fastboot devices"中看到我的GLASS,然后运行"./ fastboot oem解锁"两次启动.

我没有尝试拔掉win 8中的所有外围设备.这可能对那些在Win 8上遇到相同问题的人有所帮助.

google-glass fastboot

3
推荐指数
1
解决办法
3728
查看次数

如何将菜单项分配给使用TimelineManager插入的卡?

XE12引入了TimelineManager,它允许将Card对象添加到时间轴中.但我没有看到如何将菜单项分配到卡上,这可能吗?

google-glass google-gdk

3
推荐指数
1
解决办法
374
查看次数

我可以在带有Mirror API的Google Glass应用中使用我自己的语音命令吗?

我想使用Mirror API将自己的或自定义语音命令用于Google Glass应用.
这可能吗?如果是这样,我该怎么做?

google-glass google-mirror-api

2
推荐指数
1
解决办法
641
查看次数

如何创建捆绑时间轴卡

我想创建捆绑时间卡.到目前为止我做了什么.

创建三张卡并添加一个列表.

public void makeStartTimelineBundle(Credential credential) {
    List<TimelineItem> timeLineList = new ArrayList<TimelineItem>();

    TimelineItem startTimelineItem = new TimelineItem();
    TimelineItem helpTimelineItem1 = new TimelineItem();
    TimelineItem helpTimelineItem2 = new TimelineItem();

    startTimelineItem.setId("startTimelineItem");
    helpTimelineItem1.setId("helpTimelineItem1");
    helpTimelineItem2.setId("helpTimelineItem2");

    startTimelineItem.setBundleId("startCard");

    startTimelineItem.setText("startTimelineItem");
    helpTimelineItem1.setText("helpTimelineItem1");
    helpTimelineItem2.setText("helpTimelineItem2");

    timeLineList.add(startTimelineItem);
    timeLineList.add(helpTimelineItem1);
    timeLineList.add(helpTimelineItem2);

    try {
        MirrorClient.insertListTimelineItem(credential, timeLineList);
    }catch (IOException iOE) {
        log.info("Error : " + iOE);
    }
}
Run Code Online (Sandbox Code Playgroud)

然后通过MirrorClient执行

// list timeline
public static TimelineItem insertListTimelineItem(Credential credential,
    List<TimelineItem> items) throws IOException {

    for (TimelineItem item : items) {
        return getMirror(credential).timeline().insert(item).execute();
    }
    return null;
} 
Run Code Online (Sandbox Code Playgroud)

当我在我的玻璃杯中运行代码时,我只得到第一张时间卡.我如何创建时间轴卡捆绑?

google-glass google-mirror-api

2
推荐指数
1
解决办法
273
查看次数

在可滚动静态卡上显示标准玻璃滚动条

我使用可滚动静态卡作为项目选择器(滚动直到找到一个,然后使用onItemSelected事件来捕获点击).它可以工作,但它不会像菜单项和所有标准系统卡一样显示底部的滚动条.有没有办法启用它?

这是适配器代码:

private class FooCardScrollAdapter extends CardScrollAdapter {
    @Override
    public int findIdPosition(Object id) {
        return -1;
    }

    @Override
    public int findItemPosition(Object item) {
        return mCards.indexOf(item);
    }

    @Override
    public int getCount() {
        return mCards.size();
    }

    @Override
    public Object getItem(int position) {
        return mCards.get(position);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return mCards.get(position).toView();
    }
}
Run Code Online (Sandbox Code Playgroud)

android google-glass google-gdk

2
推荐指数
1
解决办法
498
查看次数

如果一个用户撤消访问,则对多个用户的批量请求失败

我正在使用mirror api开发一个玻璃器皿项目.

我的应用类似于新闻应用,可在文章发布时向所有订阅用户提供文章时间线卡.随着我的用户群的增长,这将成为一个问题,因为,正如应用程序现在所说的那样,它为每个文章卡的每个用户进行一次API调用.根据用户的设置,我们每天最多可以发送50篇文章.鉴于Google每天只有1000个镜像API调用的限制,我已经只有20个用户就可以实现这一目标.我知道当我的应用程序获得批准时,这会增加,但我仍然希望优化我的代码.

问题1:我是否正确假设实施批处理将减少我在此处无法找到的API调用数量:https://developers.google.com/glass/batch 假设我进行一次批量调用以发布单个时间轴项目到我的用户的玻璃时间轴的1000,是否计为1镜像API请求,或1000镜像API请求?如果是后者,(问题1.1)我是否正确假设批处理的唯一好处是减少我的应用程序的流量?

我遇到的问题是,如果用户在批处理运行时从(https://security.google.com/settings/security/permissions)撤消对我的应用的访问权限,则会引发异常并失败.它最终将用户(仍有权限)记录下来并强制重新进行身份验证.从我的测试来看,我不认为它在整个批次中都失败了,所以我不确定它是否将时间线卡交给所有未删除访问权限的其他用户.

目前,在没有批处理的情况下,我能够捕获此错误并在用户撤消访问权限时将其从数据库中删除. 问题2:如何在代码中捕获此错误并确定它对应的用户. 示例代码如下:

def _insert_item_all_users(self):
    """Insert a timeline item to all authorized users."""
    logging.info('Inserting timeline item to all users')
    users = Credentials.all()
    total_users = users.count()

    if total_users > 10:
        return 'Total user count is %d. Aborting broadcast to save your quota' % (
                total_users)
    body = {
            'text': 'Hello Everyone!',
            'notification': {'level': 'DEFAULT'}
    }

    batch_responses = _BatchCallback()
    batch = BatchHttpRequest(callback = batch_responses.callback)
    for user …
Run Code Online (Sandbox Code Playgroud)

google-app-engine python-2.7 google-glass google-mirror-api

2
推荐指数
1
解决办法
382
查看次数

Google Glass开发错误:(403)访问未配置.请使用Google Developers Console激活项目的API

我正在使用PHP版本的Google Glass Developer Kit.根据示例代码说明设置所有内容.API /凭证都很好,帐户开票已设置,已将Mirror API添加到项目中,但在我允许应用程序后,我收到以下错误:

An error ocurred: Error calling POST 
https://www.googleapis.com/mirror/v1/timeline?key=xxxxxx 
(403) Access Not Configured. 
Please use Google Developers Console to activate the API for your project.
Run Code Online (Sandbox Code Playgroud)

我已经添加了Mirror API并且有Billing活动和设置,所以不知道为什么我收到错误消息.通过Glass Explorer测试应用程序就可以了.

php google-api google-glass google-mirror-api

2
推荐指数
1
解决办法
2658
查看次数

Android SpeechRecognizer何时启动语音识别器时会收到ERROR_CLIENT?

我不确定一些文档相关的东西.

总结一下我做了什么以及我想做什么:我设法将语音识别功能引入Android平板电脑上的Android 4.2应用程序,它运行正常.现在我想在Google Glass上移植我的应用程序,但不幸的是,当我尝试启动语音识别器时出现以下错误:错误5 - > ERROR_CLIENT(其他客户端错误).该消息指导我查找与SpeechRecognizer对象无关的其他错误,但我的日志中没有任何错误,甚至没有警告.所以我的问题是:我什么时候才能获得ERROR_CLIENT?什么应该看看阻止识别器启动的错误?

谢谢!:)

android speech-recognition google-glass

2
推荐指数
2
解决办法
3663
查看次数

Android使用GDK使用MultipartEntity上传图片

我使用GDK开发谷歌玻璃的应用程序,我试图使用MultiPartEntity上传我捕获的图像但我无法让它工作由于某些原因我无法弄清楚,因为它没有返回任何错误.截至目前,这就是我的所在.

Java的

String picturePath = data.getStringExtra(Intents.EXTRA_PICTURE_FILE_PATH);
final File pictureFile = new File(picturePath);

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("SERVER PATH");

try {
    @SuppressWarnings("deprecation")
    MultipartEntity entity = new MultipartEntity();

    entity.addPart("type", new StringBody("photo"));
    entity.addPart("data", new FileBody(pictureFile));
    httppost.setEntity(entity);
    HttpResponse response = httpclient.execute(httppost);
    } catch (ClientProtocolException e) {
    } catch (IOException e) {
    }
Run Code Online (Sandbox Code Playgroud)

PHP代码:

$response = array();
$file_upload_url = 'UPLOAD PATH';


if (isset($_FILES['image']['name'])) {
$target_path = $target_path . basename($_FILES['image']['name']);

$email = isset($_POST['email']) ? $_POST['email'] : '';
$website = isset($_POST['website']) ? …
Run Code Online (Sandbox Code Playgroud)

php java android google-glass google-gdk

2
推荐指数
1
解决办法
1336
查看次数