johnarleyburns
johnarleyburns

Reputation: 1572

Adding Card images throws exception for HTTP and HTTPS resource schemes

Doing some HTTPS json calls in glass with the GDK, so far so good. Tried to set a card to one of the returned https urls using this code:

Uri uri = Uri.parse(url);
card.addImage(uri);

A strange exception occurred, seemingly implying that glass doesn't support HTTPS?

ERROR/AndroidRuntime(14507): FATAL EXCEPTION: main
java.lang.IllegalArgumentException: unsupported image scheme: https
at com.google.android.glass.app.Card.addImage(Card.java:178)

I've tried the same thing with HTTP images, and receive an "unsupported image scheme: http" error.

How am I supposed to load images with the GDK? Is there some API usage I'm missing?

Upvotes: 3

Views: 229

Answers (1)

tw1742
tw1742

Reputation: 1484

Based on this Stack Overflow response [1] posted Jan. 16, 2014 it seems this is not yet supported and the only supported schemes for the Card builder class are file and android.resource.

There is a feature request [2] for tracking support for web images in the Card builder class.

[1] GoogleGlass : Add image in background : unsupported image scheme: http
[2] https://code.google.com/p/google-glass-api/issues/detail?id=299

Upvotes: 1

Related Questions