0

Google Glassware のタイムラインに背景画像を設定しようとしています。

どうすればいいのですか?ビューページで画像を取得するにはどうすればよいですか?

画像のURLを添付ファイルとして設定しようとしています

TimelineItem timelineItem = new TimelineItem(); 
timelineItem.setText("Hello world"); 
InputStreamContent mediaContent = new InputStreamContent(contentType, attachment); 
service.timeline().insert(timelineItem, mediaContent).execute();

その後service.timeline().insert(timelineItem, mediaContent).execute();、ヌルポインタ例外が発生します。

4

1 に答える 1

1

Google Mirror API Playground をご覧になりましたか?

テンプレートの 1 つは、カードに次の html を使用して、フルブリードの背景画像を持つタイムライン カードを示しています。

<article class="photo">
  <img src="%background-image-url%" width="100%" height="100%">
  <div class="photo-overlay"></div>
  <section>
    <p class="text-auto-size">%CardText&</p>
  </section>
</article>

または、必要な画像を添付ファイルとして追加textし、タイムライン アイテムの一部のみを提供することもできます。ここで説明されているように、これは添付された画像をフルブリードの背景画像として使用し、text上部に表示します: https://developers.google.com/glass/timeline#inserting_a_timeline_item_with_media

于 2013-11-12T14:11:50.430 に答える