Android Developer Office Hours: Q&A


Uploaded by androiddevelopers on 10.10.2012

Transcript:
TREVOR JOHNS: --couldn't play a video as an Android
application.
Of course, you already mentioned one of them, which
is to go ahead and open up the native YouTube application.
You can do that via an intent.
And that's definitely a good approach, but the downside
there is that it's going to take you out of your
application.
And so if you're looking for a more immersive experience, you
have a few other options.
You could go ahead and ad a web view which links to the
Flash version of YouTube.
Or you could also go and low the HTML
file version of YouTube.
Each of those have some catches,
though, pretty important.
Older devices-- and actually some newer devices for that
matter, too--
don't have Flash installed.
So the Flash Player's not always available.
And older devices aren't going to be able to play HTML5 file
video unless they have an HTML5-compliant WebView
implementation.
So with that out of the way, for current devices, that
pretty much limits your options to
built-in YouTube app.
So for almost all practical purposes right now, I'd say
the best option is to go ahead and fire it off an intent and
send the user off to the YouTube player just so they
have the best YouTube playback experience.
Now that said, we did pre-announce a YouTube API for
Android at Google I/O this year.
It's not ready yet, but it will be at some
point in the future.
And that will allow you to go ahead and embed YouTube videos
within your application, just as a--
basically the way WebView works except it will be a
YouTube view.
So if you want to learn more about that, go ahead and
search Google for YouTube Android API.
And there's a slide deck and a--
actually a video on YouTube for that matter, where you can
go ahead and learn more about all of that.
And keep an eye on that for some time
later in the near future.
Don't know an exact date, but sometime hopefully soon, there
will be some more news on that.
And if you want a demo, actually, the Google I/O app,
the Android schedule app is a good
example of how that works.
ALEX LUCAS: Here is actually an interesting question.
I don't know the answer to this myself, but is it
possible to detect at run time if the phone will support
YouTube via Flash?
TREVOR JOHNS: Oh, that's a good question.
I imagine you could actually check PackageManager and look
for the Flash package.
And if you see that on there, It's probably a pretty good
sign Flash is working.
ALEX LUCAS: Right.
See what I would suggest maybe is, because the post from
Michelle does state that she would prefer to keep the user
inside the app, is if there's a way to detect at run time if
Flash is supported on the device or if YouTube via HTML5
would be supported on the device, it would
require extra effort.
But you could just do all three implementations and say,
OK, if Flash is supported on this device, do it in Flash.
If not, if HTML5 is supported on this device,
do an embedded WebView.
If not, intent out.
That way you would have a wider range of phones that you
support for in-app and not necessarily have to go to the
YouTube app every time.
TREVOR JOHNS: Yeah.
Now, I've seen some people use RTSP also, but I'm not sure if
that's actually allowed.
So you might want to check the YouTube terms of service.
I sort of a suspicion that you might not be
allowed to do that.
ALEX LUCAS: We discourage sketchy behavior.
TREVOR JOHNS: Right.
ALEX LUCAS: Ethical and TOS issues aside, even though they
are real issues.
But if you do something like that, it is liable to get
broken in the next version of Android once a security fix
for that is determined.
TREVOR JOHNS: I don't think that's a security issue.
ALEX LUCAS: Not security, but--
TREVOR JOHNS: I think that's just a YouTube terms of
service issue.
But in any case, I think the correct answer here until we
get the YouTube API out is to go
ahead and use the embedded--
the native YouTube app.
I think for pretty much every case there, you're going to
get the best experience that way.
At least for now.
So let's go ahead and move on to the next question.
I just realized, Dan, we never turn on the lights in here.

ALEX LUCAS: Makes us look like--
DAN: We can make that happen.
TREVOR JOHNS: Yeah, all right.
Let's move on to the next question.
ALEX LUCAS: All right, the next question. "A real
Bluetooth headset button push still works in the foreground
music app, but my mimicked action_media_button intents no
longer work in Android 4.0 or above.
As I said, Google music hogs them.
What are Bluetooth headsets doing differently?"
TREVOR JOHNS: Excellent question.
So this question, I think, just came in probably about 10
minutes before our broadcast.
ALEX LUCAS: Yeah, we, unfortunately, have not had
time to research it, and neither of us, I think, know
off the top of our heads.
TREVOR JOHNS: Yeah.
It's possible that it's being--

the media framework is going in and integrating directly
with the Bluetooth stack.
I'm not actually sure.
The good news is the source is out there.
If you want to go ahead and take a look, you can go ahead
and dig into it a little deeper.
We'll do the same on our end and try and get you an answer
for the next show.
Again, we just don't have enough time.
We didn't have enough time before to actually get
researching an answer here.
I think trying to mimic the action_media_button intent to
simulate a Bluetooth button push is a little sketchy, so
I'm not terribly surprised that you're
having some issues there.
But we'll try and get you an answer, try and figure out
what's going on.
Join us next week and we'll have an answer for you at the
beginning of the show.
ALEX LUCAS: We just got brighter.
TREVOR JOHNS: It did.
ALEX LUCAS: Yeah.
TREVOR JOHNS: All right.
ALEX LUCAS: It takes away my ominous,
shadowy appearance, though.
TREVOR JOHNS: All right.
So, "is there a reason why Google does not release
updates of new Android versions for all interested
developers with Nexus 7 and the Galaxy Nexus devices right
away outside of the long OTA cycle without having to root
the device and doing it manually?"
ALEX LUCAS: Yes.
Next question.
TREVOR JOHNS: And that's by Chris from London.
Oh, I think it's actually a valid point.
ALEX LUCAS: I was joking.
TREVOR JOHNS: So right now, the way we do software
updates, assuming you have a device that has an OS update
available, is we roll the device out to a fraction of
users at a time.
And there's a number of reasons we do that.
First off, it makes sure that we don't overload carrier
networks for people who are on cellular connections.
In fact, I think there's even an option in there where they
can go and offer only to Wi-Fi users for the
first 24, 48 hours.
But we also go and roll out slowly just to make sure if
there's any bugs with update, major, major bugs that somehow
we didn't catch during testing, That way we can go
ahead and abort the update and solve those problems before
many users are impacted.
Now, we do test things pretty thoroughly, and it's rare that
something like that happens.
It's just a safety device that we've basically built in.
I think in the case of developers,
it's a valid concern.
It would be definitely very nice to be one of the first
users to get a software update, so that way you can
update your application.
So I'll make sure that the--
actually, I think that we already filed a bug this
morning for this.
So there is a bug open.
We'll go ahead and make sure that the OTA team sees it as a
feature request.
I think it's completely valid, and thank you
for the great idea.
We'll see we can do to get that implemented for you.
ALEX LUCAS: Yeah.
TREVOR JOHNS: All right.

ALEX LUCAS: OK.
"When will we get a supported Marketplace API, eg, to search
the marketplace for apps and pull their details,
screenshots, and analyze comments and ratings?
Microsoft and Apple support this, and they are closed
markets."
That's a good question.
Unfortunately, this definitely falls into the category of
roadmap question.
And as a matter of policy, we can't discuss future features
that we may or may not be implementing or whether or not
we're working on them, when the hypothetical release day
would be, that kind of thing.
We will definitely file it as a feature request.
But we can't really say anything about when it would
happen, or if we're working on it.
TREVOR JOHNS: Yep.
I think that's a pretty good answer.
So Percy from the Philippines says, "can I retrieve data
from the Google Maps API so I can use it for my
location-based service application I'm developing/"
So I'm not sure what sort of data you're looking for Percy,
but there are a number of things that
you can access already.
You can access the user's current location via the
location manager.
And that actually really doesn't have anything to do
with Google Maps.
It's just what's the user's latitude, longitude, altitude,
basic data you'd get from GPS.
Or if there's a Wi-Fi network nearby, it can do course
location, things like that.
You can also do geocoding which is-- actually I think
it's reverse geocoding.
Is it?
No.
It's standard geocoding.
Yeah.
It's converting latitude and longitude to a
human-readable address.
ALEX LUCAS: That's reverse geocoding.
TREVOR JOHNS: OK.
Now, do we--
I think we support both ways, don't we?
ALEX LUCAS: I believe we support both ways.
Those actually might be via the Maps API.
TREVOR JOHNS: Actually it's not.
It's via LocationManager.
ALEX LUCAS: Interesting.
TREVOR JOHNS: I think it uses Maps under the hood.
But it is part of the LocationManager package.
So there's utilities to go and convert from lat/long to an
address and back from address to lat/long.
So that's all totally possible.
Now if you want to do something
more graphical, right?
You want to display a map and let the user see where they
are in the world as opposed to just telling them their
numerical address, right?
You can embed MapView inside of your application which will
render Google Maps, the user's location.
And there's some limited options to go
and customize that.
If you want to go a step further and start adding
really complicated stuff like polygons--
ALEX LUCAS: Markers.
TREVOR JOHNS: --markers, custom map tiles, you could go
ahead and add a WebView that loads the Google Maps
API from the web.
And that's how you can get some of
those advanced features.
We definitely encourage people to use a
standard MapView at first.
But sometimes you want to do these advanced things, and
that's when you have to look into the web-based APIs.
So I think that's a yes as far as the
answer to this question.
ALEX LUCAS: Yeah.
TREVOR JOHNS: Now if you want to do something like get
driving directions, though, that's where you're going to
run into some problems.
And you won't be able to pull that data out of Google Maps.
But I believe you can send the user-- yeah, you can totally
just send the user over to Google Maps and construct a
URL for directions and have that load.
So there are ways to go and tell Google Maps what data
you'd like it to display.
But it'll still be within Google Maps for the users
receiving that content.
ALEX LUCAS: Yeah.
I I also want to add, we do have a lot of online resources
for using the Maps API.
With Android, it's on developer.android.com/android.
I don't remember the tail end of that URL.
TREVOR JOHNS: Wait, developer.android.com/android?
ALEX LUCAS: Oh, sorry, developer.google.com/android.
TREVOR JOHNS: There you go.
ALEX LUCAS: And that's where most of the APIs for using
Google services with Android--
that's where you're going to find those.
TREVOR JOHNS: All right.
So moving on to the next question then.
X asks, "whereabout in the source code can I find the 4.1
LockScreen?
The use case is to borrow the layout, aesthetics, assets, of
the unlock ring." So this is another one of those questions
that came in right before the show, so we haven't had a
chance to look it up yet.
That being said, I want to say that there's just--
there's a package called LockScreen?
ALEX LUCAS: I think so.
TREVOR JOHNS: It might be a little off.
If you go to source.android.com, you can go
to the package viewer and find--
and just search the page for lock, and it'll come up.
I know it's in there but I can't remember the exact
package name off the top of my head.
I can try and research it during the next question.
ALEX LUCAS: If you have the Android source downloaded
already, I would say just grep the source for LockScreen.
It'll be probably capital S--
or capital L capital S. But I don't know the package off the
top of my head.
We'd have to look that up.
TREVOR JOHNS: All right.
So let's go hit the to next question.
Alex, do you want to take this one?
ALEX LUCAS: Sure.
"What is the best view to use to display an
option between two items?
I want the user to be able to select between one way and
round trip.
The available options don't seem to
fit well in my opinion.
What would you suggest?"
TREVOR JOHNS: All right.
So you just want to go and have an option chooser
basically, like a radio button?
ALEX LUCAS: Just to select between two.
So I guess the--
what are the options we have right now?
We have the spinner, which is a drop-down.
And we have radio buttons.
We also have, I guess, tabs, depending on how you would--
if it would make sense in the context of your app.
TREVOR JOHNS: Or you could put two buttons side by side and
make them stay pressed.
ALEX LUCAS: Or you can have one button that's a toggle
button that just changes the label or whatever action it's
going to perform.
It's really difficult to say best one to
use, because we have--
I mean, we just iterated over most of them.
There are several options, and it very
much depends on context.
So being able to say--
OK, so to choose between one-way and round trip, I
assume, means something along the lines of buying airline
tickets via an Android app or something like that.
There I would probably go with a drop-down so you don't take
up too much of the screen.
But it really is context dependent.

TREVOR JOHNS: OK, I think--
I mean, I think that's pretty much all the options I can
think of off the top of my head.
I mean, it's tough to say without actually seeing what
your application's doing.
We can go ahead and give you lots of very, very general
advice, but a screenshot would help immensely here.
So if you happen to be watching live, feel free to
hop on Google+, give us a little bit more background
about what you're doing, and we can go ahead and try and
get you some more tailored advice to your app.
Failing that, there's also the Friday App Clinic, where you
can go and get advice from--
I believe Reto and Ian are hosting that right now.
ALEX LUCAS: Reto and Ian.
TREVOR JOHNS: And then also there's the UI Show, too.
ALEX LUCAS: What day is the UI Show?
TREVOR JOHNS: Monday.
ALEX LUCAS: Monday.
Oh, OK.
Monday's good.
DAN: Actually, it's Tuesday.
TREVOR JOHNS: Tuesday.
ALEX LUCAS: Tuesday.
All right. it's Tuesday now.
TREVOR JOHNS: I think it's probably always been Tuesday.
ALEX LUCAS: I would say also, one thing to keep in mind for
the Friday App Clinic, the way that works is you submit your
app and usually you submit a link to on market--
or, sorry, on Google Play Market.
So if the app isn't developed yet, then that wouldn't be the
place for it.
In that case, you'd probably want to send a couple
screenshots to the UI review on Tuesday.
But, yeah, I would say those are options for followup.
But based on what I can see of the one way versus round trip,
it seems like drop-down would be--
it would not be a bad choice.
I don't know about best choice.
I can't say without looking at you application.
TREVOR JOHNS: Right.
I'm just in here trying to find that
LockScreen package here.
But no, I think that's a good answer.
Without seeing the app, I think we've said
everything we can.
But again, if you're watching live, we'd love to get some
more details and give you some more tailored device.
So let's move on to the next question.
Joe from Maine asks, "I am sendOrderedbroadcasting--"
wow, it's a verb now.
ALEX LUCAS: Yeah.
TREVOR JOHNS: "I am sendOrderedbroadcasting
ACTION_MEDIA_BUTTONS--
or button intents to MEDIA_BUTTON_PLAY_PAUSE--" oh,
I think this is the same question we got-- "to mimic a
Bluetooth headset button push.
In Android 4 and above, only Play Music responds, but
pre-4.0, the current music playing app would respond.
What changed in Android 4?"
I think our answer here is the same as last time.
We got this question right before the show, so we don't
know without actually digging through the source, which it
takes us more than 10 minutes, especially as we are prepping
for the show.
So definitely a good question.
I'd love to get you an answer.
We just didn't have enough time to answer it because this
question came in late.
We'll try and get you an answer
by next week's broadcast.
All right.

And this is actually probably a good time to remind anyone
who is watching live, feel free to join
us on Google+ Hangouts.
I assume that Dan over here in the corner is monitoring that.
So if anybody does want to go and ask a question, just I
guess either speak up or--
you are watching the Hangout, right, Dan?
DAN: I am watching both.
TREVOR JOHNS: OK, Excellent.
Yeah, there's a tech there in the corner.
Yeah, so if you do have a question, just wave your hand,
type something in the chat, speak up.
We'll try and get you on there live.
If you don't have a microphone, you can also go
ahead and type your questions to us in Hangout chat, and we
can read them out.
We'd love to get live questions.
Go easy on us.
We can only do so much without actually having time to
research stuff.
But again, questions like that last one on UI, excellent
things that we'd love to discuss live if anyone does
want to go over any of that.
So let's see here.
This question.
Daniel says, "I understood you wanted to look into last
week's issue after the show--
Edit Text and onPause.
Any news on that one?" I don't think we have a--
that's the--
Is that the one that has to do with the support library?
ALEX LUCAS: Oh, that's the one where the value of the text
box would change when you rotated the device.
TREVOR JOHNS: OK.
ALEX LUCAS: So it was pre-populated with Hello
World, and you typed, zzz, and the value is helloworldzzz.
Then you rotated the device.
The new value would just be zzz.
TREVOR JOHNS: OK, that one.
ALEX LUCAS: And it was a--
it's an interesting quirk.
We haven't actually had time to determine
the cause of that.
But I will hopefully have time to dig into that.
TREVOR JOHNS: Yeah.
We should get you an answer on that one by
the end of the day.
ALEX LUCAS: Yeah.
TREVOR JOHNS: All right.
DAN: We actually have a screenshot for the
reservation--
TREVOR JOHNS: Oh, excellent.
ALEX LUCAS: Awesome.
TREVOR JOHNS: Are you able to put that up some way?
DAN: No, but you can just take a look over my
shoulder right here.

ALEX LUCAS: OK, so there's two buttons.
Is there any way for you to throw that into the Hangout so
that we're not just a bunch of people staring
off-screen into space?
DAN: Um, I have--
TREVOR JOHNS: You could load it on the Hangout computer.
DAN: Yeah, I can put it on the Hangout
computer if you guys want.
TREVOR JOHNS: All right, yeah, let's do that.
ALEX LUCAS: Sure, yeah.
TREVOR JOHNS: So we'll get back to that in a second while
Dan goes and makes that magically work for us.
All right.
So Viti asks, "could somebody look at this issue on the
Android bug tracker regarding the broken clipboard on
Samsung's Galaxy S3?"
So I did take a look at this.
And so the issue, in particular, here is whenever
the user copies data into the clipboard on that particular
phone, there's a crash.
And that's not really a compatibility issue per se.
I mean, the API is still--
the API hasn't changed any.
It's more just an issue of general system stability as
far as I can tell.
ALEX LUCAS: Yeah.
TREVOR JOHNS: And I'm not sure where exactly-- whether or not
that's an issue because of a modification that Samsung's
made or if it's a problem in the framework code.
That said, since it is a Samsung device this only
happening on, my suspicion is that there's some interaction
with one of Samsung's modifications
or a driver or something.
I think this is a question that we have to send over to
Samsung and they'll have to address.
It's really outside of our hands in that case.
If it was a compatibility issue, we could update the
compatibility test suite.
This is just more an issue of the system is having some
problem with the clipboard.
So definitely a bug we'd like to look into, but it's one
that Samsung's going to be responsible for fixing.
So that being said, now that you pointed it out, I'll make
sure that somebody at Samsung does see that.
So let's move onto the next question.
I think Dan's still working on that screenshot.
ALEX LUCAS: "When a user touches a listview item, I'd
would like to hang a view off of the bottom of the listview
item such that it overlaps the next listview item.
Do you think that this is possible?
And off the top of your head, any ideas on how you would do
it?" That's tricky.
So I don't know if it would necessarily
be possible to alter--
basically, you would have to alter the z-value so it would
sort of hang over the next listview.
TREVOR JOHNS: Yeah, I don't think-- you wouldn't be able
to do it as a part of the listview.
It'd have to be another view that you stack on top.
And in order to do that, you'd have to go and compute where
the item is on your screen and precisely
position a window there.
It's sort of painful.
I think it's totally possible.
Just go and create a new view.
Like Alex said, you're going to want to make sure that it's
in front of everything else and then just set the x,
y-coordinates.
That said, I think an easier option would just be to go and
make you listview item just a little bigger.
ALEX LUCAS: Yeah, that's what I would do.
You would still have the effect of pushing
it out of the way.
TREVOR JOHNS: Yeah, it's not going to overlap.
But it's going to slide the options underneath
it out of the way.
ALEX LUCAS: And if you really wanted to, you could also
maybe alter the brightness of the one below it and above so
that the others around it kind of fade out.
TREVOR JOHNS: Or the other thing you could do, actually,
is just insert another listview item underneath it.
ALEX LUCAS: Yeah, you could also do that.
TREVOR JOHNS: In either case, I'd make sure you take
advantage of the animation framework.
There's a flag you can set on the listview to go and make
things nicely animate in and out.
And that'll get you some nice eye candy to go along with
this effect.
ALEX LUCAS: Right.
If you're in the Hangout, I'd be curious why you're trying
to do this.
It's not really a behavior that is typical of a listview,
and it might be kind of jarring.
Dan's showing us pictures-- or a video feed of ourselves,
staring into the abyss.
Anyway, it's not something that's expected, and I'd be
curious what the goal of that is.
If it's just to command attention for one listview
item or to indicate it as selected, or something like
that, there are other ways to accomplish that that will
require less coding on your part.
So if--
David from Oakland, if you're in the Hangout or watching
online, just pop into the Hangout and give us a little
bit more context.
And we could probably answer your question
a little bit better.
TREVOR JOHNS: All right.
Dan, do you have that screenshot for us ready?
MALE SPEAKER: Yeah.

TREVOR JOHNS: OK, so are you able put that up live?
DAN: Not right at this minute.
TREVOR JOHNS: OK.
DAN: I'm still fixing some stuff up.
TREVOR JOHNS: We'll wait till you have that live then.
I want to make sure our viewers can see what we're
looking at.
It's a lot more interesting that way.
ALEX LUCAS: Otherwise, we're just staring at a box.
TREVOR JOHNS: Yeah.
All right.
Let's move one to the next question then.
And this might actually be the last recorded question.
So Skate Benji from Italy asks, "how do I get only the
contacts from the phone, not Facebook contacts or Gmail
contacts?" I don't think this is so--
I'm curious if this is a developer
question or a user question.
Well, let's take the user question first.
If you're in the contacts app, you can-- on the latest
version of Android anyway, you can go to the-- actually I
think-- yeah, in the latest version you go to the menu.
In old versions, you click on the Menu button, and there's a
Display Options command.
Let me pull it up, actually, here.
I'll get you the exact value.
But you can go ahead and click on that.
And it'll let you pick which contact sources you want to go
and sort, so it's basically a filter.
So let's see here.
ALEX LUCAS: And then basically it gives you the option of
only displaying contacts with phone numbers attached.
TREVOR JOHNS: Right.
TREVOR JOHNS: So as a user, that's how you would do it.
TREVOR JOHNS: Actually, it's called Contacts Display now.
I think it used to be called Display Options before.
And so I have a thing that says All Contacts, or Google,
and they list all my Google accounts.
Or I can pick Google+ if I want to see my contacts from
my Google+ circles.
If I had Skype installed, it would show my Skype contacts.
And then there's a customized option if you want to go and
get more specific.
It only selects certain groups, things like that.
So that's how the People app, or what used to be known as
the Contacts app, handles it.

On the API if you want to do this, the way this works for
each, if I remember the contacts schema correctly, for
each contact or each person, you'll have a overarching
contact entry.
And then linked to that, you'll have an entry from each
of the different content providers on your system.
So you can go ahead and just construct a SQL query that
only gets contacts from the package name that you desire.
So if you--
com.Google will show you all the contacts from Google
sources, for example.
Or com.Skype would show you your Skype contacts.
And it's really just a matter of selecting or adding a SQL
where clause to only select that packaging.
ALEX LUCAS: Yeah.
I don't know what the package name off the
top of my head is.
I think it's called com.Google because of--
TREVOR JOHNS: For Contacts?
For Google Contacts?
Yeah, for Google Contacts, it's com.Google.
ALEX LUCAS: OK.
But you explicitly say not Gmail contacts, which I'm
assuming you don't want everyone in your buddy list
because you don't have their phone numbers.
So I think it would actually be a two-part process, where
you search on the account type being com.Google.
And second of all, you would filter on making sure that the
phone number is not-- no one actually has a
value in that field.
TREVOR JOHNS: Yeah.
I'd be a little careful about this.
Because some phones will let you pick whether or not you
want to save the contact to the SIM card
or to Google Contacts.
That being said, most of the Google--
the Nexus devices will only save contacts to Google
Contacts, at least for new contacts that you create
unless you have some other contact provider
installed, of course.
It is modular.
But the default behavior is only to use Google Contacts.
And the reason we do that is because we want to go and make
sure everything is synced to the cloud.
It gives users a really nice experience, right?
Whatever new phone you get, all your
contacts are right there.
So if you decide that you want to filter out Gmail contacts,
you might be filtering out every single contact the user
has on their phone.
So I think really if you do want to add some filtering
here, I think it would be wise to go and mimic the behavior
of the People app and give the user a choice.
Which contact sources do they want to display?
Rather than just saying I only want to show contacts that are
on the SIM card.
Because, actually, I'd say on most devices out there, that's
going to get into trouble, and you're going to filter out
most contacts.
ALEX LUCAS: Yeah.
TREVOR JOHNS: All right.
Any luck, Dan?
DAN: Yep.
I'm good.
Give me one second, I'll put it up onscreen and our viewers
can take a look.
ALEX LUCAS: OK.
DAN: Here we go, guys.
ALEX LUCAS: So we're going to be the--
we're bringing UI review to Wednesday right now.
TREVOR JOHNS: It's true.
ALEX LUCAS: OK.
So--
TREVOR JOHNS: In this case, there's a spinner on top that
says one way.
And then underneath that, what's the
text under there say?
DAN: It says "to the airport."
TREVOR JOHNS: Ah.
And then there's a button that says?
DAN:"Next screen, choose flight time."
TREVOR JOHNS: OK, gotcha.
So it's like a, say, direction to the airport app, I imagine.
ALEX LUCAS: OK.
TREVOR JOHNS: Yeah so, first thing I'd do here-- that
spinner's actually pretty bad.
I'm not a fan of that spinner.
I think your best option here is--
look at the way Google Maps does it, right?
You have buttons there for one way or round trip.
Yeah, I wouldn't use a tab or use a--

what's it called?
ALEX LUCAS: Radio buttons?
TREVOR JOHNS: Radio buttons would work.
ViewPager is a nice thing.
Tabs and ViewPagers I'd leave off the table.
I think that's even more heavy-handed than the spinner
is right now.
ALEX LUCAS: Tabs and ViewPagers should only really
be used when each option would then change the entire UI in
terms of what other options you were presenting.
TREVOR JOHNS: Yeah.
Now the spinner that you have right now isn't terribly bad.
The problem is it's just too wide.
You're using up the entire width of your page.
But even then, let's say we do make it smaller and make
things a little more streamlined.
The problem you're going to run into here is that it's
multiple clicks to pick what type of transportation you
want, right?
It's at least two clicks, actually almost-- it's
exclusively two clicks.
You're going to click on the spinner, and you're going to
click on the other option.
And you really just don't have enough choices here to go and
justify the overhead of a full spinner.
It's really just, option one, option two.
And so this is where radio buttons or a toggle switch,
which you could implement just as two buttons side by side,
would really come in handy.
ALEX LUCAS: Yeah.
TREVOR JOHNS: Yeah.
I think this is definitely a good one to bring up as an
example on Roman's show.
Too.
But I think that pretty much answers the question of what's
the best way to do this.
If you do have any more questions, again, feel free to
pop on to Hangout.
If anybody on Hangout right now has any questions, I think
now's the time to speak up.
We are at the end of our pre-submitted
questions for the day.
So if nobody else has any questions--
anybody signing on there?
Nope.
All right.
DAN: We actually have one unrelated question.
TREVOR JOHNS: Oh.
Sure, let's take it.
DAN: "Where's the tortoise?" Which is, I guess, a reference
to "Doctor Who."
TREVOR JOHNS: Yeah, well, our tortoise is--
ALEX LUCAS: Where is our tortoise?
TREVOR JOHNS: It's up on the shelf
DAN: Yeah, it's-- so the answer is it's still there.
TREVOR JOHNS: It's still there, just right off camera.
ALEX LUCAS: It's off camera, yeah.
TREVOR JOHNS: It's up and to the--
I guess Alex is on the right on your screen.
It's up and to the right behind Alex's head.
And you can still that little green Android there and the
red Android jelly bean jar just to the right of it.
It's right next to the jelly bean jar.
It's still there.
ALEX LUCAS: We had a time machine question, and we
didn't even have a tortoise on hand.
TREVOR JOHNS: It's still broken.
It still doesn't travel through time.
We still can't answer those questions that
require time travel.
ALEX LUCAS: It's in the garage right now.
TREVOR JOHNS: Yeah.
But, no, it's still there.
As soon as we get it fixed, we'd love to answer your
questions about the future.
But somehow I don't think we have any Time Lords on staff.
ALEX LUCAS: It's a shame.
TREVOR JOHNS: It is.
ALEX LUCAS: We keep trying to hire them, but no one ever
takes the gig.
TREVOR JOHNS: Well, we have trouble getting
in touch with them.
They keep floating around through time.
ALEX LUCAS: Right.
TREVOR JOHNS: Anyway, I think that's all the time we have
today for questions given that we're out of questions.
So if you do have any questions for next week's
show, be sure to hop onto Google Moderator and submit
them ahead of time.
The earlier you submit them, the better
answers we can give you.
We usually reset Moderator about an hour or two
after the show ends.
So if you're watching this pre-recor-- or if you're
watching this live, wait a little bit.
If you're watching the recorded version, it's
probably already up right now.
You can access the Moderator page by going to either our
Plus page-- developer.android.com/plus.
or searching for Google Developers Live and accessing
our page from the Google Developer Live homepage.
So with that said, I think it's time to say
goodbye for this week.
ALEX LUCAS: Yep.
Goodbye for this week.
TREVOR JOHNS: Yep, all right.
And again, we're every Wednesday, 2:00 PM Pacific.
Send us your Android questions, and we'll answer
them for you.
All right, see you everyone.
ALEX LUCAS: Bye, guys.