4
votes

Up until now, I have been using just the Mirror API. I have started going through Google's docs on the "Sneak Peek" version of the GDK so that I can begin building a bit more complex apps.

Now here's where I am having an issue. I see that as a developer, I can take the standard Android approach and create an Activity, give it a layout, create a few options on the menu, and take this basic approach.

Alternatively, it appears there's a separate API for creating "Cards" - Static, Live, Immersions. Now with this approach, there's the TimelineManager class for displaying these cards. There's also the CardScrollView which I can use along with a CardScrollAdapter to create my own "Timeline" within my Glassware. Is this correct? Why would I use one here vs. the other?

I'd like to create an app that the user enters and then see's an initial screen where they can tap to drill down or swipe their finger to scroll horizontally to the next screen (or Card rather). So here, I believe I would use the CardScrollAdapter along with the CardScrollView, determine which screen the user is on when they tap on the Glass, and then start a new activity that shows additional cards in another CardScrollView/CardScrollAdapter or whatever - depending on whatever it is I want to do -

I'm just wanting to ask if I am on the right track or if my understanding is completely wrong.

3

3 Answers

3
votes

Well looks like you just started going through the documentation so I should answer with an overview first followed by the Answer

1) Live Cards are originally Services that show Views using RemoteViews in case of Low- intensity Cards and work with SufaceHolder in case of High Intensity Cards.

2) Static Cards are purely based on GDK and have few specific features yet.

3) Immersions are originally activities where you can use all the Android SDK Layout features with Glass UI Guidelines applied.

4) CardScrollView which gets a CardScrollAdapter has to be added to an Activity eventually.

.

So the answer is:

Yes, you are going on the right path it has to be done this way.

1
votes

Live Cards are to be used only when you need to send cards to the user's timeline. In your case, you can just follow the standard activity approach. So yes, you are on right track.

1
votes

Here's what I've found: Cards are quite limited and come with a HUGE disadvantage; the styling sucks.

A LiveCard can be styled however you want (using an inflated xml, for example), but a Card has two layouts, one of which sets a picture to the side and some text (and a footnote) and the other sets a picture fullscreen and some text and a footnote over that. The problem is that the latter applies a shitty gradient to the picture (I guess to enhance the footnote).

Due to that horrible gradient which you can't turn off, I've scrapped my CardScrollView implementation and just used a different widget to display/scroll through my 'cards' (basically custom layouts/views) so I can actually display the whole picture.

So, what I do in the end is to use a service to create/add a LiveCard, which when clicked starts my activity which displays a scrolling widget. I don't use Cards, except for a LiveCard to start my activity.