Tip:
Highlight text to annotate it
X
SPARKY RHODE: Good afternoon, everybody.
Welcome once again.
It's Wednesday afternoon, and we are the EMEA-based Android
Developer Relations Team at Google TV-- team here to talk
to you about Android Development.
I'm Sparky, coming to you from Munich, Germany.
And we've got Matt and Nick and Rich in London, UK.
And who is this fourth face that we see?
RICH HYNDMAN: Yeah.
Hi, there.
We have a guest with us in the UK office again this week.
This week it's Chris Banes.
CHRIS BANES: Hi, guys.
MATT GAUNT: [LAUGHS].
[LAUGHTER]
RICH HYNDMAN: Just hi.
CHRIS BANES: Hi.
RICH HYNDMAN: Do you want to say a little bit about Android
stuff that you've done before, maybe?
Or--
CHRIS BANES: Besides stream on over from--
RICH HYNDMAN: Spot total.
CHRIS BANES: Yeah.
So some of the stuff-- sort of got pulled the refresh
library, wrote FriendCaster, also it's a bit--
a lot, really--
that didn't quite go with these.
RICH HYNDMAN: Generally awesome in the Android
community over here.
So, hi.
CHRIS BANES: Hi.
[LAUGHTER]
CHRIS BANES: Hi to Richard.
SPARKY RHODE: Welcome to the Hangout.
RICH HYNDMAN: Yeah, good Hangout.
So we're hoping quite a lot of you join in today--
[LAUGHTER]
RICH HYNDMAN: Because we only have three questions in the
Moderator for this week.
If not, it'll be quite a short session.
So if you have Android development questions, please
come along and join us in the Hangout, or
comment on the G+ thread.
If you can't get in, then we'll invite you in so you can
ask your questions live.
Else, add some more questions into the
Moderator to keep us going.
SPARKY RHODE: Three questions.
I'm impressed.
That's a 50% improvement over the last time I looked.
RICH HYNDMAN: [LAUGHS].
Two questions, and one thing that says, "This is not a
question, but enjoy your Hangout.
Thanks,
Andrew Kelly." [LAUGHTER]
RICH HYNDMAN: One-man Moderator machine when he's
not adding questions into the Moderator, still
filling it up for us.
NICK BUTCHER: Andrew Kelly, on G+ the other day, was saying,
when will Droidcon come to Australia?
And I was telling him that Droidcon's not
organized by Google.
It's a community-run event.
Anyone could set up a Droidcon, so--
I think.
[LAUGHTER]
RICH HYNDMAN: Yeah, certainly.
Right.
NICK BUTCHER: So, I think Andrew should
organize one in Australia.
RICH HYNDMAN: Yeah.
MATT GAUNT: Yeah.
NICK BUTCHER: I will go.
RICH HYNDMAN: We can introduce you to the Droidcon organizers
if you want to get--
au.droidcon.com.
NICK BUTCHER: I'm prepared to go to Australia.
RICH HYNDMAN: I believe they do have to license the name.
MATT GAUNT: No.
NICK BUTCHER: They licensed the word
"Droid," yeah, they did.
MATT GAUNT: See, I thought Droidcon wasn't organized by a
central thing.
It was basically like ad-hoc people could do it.
And then, now they're discussing that maybe they
should make it a slightly more sort of collaborative effort
so that you have to kind of go through them to then sell any
Droid components.
RICH HYNDMAN: If any of the Droidcon organizers are
watching this--
MATT GAUNT: They are free, though.
RICH HYNDMAN: They are free, yeah.
If anyone knows, pop in and tell us,
actually, so we stop guessing.
[LAUGHTER]
RICH HYNDMAN: Because that's just dangerous.
[LAUGHS].
Yossi.
Hey there.
Good to see you again.
Thanks for joining.
Do you have any questions for us today?
YOSSI ELKRIEF: Hi.
Hope you can hear me now.
RICH HYNDMAN: Yeah, we can hear you fine.
YOSSI ELKRIEF: OK.
Just wanted to ask about implementing or using Google
Hangouts API inside an Android application, and what are the
baseline guidelines for that and so on?
RICH HYNDMAN: The Hangouts [INAUDIBLE]?
NICK BUTCHER: Yeah, so there aren't any.
Because there isn't any.
MATT GAUNT: [LAUGHS].
RICH HYNDMAN: To my knowledge, that doesn't exist.
Have you found something we don't know about?
YOSSI ELKRIEF: No, we're thinking to build an
application and try to see if there is any API for Hangouts.
Also for Android, not only for web.
RICH HYNDMAN: Uh-huh.
YOSSI ELKRIEF: Didn't find any.
So I just wanted to ask if--
RICH HYNDMAN: No, I mean the people-- you should head to
the "Google+ Office Hours." They host office hours as
well, at developers.google.com/live,
and have a chat with them.
They might be able to talk to you about any APIs that there
are for Hangouts.
YOSSI ELKRIEF: OK.
RICH HYNDMAN: At the moment, I think the Hangouts APIs
revolve around adding functionality
to Hangouts, not--
[INTERPOSING VOICES]
RICH HYNDMAN: Sites.
[INAUDIBLE].
MALE SPEAKER: Their applications.
RICH HYNDMAN: Who's that making noise?
That's almost muted.
MATT GAUNT: [LAUGHS].
RICH HYNDMAN: I was gonna say, where's Al Sutton
when you need him?
But of course, Al Sutton's off playing with Booyah!
He got his first Booyah! hardware during the week.
NICK BUTCHER: Yeah.
RICH HYNDMAN: So he's probably--
CHRIS BANES: Swell.
RICH HYNDMAN: --just playing games.
NICK BUTCHER: Just a ball.
RICH HYNDMAN: If you're watching, Al, enjoy that.
Right.
I'm just going to pull up the comments thread as well, just
to make sure we don't miss anything.
NICK BUTCHER: One request that I've seen.
MALE SPEAKER: Yeah.
MALE SPEAKER: Right.
Are you there?
SPARKY RHODE: I notice that we've been joined in the
Hangout by a couple of newcomers.
We've got Paul, and we've got Stephano.
Welcome, guys.
Do you have anything on your mind that you'd
like to bring up?
Any Android-related topics that you'd like
to talk about now?
PAUL: Hello?
Can you hear me OK?
MATT GAUNT: Hey, Paul.
PAUL: Hi.
Good to meet you guys a week ago.
MATT GAUNT: You too.
RICH HYNDMAN: Yeah, you too.
Hey.
PAUL: That was good fun, and good to see what's going on
with Android.
MALE SPEAKER: Mm-hmm.
PAUL: I do have one quick question.
I can't remember--
I spoke to somebody, I can't remember who it was--
about submitting the NFC fix as a patch.
MALE SPEAKER: Yep.
PAUL: Can someone tell me where to go
or what to do, please?
NICK BUTCHER: Yeah.
If you go to source.android.com--
PAUL: Yep.
NICK BUTCHER: There's a section there about how to
submit a change.
PAUL: Oh, OK.
Cool.
Sounds easy, then.
[LAUGHTER]
NICK BUTCHER: Well, yeah.
I guess so.
You have to kind of create your own [? garret ?] and all
that stuff.
Yeah.
PAUL: OK.
Well, I'll have a look at it anyway later on.
Thank you very much.
NICK BUTCHER: Cool.
You're welcome.
Any other questions?
Who asked about-- who's just joined us?
MATT GAUNT: Stephano?
SPARKY RHODE: Yeah.
Stephano.
Welcome to the Hangout.
What's on your mind?
STEPHANO: Hello.
I am an Italian student.
I don't speak great English.
[LAUGHS].
SPARKY RHODE: That's fine.
STEPHANO: For money.
I develop only an app for Android.
It's just a benchmark.
SPARKY RHODE: OK.
What sort of a benchmark?
Like performance?
STEPHANO: Yeah.
SPARKY RHODE: Are you doing native code or like web
performance or Java VM?
What are you--
STEPHANO: No, job performance.
SPARKY RHODE: [INAUDIBLE].
OK.
Cool.
So how long have you been working on it?
STEPHANO: About half a years.
SPARKY RHODE: OK.
So what's your impression of Android as
a development platform?
Do you have any favorite APIs, or something that you wish
that we would fix?
STEPHANO: Um--
sorry.
I didn't understand.
SPARKY RHODE: Oh.
So what parts about Android do you like working with?
And what parts about Android do you think maybe you would
like to see some changes in?
STEPHANO: For me, Android is perfect at the moment.
NICK BUTCHER: [LAUGHS].
SPARKY RHODE: Yeah!
RICH HYNDMAN: I agree.
STEPHANO: It's a very good platform.
SPARKY RHODE: OK.
Very well said.
I'll send you your money later.
[LAUGHTER]
SPARKY RHODE: [LAUGHS].
Cool.
RICH HYNDMAN: OK.
Just updating a couple of the threads to make sure everybody
knows where the Moderator and where this
session's actually at today.
NICK BUTCHER: Should we take a look at some of the Moderator
questions, Sparky?
SPARKY RHODE: Sure.
There's not a whole lot here, as I had said.
The first one's kind of interesting.
This one's from our friend Johan in the Netherlands.
Says he wants to create two skins for the app, which he
equates to having different resources.
And he wants to basically know, what are best practices
for doing this?
Should he create a library project with, then, two
different sets of resources, or sort of riff on that?
And just as an aside, he also mentions that he's using Maven
to build it, in case that makes a difference.
Responses from Andrew Kelly and Yossi
suggest using themes.
But I'm thinking maybe--
I mean, what if he doesn't want the assets for both
branches of the app in the same binary?
RICH HYNDMAN: Yeah.
SPARKY RHODE: In the same APK.
Like maybe one is for a client or something like that.
NICK BUTCHER: Chris, FriendCast is supporting
multiple themes.
How did you go about that?
CHRIS BANES: Yeah.
So all the graphics were in the same APK.
So it was all done on Styles and Themes.
Custom attributes.
NICK BUTCHER: And then how do you set it?
You just call setTheme?
Or do you do it--
CHRIS BANES: Yeah, so in your activity, before you call
super.onCreate, it's copy before,
but you call setStyle--
is it setStyle or setTheme?
NICK BUTCHER: SetTheme.
RICH HYNDMAN: SetTheme, yeah.
YOSSI ELKRIEF: SetTheme.
CHRIS BANES: Yeah.
So you call that with your-- the style you want.
So you can call it-- so change your other preference or
whatever you need to do.
NICK BUTCHER: So, if you change style, you have to
recreate the activity?
CHRIS BANES: No.
It does it.
So as long as you call setStyle before you call
super.onCreate, it works.
If you call it after, bad things happen.
[LAUGHTER]
SPARKY RHODE: OK, so--
[INTERPOSING VOICES]
SPARKY RHODE: Dynamically--
you're dynamically switching your theme--
basically, the drawable resources that compose your
theme right at an instantiation of
the activity, then?
CHRIS BANES: Yeah.
SPARKY RHODE: Wow.
OK.
MATT GAUNT: So you'd have to--
SPARKY RHODE: So this is--
CHRIS BANES: That's how I did.
RICH HYNDMAN: Yeah.
MATT GAUNT: So you'd have to do that for each activity?
You couldn't do that on like an application one table?
CHRIS BANES: Yes, but if you create a base activity--
NICK BUTCHER: Yeah.
CHRIS BANES: And then just extend from
it all, it all works.
RICH HYNDMAN: Good tip.
So this is going to depend on whether he wants to have an
app which can change themes on user request--
which you would restart your activity and change it, and
put both sets of themes in the APK-- or whether-- yeah.
You're trying to re-skin the same application with multiple
clients, when you don't want all the resources in both, in
which case the library project would be a great way to go.
NICK BUTCHER: Mm.
RICH HYNDMAN: And then add the themes to--
SPARKY RHODE: Have any of you guys worked with apps that
have downloadable skins, like Beautiful Widgets or
something like that?
RICH HYNDMAN: Yeah.
What about them?
SPARKY RHODE: I just would like--
do you know how they organize their themes there?
Are they--
NICK BUTCHER: It's like a player.
[INAUDIBLE] then.
CHRIS BANES: Beautiful Widgets, they download into
the SD card.
And then they load the images via FRED, and then just set
the drawables on each view to sort them manually.
SPARKY RHODE: Right.
So they're not using the resource framework?
They're just using drawables?
CHRIS BANES: There are apps-- so all the apps where the
themes are done out of a Google Play,
they're done by resources.
So I think you can access external resources via
PackageManager, if I remember rightly?
RICH HYNDMAN: Mm-hmm.
CHRIS BANES: But I've not done it.
So, can't comment.
RICH HYNDMAN: Excellent.
SPARKY RHODE: Yeah.
I know I've seen apps on other platforms where it was-- you
could have these skins, and it was very important that your
resources be numbered with exactly the same identifiers
as in the base project, and so--
RICH HYNDMAN: It's one example of where developers and
designers collide.
For the latest updates, the ultimates, [INAUDIBLE]
[? Marie ?]
wanted to change the theme as he went
through to the countdown.
But of course, that would require--
it was in a ViewPager, so he could swipe across the
countdown, but it required restarting the activity to
change the theme, which I didn't find a solution around,
unfortunately.
So we couldn't get--
[INTERPOSING VOICES]
NICK BUTCHER: And watch them fake it out.
RICH HYNDMAN: Action bar.
Yeah.
[LAUGHS].
But the Action bar had tabs in it, and a drop-down overflow,
and buttons.
And I didn't really want to go there.
So it didn't happen.
MATT GAUNT: The only kind of thing that I've done remotely
like this is the scenario where you have multiple
clients wanting pretty much the same app
with different themes.
And yeah.
The library route is probably best way to go, because you
have to remember when you publish into Play Store, you
need a different package name from everyone else.
So then, yeah.
So you'd basically have to start doing that about your
resources, so--
Yeah.
That's the only sort of comment I have.
RICH HYNDMAN: [LAUGHS].
Nice.
OK.
Hopefully that's answered your question, Johan.
I know you're gonna watch this a bit later on.
Sorry, you've got some comment on that?
Paul?
Were you just gonna--
jump in there?
PAUL: Yeah, I was just gonna say something on a sort of
different topic.
But if you're talking on this topic, I
can wait for a moment.
NICK BUTCHER: No, go for it.
I think we're done.
RICH HYNDMAN: Go on, then.
PAUL: On the 4.2, I'm quite anxious in this ability to log
on to this tablet or device for multiple users.
RICH HYNDMAN: OK?
PAUL: Can anyone shine a bit more light on that?
For example, I presume the apps have their own data areas
for-- per user.
Will things like Contacts and other things be
user-specific as well?
RICH HYNDMAN: Yes.
The answer is yes.
You--
it's very much like having your own individual tablet.
PAUL: So like, everything would be working in the same
way as the Contacts and--?
RICH HYNDMAN: Yeah.
The only thing that's shared are the application binaries
themselves.
So--
PAUL: So if you download an app under one user, the other
user would be able to see that same app
downloaded into their--
no.
RICH HYNDMAN: No, but if they go to Google Play and then try
and install that same app, it will install instantly.
It won't do the download again.
PAUL: OK.
So it just copies itself in the--
locally.
RICH HYNDMAN: Locally, I don't actually know if it's copying
itself or just setting permissions or making it--
linking it or doing something.
But it becomes--
PAUL: OK.
RICH HYNDMAN: It'll be available.
The app binaries.
Yeah.
SPARKY RHODE: Hey, Rich, do you know, what about apps that
download substantial amounts of supplemental data?
Say, like your game apps that have 400 megs of resources?
RICH HYNDMAN: That's gonna depend on the app itself and
how they've implemented that.
So if they--
yeah.
I haven't tried it.
NICK BUTCHER: Hm.
RICH HYNDMAN: Not quite sure.
My guess is that it would have to probably download that set
of resources again, but I don't actually know.
We'll try and dig out some recommendations for you.
PAUL: OK.
[INTERPOSING VOICES]
RICH HYNDMAN: On the fly.
YOSSI ELKRIEF: About that issue?
RICH HYNDMAN: Sorry?
YOSSI ELKRIEF: Regarding the storage.
RICH HYNDMAN: Mm-hmm?
YOSSI ELKRIEF: If we were using an external storage as
caching for images or so on.
RICH HYNDMAN: Yeah.
YOSSI ELKRIEF: Each user won't see the folder we created for
the different users?
SPARKY RHODE: I believe that's correct.
YOSSI ELKRIEF: Because basically today we're creating
a folder on the SD card, get external storage, and then
we're creating a folder for lazy loading the
images and so on.
RICH HYNDMAN: Yeah.
So an example is the Gallery and the Cameras.
So if I go into one profile and take a picture, it goes
into a slash SD card, DCIM, whatever it is.
Puts it in there.
If I switch users, then I get a completely different view of
that folder, and I can take--
I don't see the photos that the original user took.
SPARKY RHODE: Hmm.
NICK BUTCHER: So each user has a view of the
SD card, as it were.
SPARKY RHODE: Is it mounting a completely separate volume?
RICH HYNDMAN: Well, this is-- all of our devices don't have
the external SD card, of course.
So that could be a different matter of people releasing
this with that.
I don't know how it would work at the moment.
PAUL: Does anyone know what security
implications this may have?
Although they're in different areas, is it completely secure
in terms of-- from one user to another?
SPARKY RHODE: I think it's a--
RICH HYNDMAN: Yeah.
Pass to Nigel at the moment, because we haven't tested it
out on any devices that do have SD cards.
My guess is if you've actually got an external SD card and
you're using this, then you can still take it out and read
the space on it--
that you'd be able to see each other's data on the SD card.
But I don't actually know.
There are no devices that support that at the moment.
PAUL: OK.
RICH HYNDMAN: For us to try it out on.
NICK BUTCHER: And what do you mean by completely secure?
I mean, what is that?
PAUL: What I mean is, from--
I don't mean by external SD cards.
I mean from one user to another, in terms of--
obviously, if they can't see the data, they probably can't
read it in any other way outside of the app.
SPARKY RHODE: I believe the intention is for the users to
be completely firewalled from each other.
PAUL: OK.
SPARKY RHODE: Our sample use case is an enterprise use
case, right?
Where you've got two enterprise users sharing one
physical tablet and--
PAUL: Exactly.
NICK BUTCHER: I call that sample use case is the family.
[LAUGHS].
You have a tablet--
RICH HYNDMAN: I agree, yeah.
NICK BUTCHER: Coffee table.
You don't want to hand it to your kids when it's logged
into your Gmail and your Twitter and everything.
CHRIS BANES: But I'm sure if you turn on the encryption--
it's gonna be turn on encrypt storage or what
the option's called--
that at least encrypts the SD image.
I'm guessing.
I don't know.
MATT GAUNT: It would be interesting.
If you were encrypting stuff on the SD card, you'd have to
use a different key for each--
YOSSI ELKRIEF: User.
MALE SPEAKER: Yeah.
MATT GAUNT: And then at that point, it would be
specific to that user.
That might be quite a nice way of doing it.
SPARKY RHODE: I seem to recall that the coffee table model
was explicitly not one of the use cases that we tried to
optimize for this generation of the feature.
Because that implies things like an administrative user,
aka a parent, who is controlling the tablet usage
experience of another user, aka the child.
And that sort of management
infrastructure is not included.
NICK BUTCHER: Huh.
RICH HYNDMAN: [SIGH].
Interesting.
NICK BUTCHER: Yeah.
Hm.
RICH HYNDMAN: [LAUGHS].
Yeah.
That's certainly my use case for it, anyway.
MATT GAUNT: Hm.
RICH HYNDMAN: To keep my own profile secure, and while the
kids still get to play their games.
And it's very easy just to switch between the profiles.
Just tap on the Power button.
And hand it over.
MATT GAUNT: Yes.
You've had a recent use case of that haven't you?
[LAUGHS].
RICH HYNDMAN: Yes.
I have.
MATT GAUNT: So we've been joined by some new people.
RICH HYNDMAN: Let's have a look who's in here with us.
SPARKY RHODE: I have to say, I was stunned the other day to
walk into the living room and discover that the
three-year-old had found my Galaxy Tab, taken it down,
unlocked it, started a game, and actually been playing the
game all without any adult assistance whatsoever.
Nobody told her how to play this game.
She just started doing it.
PAUL: There you go.
RICH HYNDMAN: Their skills these days.
MATT GAUNT: [LAUGHS].
RICH HYNDMAN: Welcome to the new guys who have just joined
us in the Hangout--
Leslie, I think it's Christian--
LESLIE: Hi.
RICH HYNDMAN: Nice to see you guys.
Do any of you have any questions for us?
LESLIE: Yeah.
Do you guys know how to take a snapshot in code?
I found this screen shot code.
[INTERPOSING VOICES]
LESLIE: I actually want to do it and send the image across a
connection.
MATT GAUNT: So, do you mean take a screen shot from code,
is that basically it?
LESLIE: Yes.
MATT GAUNT: Of the whole device, or just do
it within your app?
LESLIE: The whole device, the whole screen.
RICH HYNDMAN: Oh, no.
That's not possible.
That would be a security hazard if you had a service
running in the background that could take screen
shots of the device.
You can take screen shots of your application.
LESLIE: Yeah.
RICH HYNDMAN: Anything else isn't available
to the average product.
MALE SPEAKER: Yeah, right.
RICH HYNDMAN: It's all in a secure product.
MALE SPEAKER: [LAUGHS].
[INTERPOSING VOICES]
LESLIE: OK.
RICH HYNDMAN: There's nothing.
CHRIS BANES: DDMS isn't?
[INAUDIBLE].
[INTERPOSING VOICES]
LESLIE: Yeah.
I found the DDMS solution, but it's quite untidy.
RICH HYNDMAN: Yes.
LESLIE: And we want to put this on thousands of devices,
so we kept [INAUDIBLE] want to do that.
Mm-hmm.
MALE SPEAKER: Yeah.
MATT GAUNT: Is this purely for testing?
LESLIE: It's more for road support.
MALE SPEAKER: Shall I go?
LESLIE: It's a matter of showing us what the user has
on the other side.
MALE SPEAKER: Yeah.
It's a dog show.
Yeah, I think it will be fine.
RICH HYNDMAN: Yeah.
You'd either have to guide them through taking the screen
shots or [INAUDIBLE].
[INTERPOSING VOICES].
MALE SPEAKER: He said he will not go.
LESLIE: OK.
Well, I tossed.
RICH HYNDMAN: Don't you have access to [INAUDIBLE]?
[INTERPOSING VOICES]
LESLIE: Yeah.
RICH HYNDMAN: Front rows?
[INTERPOSING VOICES]
LESLIE: Ah, no.
We're putting it on Samsung devices now, so we can't get
the app signed.
RICH HYNDMAN: OK.
Fair enough.
No, in which case I don't know of a way.
Samsung do have a Screen Shot button of their own, so maybe
if you're talking to them, you can ask them about that.
MALE SPEAKER: Yeah, that's actually--
RICH HYNDMAN: And if they have any APIs for it for apps that
they're assigned, you shouldn't have problems.
[INTERPOSING VOICES].
MALE SPEAKER: No, your mute button.
[INAUDIBLE].
LESLIE: Yeah.
The signature's not a problem with you.
We can get that done.
MALE SPEAKER: Traditional what?
MALE SPEAKER: [INAUDIBLE].
LESLIE: They used, I think, called [? Sortie, ?]
and it's all built into their API.
And we don't especially want to use [? Sortie, ?] but it
costs a fortune.
RICH HYNDMAN: Yeah.
He's heard of that.
MALE SPEAKER: Remember what our teachers--
RICH HYNDMAN: But we're back now.
OK?
Cheers, Leslie for that question.
LESLIE: Yep.
RICH HYNDMAN: Do you have any others?
LESLIE: Not right now.
RICH HYNDMAN: All right, anybody else who has joined us
have any questions?
NICK BUTCHER: Just [INAUDIBLE]
Hangout.
RICH HYNDMAN: Oh, really?
Yeah, we've got--
I hear people coming in.
Have they?
NICK BUTCHER: Loads of questions.
RICH HYNDMAN: All right.
FEMALE SPEAKER: [INAUDIBLE] mute?
RICH HYNDMAN: Can we just get a mute from, maybe, Leslie?
MATT GAUNT: Yeah, there we go.
RICH HYNDMAN: Excellent, thank you.
MATT GAUNT: Cool.
RICH HYNDMAN: So--
MATT GAUNT: I think we've got a question?
RICH HYNDMAN: A question from--?
MATT GAUNT: There we go.
RICH HYNDMAN: What are you pointing at?
MALE SPEAKER: You're with--
MATT GAUNT: The girl with her hand up.
I can't see--
RICH HYNDMAN: Oh, Donna.
Hey.
MATT GAUNT: Sorry.
RICH HYNDMAN: You can just speak.
It's OK.
MAXIM: [LAUGHS].
RICH HYNDMAN: Nice to see you there.
MAXIM: Nice to see you too.
RICH HYNDMAN: Is this the first time you've joined one
of our Hangouts?
MALE SPEAKER: Oh.
MAXIM: Yes, well, actually I have been watching on quite or
for long time over YouTube, but I didn't participate.
So [INAUDIBLE].
MATT GAUNT: Long time watcher, first time joiner.
RICH HYNDMAN: I can't actually see your name on the screen.
What was your name?
MAXIM: My name is Maxim.
RICH HYNDMAN: Hey, Maxim.
SPARKY RHODE: Maxim, hello.
RICH HYNDMAN: Thanks for joining.
And what's your question?
MAXIM: So I had an application on the Market which uses phone
states and then-- well, obviously I have--
it won't set permission.
And I'm importing the new updates--
just yesterday.
Tried to upload the new update and somehow Market tells me
that it's now targeting less devices than it's used to.
And apparently it's because it has edits and
new permissions there.
Well, it's not [INAUDIBLE]
manifest, but the Market shows that I have--
it's called low permission.
And it's saying it's got a severe situation.
In fact, I don't want to--
NICK BUTCHER: So you're sure-- you're definitely asking for
any new permissions in the new APK?
MAXIM: I'm not asking for a permission
which has been added.
It seems that it has been added somehow.
NICK BUTCHER: So the source of truth there is to do--
use aapt.
So if you do aapt dump badging--
MAXIM: Mm-hmm.
NICK BUTCHER: And then, in the path to your APK,
that will tell you--
that will export all the permissions.
Because that will show you even the implied permissions,
like some permissions are implied by others.
So it will explicitly list out all the permissions you are
asking for.
So that's the source of truth.
So if you can do that, and if it doesn't match up to what
you're seeing when you upload it to the Play Store, then
that sounds like a bug.
So let us know if that doesn't match up.
MAXIM: I see.
I see.
OK, I will try it using that.
So actually the secret--
if I understand correctly, the situation is that some of the
libraries that I may be using may be requesting for that
permission.
Is that correct?
NICK BUTCHER: It could well be, yeah.
Well, that would have to be in your manifest, right?
CHRIS BANES: Yeah.
NICK BUTCHER: They can't just imply them.
MAXIM: Oh no.
It was not under the installation to me, because I
don't see it anywhere, and it's there.
NICK BUTCHER: Yeah.
MAXIM: Oh.
NICK BUTCHER: Yeah, yeah.
Check your manifest and use aapt dump badging--
MATT GAUNT: Yeah.
NICK BUTCHER: Is the way to get to the bottom of this.
MAXIM: All right.
Thanks.
NICK BUTCHER: Cool.
No, thanks for the question again.
Let us know how you get on.
Oh, we seem to be joined by some new people as well.
Welcome to the Hangout.
Does anyone have any Android development questions?
[INDISTINCT VOICES]
NICK BUTCHER: [LAUGHS].
MATT GAUNT: Ah--
RICH HYNDMAN: What?
CHRISTIAN: Be there.
Be there.
SPARKY RHODE: Let's pick on somebody.
How about Christian?
Christian, what's up?
[LAUGHS].
SPARKY RHODE: If you're not able to talk where you are
now, you're also welcome to type into the sidebar.
RICH HYNDMAN: Just click on Chat.
[INDISTINCT FEMALE VOICE]
SPARKY RHODE: I'll just go and see if there's any new
questions in the Moderator.
RICH HYNDMAN: OK.
SPARKY RHODE: There is.
There is.
NICK BUTCHER: Marvelous.
CHRISTIAN: Or a couple words of it.
SPARKY RHODE: Or--
RICH HYNDMAN: Whatever.
Bring up the trusty Nexus 7.
[INDISTINCT FEMALE VOICE]
SPARKY RHODE: "After uploading new app version to Market, two
new permissions were automatically added."
RICH HYNDMAN: We just answered that question.
MATT GAUNT: [LAUGHS].
SPARKY RHODE: Oh, that's right.
This is actually Maxim's question.
OK, so this is Maxim.
RICH HYNDMAN: [INAUDIBLE] about the Action bar, maybe.
[INTERPOSING VOICES]
SPARKY RHODE: "[INAUDIBLE]
want to implement Action bar.
But in Developer Console, half of the users show they're
still using 2.3."
RICH HYNDMAN: [INAUDIBLE].
SPARKY RHODE: "So shall I create two different APKs?"
No, use ActionBarSherlock.
RICH HYNDMAN: Yep.
ActionBarSherlock's a great solution for that, and it's
exactly what it's meant for.
It's very easy to add in, and works with the support library
Fragments and everything.
MALE SPEAKER: Hm.
[INDISTINCT FEMALE VOICE]
RICH HYNDMAN: Next one?
NICK BUTCHER: Waits for it.
MATT GAUNT: [LAUGHS].
NICK BUTCHER: Yeah, so--
MATT GAUNT: I'm waiting.
NICK BUTCHER: Lucas--
I guess it's Lucas Rutger-- asks a question about themes,
and that certain OEMs have changed the default themes
that apps ship with.
So he says that, "assuming that the Options menu is black
in Gingerbread is not
necessarily true on all devices.
How should you handle this?"
So, yeah, this is problematic.
And I guess this is why we introduced Holo styles which
OEMs can't modify, so that you can extend those styles and
know what you're gonna get.
The best advice is really to use the
built-in Styles and Themes.
So you can use the things like--
the text styles like inverse and color primary--
color inverse--
I think that's who it is?
CHRIS BANES: That's correct.
NICK BUTCHER: Styles that you can use.
So, using those styles, hopefully if they've modified
one of the values, they should have modified the other value,
is really the best you can do in those circumstances.
And your advice--
SPARKY RHODE: [INAUDIBLE].
YOSSI ELKRIEF: Maybe using the folder--
the library Holo everywhere?
MATT GAUNT: Mm-hmm.
RICH HYNDMAN: Yeah, not a bad solution.
Put Holo everywhere.
[INTERPOSING VOICES]
YOSSI ELKRIEF: Put Holo on--
NICK BUTCHER: On the Options menu, but yeah.
RICH HYNDMAN: Yeah.
CHRIS BANES: The Option menu isn't customizable.
Their themes.
Yes, they need more [? platform stuff. ?]
You'll not be able to change anything further.
There are hacks you can do, but they're hacks.
[LAUGHTER]
YOSSI ELKRIEF: [LAUGHS],
NICK BUTCHER: I guess he's probably asking about icon
colors and stuff like that.
So you might want to set--
RICH HYNDMAN: Or use the system icons, maybe.
CHRIS BANES: Yeah.
MATT GAUNT: There's always been a set of guidelines for
system icons and stuff, like to replicate them.
So--
RICH HYNDMAN: Really?
MATT GAUNT: Always do try and stay with that if you're
looking at icon--
RICH HYNDMAN: Yeah, the icon builder only does one set,
doesn't it?
For Gingerbread.
MATT GAUNT: Yeah.
If you start playing around with colored icons and stuff,
and we're not really recommending it, then we're
not recommending it for a reason.
So yeah, you're gonna have a bad time.
[LAUGHTER]
RICH HYNDMAN: OK.
NICK BUTCHER: Taking a slight [INAUDIBLE].
RICH HYNDMAN: Where's-- oh, Sparky's still there.
I thought we'd lost him for a second there.
Next one?
Shoot.
SPARKY RHODE: Mm.
RICH HYNDMAN: What's that?
SPARKY RHODE: Ah.
"Is there a right way to add tabs to a multi-pane view?" He
goes on to say he was talking about doing two panes, where
the right pane needs to have tabs in it, like the one in
the Google Play Store, with a menu on the left-hand side.
Hm.
RICH HYNDMAN: That's right.
Go to the Play Store "Hours."
MATT GAUNT: Yeah.
[LAUGHS].
RICH HYNDMAN: So, Chris?
You want to--
CHRIS BANES: I actually went for this pane
every day when I was--
I've done enough of mine.
I decided not to go with tabs, and I went
with dialogs instead.
So we set it on the right pane.
I'd just open a dialog.
The other way to do it is via a library called
ViewPageIndicator.
So I'm guessing that the right pane is in a ViewPager.
So you can use the Indicator to actually
show where you are.
It's not quite Tab, but it's near enough that
you could use it.
So you replicate the Tab function in the right pane.
And that's the way I'd probably go with it.
RICH HYNDMAN: Sounds good.
SPARKY RHODE: Yeah, I think that's a good answer.
If I was doing it myself, I would probably cop out and
just use a ListView.
[LAUGHS].
But that's just me.
RICH HYNDMAN: I'd put the tabs in the Action bar,
but there you go.
CHRIS BANES: [? Tourilla ?] is the tourist's top left.
And then the right pane is--
RICH HYNDMAN: But yeah, I'm not [INAUDIBLE].
NICK BUTCHER: Yeah, it's not that way.
RICH HYNDMAN: Ringo?
[LAUGHS].
It's still what I think.
[LAUGHTER]
RICH HYNDMAN: What would you do, Nick?
NICK BUTCHER: So, well, it says you've got like a
two-pane view, and the right-hand pane is--
RICH HYNDMAN: That's not-- yeah.
NICK BUTCHER: Swipeable?
CHRIS BANES: Well, not so much swipeable, but changeable.
See?
NICK BUTCHER: Yeah.
CHRIS BANES: It's got temper.
NICK BUTCHER: [INAUDIBLE] in the pane.
So yeah, ViewPageIndicator.
So you can't use Pager as a title strip?
You tried using that?
CHRIS BANES: You can use Pager Title Strip, yeah.
NICK BUTCHER: Yeah.
What source from?
[LAUGHTER]
MATT GAUNT: Yeah.
I'm getting very confused as well.
Because that's what I think--
CHRIS BANES: Well, that was my-- well, I did say Page
Title Strip, but--
NICK BUTCHER: Yeah, Page Title Strip or ViewPageIndicator
will do the same thing, then.
Will get you there.
SPARKY RHODE: I'm trying to bring up the Store to see if I
can figure out what he's talking about, but I'm not
really seeing this--
RICH HYNDMAN: No, I think we've figured it out.
It's all right.
I think we can--
go on, say it, Matt.
Say it.
MATT GAUNT: Next, my friend.
CHRIS BANES: Oh, yeah.
RICH HYNDMAN: [LAUGHS].
Next message.
NICK BUTCHER: So Droid Nerd in Germany asks, "Is there a
possibility to find out the home country of a logged-in
Google account on Android?
We want to show content based on the user's home country.
The home country would be used for display correct
currencies, too."
MATT GAUNT: Hm.
NICK BUTCHER: I don't think there is a
way to find the country.
I think your best bet is probably to create a locale of
the device.
SPARKY RHODE: Right.
And that's a user setting, not
necessarily a physical presence.
YOSSI ELKRIEF: Yeah, but you can check the IP address.
RICH HYNDMAN: You could do a Google--
YOSSI ELKRIEF: Know it's your IP or something.
RICH HYNDMAN: Who knows where that runs?
NICK BUTCHER: No, well, actually where the
device is, not the--
SPARKY RHODE: Yeah.
The Google Play Store knows where you are, but that's all
server-side detection.
That's not your device.
RICH HYNDMAN: You could check the SIM country as well.
NICK BUTCHER: So my advice would be not
to do any of this.
It would be to respect the locale of the user's cell--
the device.
Because the user has control over these things.
Like currencies, how they're displayed,
dates, how they're displayed.
RICH HYNDMAN: Oh--
NICK BUTCHER: If you try and get a bit too clever, then it
can be annoying.
RICH HYNDMAN: Yeah, but they're probably trying to
implement our recommendation of putting the cost of their
inner items into their application.
SPARKY RHODE: Yeah--
RICH HYNDMAN: Maybe it's just--
SPARKY RHODE: The Location Manager's your best bet.
RICH HYNDMAN: That would be--
NICK BUTCHER: Just respect his locale, then.
RICH HYNDMAN: Like--
SPARKY RHODE: Yeah, yeah.
RICH HYNDMAN: Google respect--
YOSSI ELKRIEF: Basically, the locale is the best option.
MATT GAUNT: I was over in Mountain View--
RICH HYNDMAN: No, no.
The locale is you-- if you've got yours set to UK--
MATT GAUNT: Yeah.
[INTERPOSING VOICES]
SPARKY RHODE: I think the best bet for home country is just
to create a locale.
RICH HYNDMAN: So how did you find out?
MATT GAUNT: Where--
RICH HYNDMAN: Where the Play Store's gonna return.
MATT GAUNT: Oh.
RICH HYNDMAN: [INAUDIBLE]?
MATT GAUNT: Yeah.
RICH HYNDMAN: Or maybe that's not the case
they're asking about.
CHRIS BANES: Yeah.
MATT GAUNT: Yeah.
My suggestion would be to stick with the locale.
And then, if that's not their actual home place, as in,
let's say they are from Germany, but
they switch to English--
British for some reason--
that's what they're more comfortable with--
then give them the option to change it
within Settings somewhere.
RICH HYNDMAN: Mm-hmm.
MATT GAUNT: So it will essentially override it.
Just use it as a default, essentially.
NICK BUTCHER: (WHISPERING) Just make it a Setting?
CHRIS BANES: Yeah, that they need to choose.
MATT GAUNT: Just try and be clever once, and then after
that, let the user change it.
YOSSI ELKRIEF: [LAUGHS].
RICH HYNDMAN: Try and be clever, and
when you get it wrong--
[LAUGHTER]
MATT GAUNT: Let the user take over.
RICH HYNDMAN: Let them override it.
Yeah.
That could work.
YOSSI ELKRIEF: Yeah, but basically the Play Store holds
and checks the locale and also checks the IP.
No?
From where the device is checking the--
MATT GAUNT: The Play Store does all sorts of stuff.
RICH HYNDMAN: The Play Store does get quite a
few different checks.
CHRIS BANES: Right.
SPARKY RHODE: I mean, there's a couple of models.
Like, if you're offering--
like they said--
recommendations, restaurants, shopping, something like that,
then use the Location Manager.
If you're offering content that's kind of spaceless,
like, say, you want to watch a video and you want to know
what language to play the soundtrack in,
then use the locale.
MATT GAUNT: See, the weird thing that I've found since
talking to people in different countries, is that, quite
often, they don't necessarily want to consume content in
their native tongue.
They quite often don't want the dubbed version.
Just a brief side point.
Anyway.
So, yeah.
[LAUGHS].
SPARKY RHODE: I've talked about people about that.
Because Germany is a country that's big
enough where Western--
the entertainment content is almost always dubbed into the
local language.
And the consensus that I've found among the people that
I've talked to here is that, in fact, while there is a
small cadre of people who always prefer it in original
version, overwhelmingly, most consumers do want it dubbed
into their language.
NICK BUTCHER: Hmm.
SPARKY RHODE: Or at least, that's the
case here in Germany.
NICK BUTCHER: Yeah, I think we probably deal
with a selection bias.
And people we're talking to probably speak English.
MATT GAUNT: Yeah, true.
True.
NICK BUTCHER: Next question on the Moderator asks "if there's
any general tips for finding and resolving an annoying,
unknown source of battery drain." So, I'm gonna guess
it's a developer question like you've got a drain in your
app, not just generally my device is running low on
battery, or anything like that.
SPARKY RHODE: Right.
I would say, look at Trevor's talk from Google I/O, where
he's giving the run-down on the--
was it TraceView?
Is that what it's called?
RICH HYNDMAN: Yeah, if you'd--
find out.
NICK BUTCHER: So my general advice is a couple of vendor
tools out there from some of the Silicon vendors that will
help you do this.
So I think ARM has a tool which will help you track the
power usage and so on, depending on which chips that
your device is running.
But generally my advice on these issues is, you're
running on power if you're powering something up.
So if you're keeping the screen on, if you're holding a
wait clock, or if you're doing network,
essentially, are the biggies.
So make sure you understand your usage of those,
especially the wait clock.
Probably the wait clock--
CHRIS BANES: Location is on.
NICK BUTCHER: Yeah.
RICH HYNDMAN: There was a presentation down at Droidcon
UK on Dr Power.
It's one of the apps in the Play Store that can
help you with this.
And it does something similar to the battery stats, but it
does break it down in a lot more detail.
So I was just looking at that now.
SPARKY RHODE: Right.
There's some good sort of best practices, like don't use--
say, if you're doing networking, don't do polling
if you don't have to.
If your data is coming at sort of unpredictable times, then
have a server-side component that can send you a Google
Cloud message quasi-asynchronously.
Or, if you are going to do polling,
don't use exact alarms.
Use something like inexact repeating alarms that will
sort of converge your wake-up times onto a
few selected intervals.
And then all of your apps, who are all using inexact
repeating alarms together, can all be woken up at the same
time, do the network, and shut back down again.
NICK BUTCHER: Yeah.
A lot of this boils down to don't do any work you don't
have to do as well.
So things like listening to the state of the battery and
the network and adjusting your behavior accordingly.
So if the user's battery is under 20%, then maybe you back
off the polling behavior, and don't call so aggressively.
Or maybe you shut down a certain receiver if
you don't need it.
It's just do as little work as possible.
So one of the things I quite often see is people will use
the boot completed listener to schedule any alarms that they
might need to reset, like, say, for
some polling behavior.
Put a [INAUDIBLE] the boot receiver is checked wherever
something should happen.
And if not, just return.
Whereas you're much better off actually just using the Patch
Manager to disable your boot receiver if it's not going to
do anything when you boot, rather than causing an extra
piece of work to be done at quite a strenuous time when
the system's still starting up and there's loads and
stuff's going on.
So it's just like part of being a good citizen, really.
Just don't do any work you don't have to do.
RICH HYNDMAN: OK.
Any more questions from inside the Hangout?
MATT GAUNT: Jeff Gosling would like to be added to the
Hangout, and he has a question.
RICH HYNDMAN: Ooh.
OK.
One, two, three, four, five, six, seven, eight, nine, 10.
He's not gonna get in, [LAUGHS]
but I will add him in anyway, and hopefully--
NICK BUTCHER: We've got some new live participants as well.
Any questions from people in the Hangout?
RICH HYNDMAN: Hey--
NICK BUTCHER: Giuseppe.
RICH HYNDMAN: Giuseppe from--
NICK BUTCHER: I recognize Giuseppe's art.
RICH HYNDMAN: [FINGER SNAP]
--Voice Pro last week.
NICK BUTCHER: Aye then.
RICH HYNDMAN: Yep.
NICK BUTCHER: Hey, Giuseppe, any questions?
Or are you just hanging out?
Oh, we can't hear you, I think you're muted.
MALE SPEAKER: [INAUDIBLE].
SPARKY RHODE: Yeah.
If you're in a position where you can't or don't want to
talk, then feel free to type your questions
into the Chat window.
RICH HYNDMAN: Oh, we do have some questions.
CHRIS BANES: That's not questions.
SPARKY RHODE: Oh.
RICH HYNDMAN: [INAUDIBLE] asks, is the home country--
CHRIS BANES: Sorry I took my [INAUDIBLE].
SPARKY RHODE: Question incoming from--
how do we say this name?
Marijn?
Is that your name?
RICH HYNDMAN: Marjin, maybe?
I don't know.
CHRIS BANES: Marian?
SPARKY RHODE: I-J-N. That's Dutch.
Looks like Mahr-ein.
RICH HYNDMAN: Please, I am trying to--
YOSSI ELKRIEF: Mahr-een?
RICH HYNDMAN: --clarify my problem.
It'll work.
We can guess his name later.
YOSSI ELKRIEF: Mahrleen.
MALE SPEAKER: OK.
SPARKY RHODE: [LAUGHS].
MATT GAUNT: So, no questions from Google+.
[INDISTINCT MALE VOICE]
MATT GAUNT: No?
SPARKY RHODE: It is a slow Wednesday afternoon.
[LAUGHTER]
YOSSI ELKRIEF: OK, I'll ask a question, if you want.
MALE SPEAKER: Go on, Yossi.
YOSSI ELKRIEF: Basically, when you do a search on the Play
Store for a specific developer, you can see all the
apps [ECHO]
the developer [ECHO]
on Play Store.
Is it a good convention to show a WebView on my app
showing all the apps I have on the Play Store?
Maybe like a cover flow or something like that?
NICK BUTCHER: Yeah.
No, I don't see any reason why not.
Quite often people will just link out to their Publisher
page on Play Store.
But if you wanted to have more control over the presentation,
then that's not a bad thing to do.
I'd just say, do it courteously to your users.
Like maybe put it under--
if you have an About screen, perhaps you can have a "Get
More Apps From Us" or something like that?
RICH HYNDMAN: Mm-hmm.
I personally just, yeah, from the Settings menu, from the
Overflow menu I have in my Apps button, take you straight
into the Play Store.
But if you want to put the effort into designing a--
I guess it's one extra level.
SPARKY RHODE: There's one publisher I'm thinking of who
seems to like to put up a splash screen where they show
you several ads of other titles of their apps, and
then, off to the side, a button that says, "Click here
to play the game that you've just launched."
MATT GAUNT: That sounds handy.
SPARKY RHODE: That kind of--
I don't know.
It bugs me a little bit.
Like, I at least want the title that I selected to be
very prominently displayed.
And it would be nice if I didn't have to have one extra
click to confirm the title that I just selected amongst.
NICK BUTCHER: Yeah, that sounds overly
aggressive to me.
YOSSI ELKRIEF: Yeah.
Basically what I wanted was to show a selector on the
Settings or something, and show a My Apps option, and
then show all the related apps to that developer.
SPARKY RHODE: Yeah.
I mean, if you want it as like an About Us, and had a nice
marquee with all of your apps on About Us, I think that
would be a great way to go.
YOSSI ELKRIEF: OK.
NICK BUTCHER: I think someone like LevelUp
do this, don't they?
And Beautiful Widgets.
I think they do a quite decent job of that.
YOSSI ELKRIEF: Oh, [INAUDIBLE].
RICH HYNDMAN: So, Marjin's come back again, and he's
drawn us a picture of the layout that he
was trying to build.
NICK BUTCHER: Oh, this is the tabs in--
RICH HYNDMAN: This was the tabs layout
in multi-pane, yeah.
NICK BUTCHER: OK.
RICH HYNDMAN: That you just saw.
I'll just show the picture to people inside.
So we've got a ListView on the left-hand side.
On the right-hand side, there's a Fragment with a
ListView inside it, and some tabs across the top, which is,
I think, what we were expecting to see.
NICK BUTCHER: Mm-hmm.
RICH HYNDMAN: And he has commented to say--
would you mind, Chris?
I'm getting a bit old for this.
[LAUGHTER]
CHRIS BANES: "Made a quick drawing of my question.
I had the question about multi-pane view
and tabs that link.
I'm using Fragments.
I need tabs in with detail Fragments, just like the Play
Store, but it doesn't show."
NICK BUTCHER: Oh.
So his question is, Fragments within Fragments.
MATT GAUNT: Yeah.
RICH HYNDMAN: All right.
CHRIS BANES: Yeah.
RICH HYNDMAN: Um--
CHRIS BANES: "Or I cannot edit the title of the tabs or read
the IDs."
RICH HYNDMAN: OK.
MATT GAUNT: Could you use ViewPager with just views?
Don't you do something on that in your blog posts?
RICH HYNDMAN: Yes, certainly you can have ViewPagers with
ListViews inside them without having Fragments.
And then the second Fragment would have tabs at the top,
which page between a--
NICK BUTCHER: Not just ListView, but he adds views.
RICH HYNDMAN: I was gonna say with ViewPager.
NICK BUTCHER: Yeah, so he thinks you can use views
rather than Fragments.
RICH HYNDMAN: Mm-hmm.
MATT GAUNT: So would that work?
RICH HYNDMAN: Yeah, it would work if it was simple enough.
CHRIS BANES: And why do the tabs need
to be in the Fragment?
I would question that.
Why can't it be--
NICK BUTCHER: Yeah, that's what I'm saying, yeah.
CHRIS BANES: Why can't it just be in the activity map?
MATT GAUNT: Because then it would
cover the entire surface.
So you'd have the Fragment that--
YOSSI ELKRIEF: Yeah.
You want to see them only on the right pane and not all
over the screen.
NICK BUTCHER: Yeah, but you can do that
with includes anyway.
Like--
I don't think it's--
any reason it has to be a Fragment.
CHRIS BANES: Yeah.
You could fight the tabs by copying the last--
RICH HYNDMAN: So what you're saying--
CHRIS BANES: ActionBarSherlock call.
RICH HYNDMAN: So instead of having--
NICK BUTCHER: So the left thing would be a Fragment.
RICH HYNDMAN: Left the ListView would be a Fragment--
sorry, the--
NICK BUTCHER: Left pane would be a Fragment.
RICH HYNDMAN: Yep.
NICK BUTCHER: And it's just a view holding the--
CHRIS BANES: The linear layout.
Top would be your tabs--
NICK BUTCHER: Yeah.
CHRIS BANES: And under that, with a layout weight of one,
would be your Fragment.
RICH HYNDMAN: Fragment on this side--
NICK BUTCHER: And a View Pager which holds [INAUDIBLE].
RICH HYNDMAN: Linear layout on this side.
CHRIS BANES: Yeah.
Then tabs in the linear layout--
[INTERPOSING VOICES]
RICH HYNDMAN: So--
CHRIS BANES: ViewPager all.
RICH HYNDMAN: ViewPager that.
MARIJN: So my mike is working again, thankfully.
RICH HYNDMAN: Yay!
MARIJN: So what I meant was, is that on the left side eye
of this menu which displays a couple of data types.
RICH HYNDMAN: Mm-hmm.
MARIJN: And on the right side you
have a couple of ListViews.
In this particular case, I have three ListViews.
And because I need to target both--
oh.
There you are.
[LAUGHS].
Because I need to target both mobile phones and tablets--
NICK BUTCHER: Sure.
MARIJN: It wasn't natural enough to put those ListViews
just on top of each other.
So I was looking for a tabbed solution with a tab top--
Tab bar in the top.
NICK BUTCHER: Yeah.
MARIJN: But somehow the TabHost isn't
showing in my app, so--
NICK BUTCHER: Yeah.
Don't use TabHost.
MARIJN: "Don't use TabHost." And what's the alternative?
NICK BUTCHER: So that's been deprecated now to use the
Action bar star tabs.
So, yeah.
Using Action bar or ActionBarSherlock.
MARIJN: But isn't the Action bar just used for--
NICK BUTCHER: So, yeah, it has--
MARIJN: The apps?
NICK BUTCHER: --its own cache system, but it won't-- it'll
do tabs in the Action bar on tablets rather than in line.
So basically you can use a thing called the
PagerStripTitle, which is in the compatibility library.
See, because that would get it within your key pager.
MARIJN: Could you tag that in PageViewTitle?
Or--
NICK BUTCHER: Yeah.
If you use Eclipse templates, if you just generate a new
project, and generate one with swipeable tabs, it'll generate
all the code you need.
And that's the best way to kind of, like, look
at how to do it.
MARIJN: OK.
So the layout's covered for the swipeable tabs?
I could just copy and paste, in this case, to the friends?
NICK BUTCHER: Yeah, it will show you how to do it, yeah.
You just [INAUDIBLE] your own adapter.
MARIJN: Thanks very much.
NICK BUTCHER: Welcome.
OK.
RICH HYNDMAN: [SIGHS].
KRISTAN UCCELLO: All right.
I got a question for you guys.
NICK BUTCHER: Hey.
KRISTAN UCELLO: Hey.
MATT GAUNT: Hey.
KRISTAN UCELLO: How's it going?
RICH HYNDMAN: Yeah, right.
I was gonna say.
[LAUGHTER]
KRISTAN UCELLO: Yeah, you guys should recognize me, maybe.
At least Matt does.
SPARKY RHODE: Oh.
I'm loving the hat.
KRISTAN UCELLO: Ah.
Well, we got DevRel booth stuff going on
in Charlie's today.
So--
but I do have an Android question.
I'm building an app, and I'm trying to use a service to
collect JSON data from a web service, mung that data, stick
it into a database, and then make that data available via a
content provider to my main activities.
What I've noticed is, I'm able to fetch the data without
issue, I'm able to parse it, standard JSON,
dump it in the database.
The moment I try and access the data from the content
provider later-- and I'm using the content provider from the
service as well to inject the data.
When I try and use the content provider from the activity, I
get nothing back from my cursors.
They're always empty.
SPARKY RHODE: Hmm.
That doesn't sound right.
NICK BUTCHER: Sounds like--
[LAUGHTER]
NICK BUTCHER: Sounds like a problem with your projection.
KRISTAN UCELLO: I thought that at first.
But these are very, very simple.
Like, I'm basically doing it on one key.
It's like, I have a YouTube ID, and it's just like, give
me the first result that matches this ID.
And I'll move the--
RICH HYNDMAN: Have you tried--
SPARKY RHODE: Maybe you're-- like, if you're not calling
swapCursor in your onLoadComplete, or something
simple like that.
KRISTAN UCELLO: SwapCursor.
I don't know about that one.
Explain a little bit more?
SPARKY RHODE: Um--
NICK BUTCHER: Are you using loaders?
KRISTAN UCELLO: Sorry?
NICK BUTCHER: Are you using loaders?
KRISTAN UCELLO: I don't think so [LAUGHS].
CHRIS BANES: No, that--
NICK BUTCHER: So you're just doing a ContentResolver.query?
KRISTAN UCELLO: Yeah.
CHRIS BANES: Have you checked that the data is actually
hitting the database?
NICK BUTCHER: Yeah, that would be my next question.
RICH HYNDMAN: Yeah, can the service--
KRISTAN UCELLO: Yeah.
The data is in the database.
What I did was, I pulled the MySQL data right from the
device onto my system and checked it out.
And it's all there.
[INTERPOSING VOICES]
RICH HYNDMAN: Can the service read it back out of the
content provider again after it's written it in?
KRISTAN UCELLO: No.
That's--
RICH HYNDMAN: OK.
So it's--
KRISTAN UCELLO: That's the weird part.
Once it goes in, it doesn't want to come out.
But when I try and do inserts of the same data again, I get
database exceptions stating that the--
RICH HYNDMAN: Yeah, definitely servers.
[INTERPOSING VOICES]
RICH HYNDMAN: Probably dodgy on the reading of
the data back out.
If the data's in there, and the content provider's just
saying there isn't any.
Maybe just mail through the [LAUGHS]
comment?
KRISTAN UCELLO: All right.
I'll send it to Matt today.
And you guys maybe can take a look.
Because I've been stuck on it for a day or two, and I've got
to get past this.
[LAUGHTER]
RICH HYNDMAN: Right.
NICK BUTCHER: Sounds like your projection to me.
Have you got--
KRISTAN UCELLO: OK.
NICK BUTCHER: --an ID column, like an underscore ID column?
KRISTAN UCELLO: What did I do?
I don't think I did.
Maybe that is the problem.
Although I thought--
[INTERPOSING VOICES]
KRISTAN UCELLO: I thought there was an implied one.
SPARKY RHODE: Hold on, base-- is it implements BaseColumns?
Or is it extends BaseColumns?
Do you remember, Nick?
CHRIS BANES: Implements.
SPARKY RHODE: Implements BaseColumns.
CHRIS BANES: I think the variable is on there.
MATT GAUNT: Yeah.
NICK BUTCHER: I don't remember.
I always use copy IE shared and extend it.
[LAUGHTER]
KRISTAN UCELLO: The only problem with that is the YT
Player has stopped working.
MATT GAUNT: Oh, yeah.
That's because the certificates probably expired
for the API.
KRISTAN UCELLO: Yeah.
Yeah.
SPARKY RHODE: Oh, right.
Every year we have to regenerate our developer
certificates, don't we?
KRISTAN UCELLO: This is the YouTube player API.
It's set to expire every two weeks after release, because
it's not launched yet, so--
RICH HYNDMAN: Oh god, yeah.
MATT GAUNT: Yeah.
At the moment, the API is changing slightly, because
we're doing [INAUDIBLE]
getting feedback.
So the YouTube team are spending a lot of time kind of
tweaking it, but they're also--
it's kind of a fail-safe way, and a really awful way of
being sure no one publishes it to the Play Store.
Because then it--
KRISTAN UCELLO: [LAUGHS].
MATT GAUNT: --it's live, and then they change
it, it starts breaking.
So--
KRISTAN UCELLO: Yeah.
MATT GAUNT: Yeah.
I think it's just their way of just making sure that
everything is kind of gonna tick
along without any problems.
RICH HYNDMAN: It's been a while now [LAUGHS].
MATT GAUNT: It's coming.
Like, I think they are literally trying to get to
that last final step.
It's coming.
RICH HYNDMAN: Excellent.
NICK BUTCHER: Like Google Play Store.
KRISTAN UCELLO: Thanks, guys.
All right.
RICH HYNDMAN: Google Play Store.
It's coming.
KRISTAN UCELLO: I've got to go catch my bus, so--
RICH HYNDMAN: All right, Crispy.
Cheers.
KRISTAN UCELLO: I will see you guys later.
Ciao.
RICH HYNDMAN: Get out of here.
NICK BUTCHER: No worries.
RICH HYNDMAN: Great.
[SIGHS].
MAXIM: Hey, guys?
MATT GAUNT: Hi.
RICH HYNDMAN: Hey.
MAXIM: It's just me again.
RICH HYNDMAN: Yeah.
MAXIM: So have you checked the APQ, the APG 2.1?
Well, it returns the list of permission that I would expect
it to return.
It returns all the permissions defined in the manifest, and
the Market still shows different lists.
And I'm sure it's a safe file.
NICK BUTCHER: Cool.
Can you host the APK somewhere, like put it on
Drive and send us a link to it?
And we can take a look.
MAXIM: Yeah, definitely.
Definitely.
So what should I use to--
oh.
There's a Chat I use.
Should use a Chat to send it to you.
NICK BUTCHER: Can you put it in a comment to the Hangout
announcement on G+, not in the Chat comments, because they
all go away.
RICH HYNDMAN: If you don't mind distributing
your APK to the world.
[LAUGHS].
NICK BUTCHER: Yeah.
Or you could just share it with us personally.
Post it on G+.
RICH HYNDMAN: What was the name of the application?
MAXIM: I would prefer so, because it's, well--
NICK BUTCHER: Sure.
MAXIM: It's private.
So where could I send?
RICH HYNDMAN: What's the name of the application?
MAXIM: Uber.
[LAUGHS].
RICH HYNDMAN: Can you spell that?
MAXIM: U-B-E-R.
RICH HYNDMAN: Uber?
NICK BUTCHER: Oh, like the taxi.
MAXIM: Yeah.
NICK BUTCHER: Oh, cool.
RICH HYNDMAN: Nice.
MAXIM: Actually, it's on the Market now.
RICH HYNDMAN: Yes.
It was in the Market before now.
So you've uploaded--
NICK BUTCHER: But you've updated it?
Despite the--
RICH HYNDMAN: Yeah.
NICK BUTCHER: --permission thing.
MAXIM: Yeah, I did.
NICK BUTCHER: OK.
Well, we can grab it from there.
That's cool.
Was that clear?
MAXIM: Yeah, thanks.
NICK BUTCHER: All right.
MAXIM: So should I come back, like, to the next "Office
Hours," or to the next 15 minutes, or--
[INAUDIBLE]?
NICK BUTCHER: Always come back to the
"Office Hours." [LAUGHTER]
RICH HYNDMAN: Yes!
Our next "Office Hours" will be from Devoxx.
So it's going to be a slightly different format.
There'll be a lot of Googlers speaking at Devoxx [LAUGHS]
next week, the very nice developer conference.
So it may be taking a slightly different format next week.
But it should be at about the same time.
MAXIM: I see.
RICH HYNDMAN: We'll try and get back to you on the Uber
thing slightly separately.
Outside of the "Office Hours."
MAXIM: All right.
RICH HYNDMAN: Questions?
MAXIM: Just in case, I'll type my email in the Chat.
Thanks.
RICH HYNDMAN: OK.
The problem with the Chat is we lose it as soon as the
"Office Hours" goes off air.
MAXIM: So, in the Moderator, then.
RICH HYNDMAN: Yeah, yeah.
Somewhere like that.
In the thread or the Moderator is fine.
OK.
NICK BUTCHER: First chat in the sidebar.
CHRIS BANES: "Are you attending Droidcon
Netherlands?
ALL UK DEVELOPERS: Yes.
RICH HYNDMAN: Marijn, we will be at Droidcon Netherlands on
the 23rd and 24th, maybe?
Maybe 24th and 25th.
NICK BUTCHER: See you there.
RICH HYNDMAN: See you there.
Excellent.
Do we have any more questions coming through the Moderator?
Sparky?
SPARKY RHODE: Mm.
Let's take a quick look.
RICH HYNDMAN: Thanks, dude.
SPARKY RHODE: I'm only counting eight, and there were
eight last time we answered one.
RICH HYNDMAN: Yeah.
I agree.
NICK BUTCHER: Through the thread.
SPARKY RHODE: Let's see.
Yeah.
Still only eight.
I think we've hit them all.
YOSSI ELKRIEF: OK.
RICH HYNDMAN: OK.
YOSSI ELKRIEF: Is it possible to use the YouTube API?
You already talked about the--
SPARKY RHODE: [LAUGHS].
NICK BUTCHER: So it's coming soon.
Yeah.
They were taking beta testing, but I'm not convinced that's
going on anymore, because, like I said, they are kind of
getting to their final stages.
So at the moment I'm not aware of any more developers getting
on board at the moment.
YOSSI ELKRIEF: OK.
NICK BUTCHER: Yet.
RICH HYNDMAN: All right.
Well, if there's no other questions today, you want me
to wrap it up a little bit early?
YOSSI ELKRIEF: No.
GIUSEPPE: Sorry, but there must be one of my questions.
[LAUGHTER]
GIUSEPPE: Yay.
[ECHO]
RICH HYNDMAN: Go on, go ahead.
GIUSEPPE: Can I go?
Please.
Yes.
I would like to know if there is any guideline for what is
permitted and what not?
Let's suppose, for example, that we would like to import
the view from another application, OK?
That has been done with another application, into the
own application and extract the algo from vis-a-vis view.
What is permitted from the policy?
And if there is any policy about what or not is
permitted, where can I find it?
RICH HYNDMAN: So that would very much depend on the
guidelines for that application.
[ECHO].
So it's a bit of a strange use case.
But if they're going to allow the Share intent--
send intent to share their video to other applications--
then they're expecting to send the video to social networks--
G+, Facebook, et cetera.
And then it shares to your application, and your
application then pulls the soundtrack off it.
The use of that soundtrack will be under the guidelines
of the application that shared it in the
first place, I guess.
Certainly--
MATT GAUNT: There is stuff in the content
policy, isn't there?
About not interfering with another app's data?
RICH HYNDMAN: There is.
It's true.
NICK BUTCHER: Don't see anyone I know of.
RICH HYNDMAN: App functionality of data.
NICK BUTCHER: You've got to be--
RICH HYNDMAN: It does sound--
NICK BUTCHER: Yeah, I think which is the right here is to
make it easy for people to send their content to your
app, rather than going out and scanning for other content.
Sounds like the right way to--
GIUSEPPE: Yeah, but the problem is that the data will
not be like it was sent.
It would be managed, it would be changed.
It would be extract something from inside.
So this is the question.
The video application share with me the video.
That is it.
But I'm extracting something from inside.
I'm doing something wrong?
Or can I do this?
Or I can do this?
SPARKY RHODE: This begins to sound like more
like a legal question.
GIUSEPPE: Yes.
RICH HYNDMAN: Yeah, I agree.
[ECHO].
I actually know in some respects what it's related to.
GIUSEPPE: The problem is that the content that was shared
with my app, it's not owned by the other app, but it's owned
by the user.
So if there is some legal action will be
against me and the user.
But if the user want a legal action against me, why he
share the subject with me?
I don't know if it's clear, the question.
But probably we need a lawyer.
SPARKY RHODE: Hm.
RICH HYNDMAN: Yeah, it may be something that YouTube's
referring to.
[ECHO]
GIUSEPPE: YouTube content is a little bit different, because
we know that YouTube don't want that we
manage the files, probably.
This isn't their policy.
But I'm talking about a standalone file that is on the
device, and not imported from outside or
downloaded from YouTube.
RICH HYNDMAN: Yeah, so there's certain [INAUDIBLE]
good application playing files from device.
Limited files.
These files, these apps will be on video players and such
from Google Play Store.
It's just it's--
well, [LAUGHS]
what the users actually extract from it afterwards can
be questionable.
[ECHO]
RICH HYNDMAN: As long as you're not [INAUDIBLE].
Don't you think this might be OK?
Sounds like a legal question.
[ECHO AND BACKGROUND NOISE]
MATT GAUNT: None of us are lawyers.
Thought we were.
[LAUGHS].
NICK BUTCHER: High *** lawyers.
CHRIS BANES: [LAUGHS].
RICH HYNDMAN: Yeah, you might be able to
get around it with--
CHRIS BANES: [INAUDIBLE].
[LAUGHS].
RICH HYNDMAN: Dialogs, things like that.
Just warning the user not to use it for
any appdevs as well.
Make sure you only load up your own content or you're
only-- you're not breaking any copyright terms and conditions
by using this product to XYZ.
[ECHO]
GIUSEPPE: Something like, "Are you sure you want to--
want that we extracted the algo from your video?"
Something like that?
RICH HYNDMAN: No, it just-- why don't you just walk down
the guidelines and only extract audios from videos
that you own the rights to.
NICK BUTCHER: So what?
Just showing you--
[ECHO]
CHRIS BANES: Yeah.
RICH HYNDMAN: Yeah, maybe.
[ECHO]
RICH HYNDMAN: All right.
GIUSEPPE: OK, thank you.
RICH HYNDMAN: Cheers, Giuseppe.
So I think we had some other people bouncing in and out
during that.
Does anyone else have a question?
What did Sparky just do?
CHRIS BANES: That's all.
RICH HYNDMAN: OK.
Yeah, yeah, yeah.
If there's no other questions, then we will wrap it up.
NICK BUTCHER: [LAUGHS].
What's going on, Yossi?
SPARKY RHODE: Thanks for coming, everyone.
RICH HYNDMAN: Yossi's being crazy.
Android says "Bye!" [LAUGHS].
Thanks for coming, everyone.
And as I say, next week we'll be at Droidcon.
We hope very much to run--
NICK BUTCHER: Pickles.
RICH HYNDMAN: Excuse me?
NICK BUTCHER: Yeah.
[LAUGHTER].
RICH HYNDMAN: Because we've enjoyed your screen.
Next week we'll be at Devoxx.
Very much want to--
NICK BUTCHER: Watch out for a special edition of various
"Office Hours."
RICH HYNDMAN: They are at the normal time, normal place.
But you do double check on developers.googl
e.com/live/android just in case we have to shift the time
to match some of the Devoxx scheduling.
Thank you all very much, and see you next week.
[ECHO]
GIUSEPPE: Someone can share the link of Droidcon?
[LAUGHTER]
NICK BUTCHER: Droidcon.com or something like that.
RICH HYNDMAN: [INAUDIBLE] at Droidon.com.
GIUSEPPE: [LAUGHS].
I will Google, I will Google.
[LAUGHS].
RICH HYNDMAN: Cheers, Giuseppe.
See you all.
Thanks very much.
MALE SPEAKER: Thanks, guys.
MAXIM: Bye.