Android Developer Office Hours (EMEA)


Uploaded by androiddevelopers on 25.07.2012

Transcript:
>>Richard: Welcome to this week's Android Developer Office Hours. I'm in London with
Nick Butcher--
>>Nick: Hello.
>>Richard: and Matthew Gaunt, here--
>>Matthew: Hi.
>>Richard: to answer your Android Developer technical questions around Android and talk
about the Android operating system in general. Things that we won't be talking about include
product roadmaps, huge releases, and stuff that we're not supposed to talk about. We've
really got quite a full Hangout today. It has one, two, three, four, five, six, seven,
eight, nine, ten. I think we're absolutely full in fact.
>>Todd: Ten is the maximum, right?
>>Richard: Yeah, we're in. We have all ten people in, so sorry if you didn't get in straight
away. Maybe these people asked their questions and we answered them, but they can drop out
and some other people can be able to get to ask them later.
Still hoping we can get Sparky in from our Munich office. 'Cause he's generally--. Ron
is with us as well today. Hey, Ron. Nice to see you. Well, not see you, as the case may
be. 'Cause Sparky has the answers to the questions, generally, so it's quite good if he comes
in. Let me just repost this onto the Android Developers plus page.
It's still a little bit--. All right. Let me add the moderator to the Android Developers
plus page, so that people know where they found their links. Today's moderator. [thumping
noises] If anyone has any questions during the Hangout, whilst we're just sorting this
out at the very beginning, please feel free to start asking.
>>Todd: Well, I've got one. You know if Jellybean [unintelligible] languages to the Android
operating system to the Galaxy Nexus [loud knocking] anyhow and how those languages now
belong to the base languages that come to every device. So, is it dependent on the feeling
of the OEM?
>>Nick: Yeah. Same answer is that we've always given you, Todd, when you've asked that question,
four or five times before. [chuckles]
>>Todd: No, I don't know if the--. I know. With Jellybean maybe it's changed. I don't
know.
>>Nick: It's the same as always. Like, we put out a set image, but it's up to the carriers
and OEMs to choose what they think their image, so what languages finally make it through
is up to whoever owns the build.
>>Todd: Well, you did a really good job with [unintelligible] anyhow. I've been running
with it with quite a while. It's nice job.
>>Richard: Excellent.
>>Todd: Only, yeah. It's pretty nice.
>>Richard: Fantastic. OK. Well, Manashu's been dying to get this question in before
the broadcast started. So let's have a quick look at Manashu's question. I have a problem.
I unzipped a zipped file on the SD card and after unzipping, dot csv, and import csv in
SQLite. I had that a lot. For your information, I want to tell you I don't know how this feels.
Will you help me please? Is that a question?
>>Al: I think he's asking how to import csv into SQLite.
>>Richard: After it being a csv, import csv in SQLite. We used to have a canned answer
for how to pre-prepare SSWLite databases. There's a really good answer on Stack Oveflow
that I will pull out and add into the links.
There a couple ways of doing it. You can either pre-prepare the database as a SQLite 3 database
file using AV Shell and things like this. Or, you can import as a bulk import afterwards,
into a new SQLite database or a device. The last one's gonna take a little bit of time
and you'll have some duplicated data. Let me just pull off the Stack Overflow link and
add it into the comments.
[keyboard clicks]
>>Nick: Essentially, what we end up doing is ending up reading the file, right? And
creating content values and inserting them into your database yourself.
[pause]
>>Richard: Yes, you do. I'm not certain I feel good about, but I'm sure I'll find this
pretty quickfully. We're looking up there not because our screen, tis a thousand inches.
. And actually, I can just stretch the full there because all the questions appear on-screen
is up in the sky somewhere. And that's where my light is attached to the wall. That's where
our web browser lives as well as you'd expect.
>>Nick: Our system issues, other question where Sparky, Sparky is trying to join at
the moment. He's just having a few technical issues and hopefully, he'll jump in to the
Hangout soon. There's still hope. There's also another question, which I also want the
answer to. What will happen to Todd's hair?
>>Richard: What happened to To--? Ah, yes.
>>Todd: Well, the answer to that is the army. That's what happened.
>>Nick: The army. That's what I thought.
>>Richard: I thought so much, yeah.
[pause]
>>Matthew: Hey, hang on a sec. There's a question about a monkeyrunner.
>>Richard: Oh, he has a question about--. Whoa. Ari says he's trying to create an automated
two-way process for his Android device as a monkeyrunner. Having searching a lot over
the web, it seems to me that [unintelligible].
Sorry people watching on the live stream. This is quite a long question. I've been able
to run successfully the monkeyrunner through the command and loading a Python. Now he's
pacing more and more as we go. I find it a big hassle to connect to the device every
time I want to run a command. Is there any way I can do this without connecting to the
device every time? [feedback on audio]
We do have quite a bit of testing done inside the new developer Android dot com site. It
has updated the scripts you need for monkeyrunner. So, if you haven't checked it in the last
three or four weeks, it might be useful for you. I don't have a specific answer to how
to keep the device connected so that you don't have to keep reconnecting to run the monkeyrunner.
It sounds strange that it's disconnecting.
[pause]
Copy links.
>>Nick: Anyone else have any experience with monkeyrunner. Can't offer anything here.
>>Richard: That might be handy.
>>Al: I've only ever seen disconnects when it's running out of memory on the actual device
itself, when the firmware starts to fail. I've not seen it with a generally well-written
application behaving as it should without any issues.
So, it might be worth looking over the application just in case there are some memory leaks or
things like that, which could be eating up the RAM on the device.
>>Richard: Good answer. [unintelligible]. All right. So. That was--. Deleted. So, we're
still waiting for Sparky to join. Do we have an update?
>>Charles: Not at the moment.
>>Richard: Go on, Charles. [unintelligible]
>>Charles: Yeah, sure. It's to do with the navigation, navigating within the stack. So,
the problem we have is we're creating a widget. The user touches a part of the widget, which
takes the user into the app, a deep link within the app.
So our question is with regard to what happens when you hit the back button, at that point
once you've navigated into the app. So, it's probably helpful to give an example. So, the
YouTube app, when you have the YouTube widget. You hit a video. It takes you to the video,
obviously, within the YouTube app.
Interestingly, when you hit back, it takes you back to the launch activity. But if you
have the Gmail widget, for example, you hit an email. It takes you into the email within
Gmail. But if you hit the back key, it takes you to the inbox list. So, the question, I
guess, is what is the recommended behavior?
>>Nick: What Gmail's doing.
>>Charles: What Gmail's doing?
>>Nick: The general post, the way I remember it at least is 'cause you can resume all the
activity and so on, is you don't wanna think about exactly where you can focus, where a
user can resume that, the Gmail active tier at any time.
And so, if they hit the back button, it will take them back to the home screen. That would
be like an unexpected behavior. So the key is that if there's a usual place that you
get to that screen from, that widget should take you there.
>>Charles: So the TaskStackBuilder, whatever it's called, doesn't work pre-three point
null. It just, as far as I'm aware, it doesn't actually support three point null.
>>Nick: Yeah, there's a version in support library. That's one point six.
>>Charles: OK. So that will work. It will have the same behavior as back to one point
six?
>>Nick: Yeah.
>>Charles: OK. I'll take a look at that. Thanks.
>>Nick: Yeah, there's two things. You can take a look at that. The other thing that
helps you in the navigation is in four point one, in Jellybean. There's a new attribute
on activity where you can find a parents.
And so, the support library will help you out there as well. You obviously can't backwards
compatibility change activity. But you can add a metadata tag, which defines the parent.
So, add a whatever the metadata tag is to the activity. Same with parent. Whatever it
is. If you take a look at the Google I/O app, from this year, that's a great example of
how to do this.
>>Charles: OK. Thanks.
>>Nick: You're welcome.
>>Matthew: [unintelligible] multiple parents. You'll have a tier parent and have another
parent fit.
>>Nick: As long as you specify each parent.
>>Matthew: Yeah.
>>Nick: Doesn't change. It just helps the app do the right thing.
>>Richard: Any more live questions from people in the Hangout? OK. I'll just take the first
one off the top of the moderator. Is there implementation of the content provider that
returns a cursor in plain, old Java objects? Actually, a cursor implementation that contains
objects? There's not one that I know about.
[pause]
>>Todd: Did they just die or something? Did London fall off?
>>Al: Yeah, London have just fallen off. They're back again.
>>Richard: Someone kicked the cable or something.
>>Charles: We lost you just after you said there wasn't a content provider implementation
you knew about.
>>Richard: You might want to check the Open Source in the third party round. Does anyone
on the Hangout know of one? I guess, I hope, they'll request the question, search the internet
boards first. But at the same time, it's not particularly hard to go from SQLite to POJO
in the substantiation afterwards. Take the data in. Build it back up again.
>>Charles: There are a few object relational mapping tools as well that can take a lot
of that heavy work and do it for you. If he has a look around, they'll be some around
that--.
[static]
>>Richard: We brought Sparky with us this time. Hey Sparky. Good to see you.
>>Sparky: Hey. It's good to be here.
>>Richard: You sat at your desk in the Munich office right now.
>>Sparky: That is my desk in the Munich office.
>>Richard: You and your big [indistinct]
>>Sparky: As you know, as you know, the new version of Mac O/S Mountain Lion shipped today.
And myMacbook, being two full versions of the O/S behind, is beset with such feelings
of inadequacy and anxiety that it refuses to connect on any wireless network in the
office. So, I had to go to a place where I have a wired network.
>>Richard: How come you're not using Chromebook, Sparky?
>>Sparky: I keep that one at home.
>>Richard: Interesting. You have the choice.
>>Todd: I think London died again.
>>Al: Yeah, we think Sparky being here is making the London drop out every few minutes
or so.
>>Sparky: Well, I think our network went the same place that Todd's hair went.
>>Todd: Yeah.
>>Charles: It's for the army. [laughter]
>>Richard: Very well. So we've just tackled the first question off the top of the moderator.
>>Nick: I know it's one of those things that [unintelligible] as well is to have a bind
method on your project, which accepts cursor so you can use that.
>>Sparky: Cursor? What's this about cursor? You must be looking at moderator questions
I haven't seen yet.
>>Richard: No, it's just a new one that's added in.
>>Nick: That's OK.
>>Richard: We're on it.
>>Sparky: All right.
>>Richard: Rich Johnson, welcome and [unintelligible]. Don't know why we're still on the air twice.
So as it is, you wanna take the next moderator question, Sparky?
>>Sparky: Sure. [pause] You just did, did you do this?
>>Richard: We did the cursor or POJO objects.
>>Al: Is there any implementation of a content provider that returns cursor or POJO objects?
That was just done.
>>Sparky: I'm way behind you guys. Oh, there we go. Now I see it. Ah, that's a good one.
You got a ton of new questions since last time I connected.
>>Richard: Crazy.
>>Nick: [unintelligible].
>>Sparky: That one's not even at the top of my list. Have you looked at the C2DM question?
>>Al: Not yet.
>>Richard: I just did.
>>Sparky: All right. Matt from Warwick wants to know, with C2DM being deprecated, are there
any changes anticipated for how cloud messaging, GCM, is implemented in the future now that
Google cloud messaging is the primary method?
Or can we rely on GCM for the foreseeable future? Well, my crystal ball is a little
bit overcast today. But I would guess that, at the very least, GCM will be no less stable
than cloud to device messaging was, which is that they ran it for a couple of years
and then gave it a nice graceful exit strategy with giving people lots of time to change
over to the new method.
And at the very least, I think you can expect at least that level of support for Google
cloud messaging as well.
>>Charles: It seems at the moment that the Google cloud messaging is quite active because
every week or two, I'm seeing public announcements about new features being added and tweaks
being made. So, it seems pretty active from what I've seen.
>>Sparky: Well, cloud to device messaging, C2DM, basically went into feature freeze several
months ago. And all the new development has been taking place in GCM.
>>Nick: And it still has significant advantages over C2DM as well, right? Like the fan-out
and so on. [feedback and beeping noises]
>>Sparky: Yeah. And not least of which is that you don't have to request Cordis anymore.
Not only do you not have to request Cordis, but you don't have to sign up for an account,
either. You just, you publish your app and--. [pause]
[static]
Whole, this whole off-login client, or client login two-step to get your server side messaging.
[beeping] We just give you an API key that you can use. So there's this whole login process
your server has to do is no longer the case.
>>Richard: Just out of interest, Sparky, do you know why we allow space for three sender
IDs per application?
>>Sparky: No.
>>Nick: The reason I heard is if you have three different topics, streams, something
like that, you might be able to do it that way.
>>Matthew: Conserve and send the messages.
>>Nick: Yeah.
>>Richard: Fair enough. I did wonder.
>>Sparky: I'm not buying that. I think one is enough.
[laughter]
>>Richard: One for all your apps.
>>Nick: But yeah. As Sparky says, our method is being actually developed. So, if you are
working on it and have feedback, then make sure you send it through. I mean, you can
screen that by us or, what's that guy's name? Francesco Nerieri, is it? The en--.
>>Sparky: Yeah. Francesco.
>>Nick: Francesco, that's it.
>>Sparky: Yeah, he's cool. And he's quite active in the Android C2DM forum.
>>Charles: Wasn't he also on the state-side Office Hours last week?
>>Sparky: Yes, he was.
>>Charles: So it might be worth if someone's looking, looking into cloud messaging, having
a look at the state-side Office Hours from last week and seeing what he said in that.
>>Richard: Fair enough.
>>Al: I don't know why we keep dropping out. Someone's put a time bomb inside our machine
of some sort.
>>Charles: Everybody's trying to download Mountain Lion.
>>Richard: No.
>>Nick: [unintelligible].
>>Sparky: It's network bandwidth reservation of the Olympic Committee.
>>Al: They can get in our internet pipe as well now. They're laying on the cord.
>>Charles: You can't say any more words about the Olympic Committee and you'll be in trouble
with the branding police, Sparky.
>>Al: The tubes are stuffed.
>>Richard: Samuel, in the G+ post, [static] is asking is there G+, Facebook smiling drop-down
menu tool? One that I've seen so far is [unintelligible]. That he--.
>>Nick: No, he has [unintelligible]. He has, through his advanced course, talked me through
some of the techniques he used that are a bunch of Open Source implementations. I think
there's one called River Menu, which looks pretty nice.
>>Sparky: There's a couple of major threads on Stack Overflow. You can just search right
there.
>>Richard: Yeah. I'll see if I can find it.
[pause]
>>Nick: Yes. At the moment you're done already. I'm crossing it out. Or using someone else's.
[pause]
>>Matthew: I'm sure he'll make his way into there at some point or another.
>>Richard: I'll refresh this page.
>>Sparky: Not seeing it just yet. Should I take another question from moderator?
>>Richard: Yeah, sure.
>>Sparky: Will there be an API or STK to provide custom cards for Google Now? I don't know.
>>Richard: Ah, we read a the disclaimer for the start of here that we won't be talking
about product roadmaps, future releases, stuff that we can't allow. So, will there be a question
that causes that? Move on.
>>Sparky: Then that makes me really eager to take the next one from the moderator, which
is "Google Maps and speech recognition got offline on functionality lately. Is there
any way to leverage these within our own apps?" I don't know. Not that I've heard.
>>Richard: He's talking about functionality, right?
>>Sparky: Not that it--. I had thought so, at least in the case of the speech recognizer.
I wasn't able to turn up any solid information confirming that.
>>Richard: Yeah, Google Maps, there isn't anything you can do there and speech recognition
is transparent. If there isn't any network it will try to find one and then [unintelligible]
select.
>>Matthew: I think there might be some cases where offline that you use online functionality.
That the results of that are surprisingly clear.
>>Nick: Yeah, if you have spotty networks, if you have some connectivity, low bandwidth
or yeah, [unintelligible] time or something, then it will roll over to the offline.
>>Richard: Trying to give you the best experience possible as a user.
>>Nick: Yeah, the whole point of speech interaction is that it's fast. If you have to sit around
waiting for long times, it's pretty useless. So we try to avoid that.
>>Man in hangout: Can I add something? As we're talking about speed and latency and
audio, I'm experiencing some troubles with the media player. When I'm trying to play
a file, it only plays the first few milliseconds or so.
And it's not reproducible. So, it has something to do with the mark A. I use it at the same
time or something. I'm not very sure about this. So maybe you could say something about
that.
>>Richard: The media player has quite a complex life cycle. Have you read all the documentation
on it and made sure that you're following the correct life cycle for the stream? If
it's not fully prepared and you've got the callback setting string repaired and you get
run on it, you are gonna run into that kind of problem.
>>Man in hangout: Yes. So, I got some method to override where it fully loads the thingy
and then it starts over. Yeah, I'll just do that.
>>Richard: Even when it, you do get the error, it's already come back and said the video's
ready to go. And then it tries to play it and it still falls apart.
>>Man in hangout: Yeah.
>>Richard: OK. Do you have any stack tracing or any actual errors that come out of it?
Or, is it, there's nothing logged at all?
>>Man in hangout: No, I actually don't get anything in my log. To be honest, all my cable
just broke so I can't test it in my emulator because we can't shake the emulator and yeah.
So, I'll test this tomorrow.
>>Richard: You can't shake the emulator?.
>>Man in hangout: No. Can you?
>>Richard: Why can't you shake it?
>>Man in hangout: Uh.
>>Richard: Why do you want to?
>>Man in hangout: Well, I've got in my code, I've got a shake list now. So, I use it on
the poll. And I implement something just like, emulator shake with the little button or something.
>>Richard: Fair enough. No, I cannot shake the emulator, but you still need the cable
for it. Anyway, the latest version of the emulators allow you to pass in sensors from
the device into the emulator.
>>Man in hangout: OK. Good.
>>Richard: A cable, you haven't got a cable. You must have a cable. Is that just me? I've
got so many micro-USB cables.
>>Man in hangout: Just one.
>>Al: The guys open at ten and they have a sensor simulator, which I think might be able
to rip emulator shake on a device with an emulator. So I put the link up for that.
>>Sparky: I found that in Stack Overflow, too. I'll post that as well.
>>Todd: You know, I had one comment about Jellybean that it's really, you can see that
it's much faster than ICS. The only comment against it is when you have to follow apps
like, for example, the Desk Phone app and Skype, you're required to press three different
buttons just to make a phone call, which is really annoying because you, it used to be
two and now it's three. [feedback noises]
[unintelligible comments]
>>Richard: because we dropped out again.
>>Todd: Well my point was about Jellybean, [feedback voices] that you have to use three
different buttons if you got two phone apps just to make a phone call.
[pause]
For example, you've got the normal phone app in Skype.
>>Richard: Oh, you mean the always and just one style?
>>Todd: Yeah.
>>Richard: Application pick-up.
>>Todd: Yeah.
>>Richard: Yes. Yeah, yeah, yeah.
>>Todd: It's a bit annoying, if you see what I mean that I have to press three different
buttons just to make a, just to dial a number.
>>Richard: Yes. The always behavior is fine, but the just once behavior is somewhat annoying.
I agree. All right. If you use that a lot--.
[pause]
>>Todd: with the defense with browser, then like with Skype and normal phone calls, it's
called different use cases. The browser is usually for the same case, if you see what
I mean.
>>Richard: Normally. I do know what you mean.
>>Nick: Well, you just set the phone to always and then--.
>>Todd: Well, because sometimes I call abroad and to call abroad from Israel is quite expensive,
so I use Skype. And it's much cheaper in Skype than this way.
>>Richard: Yeah.
>>Todd: So--.
>>Richard: I wouldn't be surprised if that changed at some point, but I don't know.
>>Todd: Well, it used to be two buttons and now it's three, so you know?
>>Richard: There's certainly been quite a few conversations about that application selection
dial-up.
>>Todd: Well, the other thing that you know that they improved about it is switching between
keyboards, because it used to that you have to press a long press on the space button,
that it switch. And now you've got this Grow button that you can just press on it and it
switches the keyboard instead of having the pop-up that you--.
>>Richard: You win some and you lose some with the keystrokes.
>>Nick: Can't please everyone.
>>Todd: True, but you know it's getting there.
>>Richard: Yeah. Well, where are we, Sparky? I think you're going to Muteland, Sparky.
[pause]
Well, do you want to unmute, or can you not talk?
>>Sparky: OK. Yeah. There's a couple of questions on moderator that I actually know the answers
to, I think. One is, I'm building an app that includes a live audio stream. I want to use
RTSB. Is this supported on all Android O/S versions? I can't speak to all, but I've seen
forum posts talking about it way back in the days of Cupcake. So, I would tentatively say
yes.
>>Richard: I've got a little bit of input on this one. So, we were playing around getting
some RTSB streaming going. We tested it, I think, up to Honeycomb. But I believe Media
Player does work on it, but if you're expecting it to just be a completely live stream, there
is buffering on the Media Player that I don't think you can get around. So, as far as I'm
aware, it is supported, but there is that slight latency in terms of buffering, et cetera.
>>Richard: The official page says [unintelligible] >>Charles: Could it be it's a codec issue
as much as RTSB support?
>>Richard: Yeah, we--.
[pause]
>>Matthew: Well, they were in the right format. So, I mean, the obvious example to try and
make you've got it right, which is a bit of a nasty way of doing it, but yeah, is getting
a [unintelligible] to your device to make sure the actual stream is valid and the right
codec. And then, if it's the case that that trick does work, then yeah, you're gonna have
to dig deeper. [laughs]
[pause]
>>Richard: And I'll also post the official supportive media codecs and steams. There
was a page in the Developer documentation about it, which does suggest quite the same.
RTSB is supported. And it says that HT63 is probably the only format. MP4 or 3GP is supported
throughout all versions of Android as well.
>>Matthew: Is it possible on mobile devices for OEMs to add extra codecs?
>>Richard: Yeah. Samsung loads their device with codecs.
>>Matthew: 'Cause I know that what happens with Google TV, so yeah.
>>Richard: You just have to pay for licenses.
>>Nick: And you gotta make sure you're using an MP4 file. You gotta make sure it's set
up in the proper streaming format. So, you need to make sure that some of them, I think
the mood atom needs to be before any of the data atoms as well, which is a pretty standard
thing, so you can check that your stream is in the right format.
>>Richard: Nice.
[pause]
>>Sparky: Should we take another one off on the moderator?
>>Richard: Yep.
>>Sparky: How about this one? With preferences activity being deprecated and preference fragments
not being available staring with the 11th, is it recommended to check if the new API
is available or just wait for the support library to catch up?
I don't know exactly about the support library. Here's a partial answer from Gabriel Indburn,
from Germany, that says he doesn't think performance preference fragment can be added to the library
due to some internal dependencies. I can't really speak to that, but in my own experience,
there's only just a few lines of difference between a preference activity and a preference
fragment.
So, what I would probably do is try to factor that out into its own encapsulated bit of
code and just call it from either the activity or the fragment, depending on what you did
tech support for. That's my recommendation. I tested this a little bit, for example, and
I can either read the same XML fragment, the same XML parcel in either one in the same
application, which is fine.
Given that although we've deprecated it, preference activity still works. I kinda have a hard
time telling people, "No, don't use that. Just use nothing." I mean, it's the, without
it being in the support library, you can't access it on Gingerbread, which means you
can't access it on something like 60 to 90 percent of the devices out there.
And I'm reluctant to give that advice. So, I would say go ahead and do the dual implementation
method. It's not that much extra work.
>>Al: There's an interesting thread on the action bar Sherlock Issue Tracker that covers
this and covers the reasons why it's unlikely to make it into the support library as well.
So, I put a link up to that in case anyone wants more info.
[pause]
>>Richard: OK. Anything else from inside the Hangout before we jump to the next moderator
question? No one?
[pause]
No. OK.
>>Sparky: Next up on the moderator. This, oh, wait. Call the recognizer intent and have
it return a result no matter what and not show the error message or connections errors
and such. Probably not, but I don't know.
[pause]
>>Man in hangout: Did you just catch that?
>>Sparky: Yeah, I don't know about the recognizer intent. I would say if it does return error
codes, probably not a way to suppress those. I suppose you could have it try again. Put
it in Async Task or something. But I don't know of a way to, I mean, I haven't looked
into the API, but a priori I don't know of a way to force it to return a result.
>>Richard: Well, the API doc says he returns the intent or just know it's not available.
[pause]
So, I guess the problem is you call the recognizer intent. The UI's coming up, put a little microphone
in it and let the pulsing try to recognize, but if there's no connection, the use is gonna
get narrowed and have to dismiss.
And then it goes back to the app with just a null response. So, it's calling functionality
that's in another part of the system and then try to control that. And yeah, to my knowledge,
that's, there's no extras you can add on to the recognizer intent. There certainly aren't
any specified in the documentation, which would allow you to say if there's no connection
then don't show it.
The obvious thing to do would be to check connectivity before you call the recognizer
intent. And if there isn't activity, don't lead it up to the voice recognition. Although,
of course, that changed with Jellybean anyway, where we have offline voice recognition. So
maybe you're saying you're on Ice Cream Sandwich or before and there's no connection, then
don't show the recognizer options.
It might be a reasonable solution to your problem. And the next one is, "How do I get
the Galaxy Nexus or Nexus S to emulate an unencrypted tag?" I'm wondering if you're
trying to do it programatically or if you just want to do it as a test of the device.
If you just want to emulate a tag, you can download the NXP software out of the Playstore
and you can read and write tags or pretend to be tags and do things like that.
>>Nick: And it's a pretty complex subject as well. It really depends on what the tag
type is, because we really only support one particular tag type, which I--.
>>Richard: [unintelligible] push.
>>Nick: No. I wish I could get the name offhand.
>>Sparky: I think the MIFARE.
>>Nick: No, no we don't support MIFARE. It's an ISO standard one that we support, but we,
yeah. It's a really, really quite complex situation. So, it's quite open-ended. So it
depends on what the tag on the end of that is.
[pause]
>>Sparky: There you go.
>>Nick: But yeah, the app will probably be your best app, your best bet to try and do
that.
>>Richard: And even if you're trying to do something else, the NX app has an advanced
mode to debugging, which is just excellent for trying to sweat any issues at to see what
content's are tags and what format tags are in, things like that. You can grab that out
of the Play Store. Do you have anything else from the comment stream?
[pause]
>>Sparky: I added Nick's recommendation to my answer there.
>>Richard: OK. [unintelligible].
>>Nick: So, Android [unintelligible] can I do ISO one four four three dash four? Oh,
and what if they're classic, sorry. Not the standard [unintelligible]. That's what we
use it for.
>>Richard: Hopefully the person who was asking that question--.
>>Nick: Yes. He was trying to emulate anything other than those, then he might be out of
luck.
>>Richard: Hopefully he's watching the video.
>>Nick: [unintelligible] moderator.
>>Sparky: Next question is how can I mock the account manager in Android Tasks? Currently
the default [unintelligible] private. Planning to add a mock account manager. I have not
gone into the depths of what you can mock and what you can't mock in the Tasks, so I
can't really speak to that. I could look it up, but I have not done so in advance.
>>Richard: Yeah, again, that's a new--. Put the question, did look it up.
[pause]
There seems to be some answers on the Android Google Group, which may or may not work. By
the way, I'm just checking that out and having a search. We don't have, there's any [unintelligible]
on whether there will be one in the future. Four more in this page.
>>Sparky: Did you cover the question about the, about making the phone app more tablet-friendly?
>>Richard: No, that's where we were just about to go.
>>Matthew: [unintelligible]. [feedback voices]
>>Nick: For example, I want to make my apps more tablet-friendly. So how do I keep a phone
layout for Phones, also display large images when you use it in stores on tablet?
>>Sparky: I don't know. I think that one's a complete stumper. I don't think we're gonna
be able to answer that. [laughter]
>>Richard: It's not possible. You should [unintelligible].
>>Nick: Yeah, well, there's two major ways you can do this. So, if you need to let it
have a completely distinct layout, then you can just provide a different layout easily
using the resource qualifier on the layout directly.
So, you have your layout directory containing your layout for phones. Then, you could have
a layout dash X-large, or say dash SW600, for example, if you want it to say I need
a minimum of 600 DPs size screen in order to show this larger layout. And then you have
an alternative layout in there with the same name.
So, that's one way you can have a different layout. So go and check the development docs
for that. Another technique which I quite like as well is if you, if the same layout
works well for both the phones, but say I like my Nexus 7, you want to have slightly
larger images. You can just use the dimensions bar.
And so similarly, in your values, probably, you might have a value dimens XML in your
values folder saying the image size should be 100 dp. But you have an overloaded version
in your values dash SW600 dp, which has a similar file for overrides that value. It
says the image size should be 150 dp.
So then, when you reference that size from your layout, you'll get the right version
depending on what device you're running on. So, you can use the same base layout, but
just add bigger image sizes or text sizes or whatever it is you might like.
>>Richard: Very well, this is very well covered in the docs as well. If you just search for
supporting multiple screen sizes on Android, then you can see all the details on that as
well. You gonna say something there, Sparky? Sorry.
>>Sparky: There we go. I was gonna say those size qualifiers, those size buckets, do those
work on alternative drawables as well as on layouts? I thought they did, but I'm not sure.
>>Richard: Drawables you do via densities, right?
>>Sparky: Well, yeah.
>>Matthew: There as well. Usually that includes the screen width.
>>Richard: But you still do it?
>>Matthew: No, 'cause you can still--. See, what you could do is probably if you were
doing the size, width and [unintelligible].
>>Richard: You should look at the supporting multiple screens page.
>>Matthew: Yeah.
>>Sparky: Yeah, should have looked at the supporting multiple screens page. I think
that's gonna have the answer.
>>Matthew: But before you would've had dash X-large. And then you could have any dpi by
it. Et cetera, et cetera.
>>Nick: And make sure the order is right as well because the order is important.
[pause]
>>Matthew: There's a hierarchy.
>>Sparky: And document it.
>>Richard: Yes, very much so.
>>Sparky: And if you don't wanna look at the documentation, you can just add your qualifiers
using the graphical tool in the IDE. Then you click some and it'll put them in the right
order for you.
[pause]
>>Richard: I was just looking through the different qualifiers and you can even specify
the qualifier for the country codes, the country code. If you want to add different graphics
detected by the country of the device automatically, you can put your own CC and country code in
there. That's on providing alternative resources for qualifiers.
[pause]
There's a lot of different qualifiers now... [unintelligible], car, desk, television, or
appliance?
>>Nick: These are old. [unintelligible]These will be as well.
[pause]
>>Richard: OK.
[keyboard clicks]
Right. Now we can go on to the next one.
[pause]
>>Sparky: OK. I'll get mine. So the next one on the moderator is sort of a long, complicated
question from [unintelligible] in Greece. Says I want a development app that's quite
dynamic. It has to correspond to some specific tables in a database. It comes from a user-contented
website and I'll have to create buttons and strings and stuff that comes up from the web
server.
This sounds to me kind of like your basic client-server application can probably use
any sort of arrestable API, using Silk or using JSON or whatever. I don't see that there's
anything about this that doesn't fall into a very broad category of applications that
we've seen on Android before. So I think it's definitely doable and probably involves quite
a lot of code. So, the writer says is there a library?
[feedback noise] No. I don't think, there might be some, couple
libraries, but for anything this complex, I don't think you're gonna be able to get
around writing a lot of code. Maybe you can use some techniques to accelerate your database
access. If you're adding databases on the device, but yeah. Pretty much you're talking
client-server application.
It's sort of a solved problem. Nothing ground breaking there. When will Slovakia beat in
Street View. That's an application question, not a development question.
>>Richard: Yeah, the next two questions are. Nothing totally appropriate. Applicational
feature requests. Can you get one?
>>Sparky: And how can I get Chrome on my Android? The answer from the other reader is supported
by ICS and above. And I'll accept that as the correct answer.
>>Matthew: Yeah, yeah. That's true.
>>Richard: OK. Which means I believe we've got through the moderator questions.
>>Nick: There's a question in the G+ frame where Boyd asks, it says that he loves holo
theme so much. Can he use it elsewhere? Yes.
[laughter]
>>Richard: How?
>>Nick: No, he says can he use it on Gingerbread apps, even IOS or web apps? Sure.
>>Sparky: I'd say Gingerbread is not too hard because it's, you've got all your XML scripters.
Porting the whole thing to IOS, that sounds to me like a world of pain. I mean, yes, you
can copy the appearance, but you can't actually port the assets directly.
>>Nick: Yeah, I'm just gonna slip a little in there. I would say you can, yeah. As Sparky
says, you can probably get hold of the assets and the general padding and the build by looking
in platform resources directory.
But you probably wanna stop and think, is that what you really wanna do? Like, I'm a
big advocate of having apps that are native on that platform that they're on. I'm not
gonna say, it is case for an app, like follow the holo theme on Gingerbread, even though
it was introduced after that platform is a distinctively unmanageable task to really
keep an app.
Like, looking completely native on every version of Android out there. So, if you're gonna
put any effort into making the app look great, I'd say make it look great on the newest stuff
on holo and it's OK. I mean, that's what we do at Google. If you take a look at Gmail
application or the Play Store, for example.
They're both very holo kind of themed application and they look the same on Gingerbread. So
yeah, you definitely can do that.
>>Sparky: Turnabout is fair play, isn't it? Wouldn't it be nice to see an application
on IOS for once that's a clone of its Android version instead of vice versa?
>>Al: All the resulting stuff are partly Android Open Source projects, it's all Apache licensed,
so there's nothing stopping anyone going for that.
>>Todd: Well, I can tell you that in Israel, they actually started producing apps on Android
before they start on IOS. Pretty surprising.
>>Richard: We've had partners whose apps have been rejected from the IOS build because they
looked too Androidy before. You just don't get to see them on IOS 'cause they rejected
it before they landed in the store.
>>Todd: No, no, no. They didn't develop them just because they're delayed. They like, for
example, a big telephone company here, they just produced an app that shows you free wi-fi
that belongs to their network. Like, that's 02 and other companies in the EU. And they
said the iPhone IOS will come soon, but the Android is already out.
>>Richard: Thanks, man.
>>Todd: It's completely Android-style, IOS free whatsoever. Quite surprisingly.
>>Richard: Brilliant.
>>Nick: Yeah, it's been about six months or so since we launched the Android design site
and we're starting to see not just keen Android advocates and developers, but also just the
big companies really starting to embrace that. And I think that that's what they long for
is an official place saying, "This is what Android app looks like." And then the people
start to follow that. So, it's brilliant to see.
>>Todd: Yeah, that's what happens today. The thing also, you know, Android is, I think
the advantage of Android is also is the fact that it has so many varieties of devices as
opposed to one device. Do you see what I mean? Because usually that's the way I see it. If
you look at another family, it's very rare that you'll see in one family the same device
sold to all the people in the family as opposed to--.
>>Richard: Yeah, of course. I agree. My, are we frozen? No, Nick's just sitting very still.
[laughs] I've got an HTC HD. My dad's got a Nexus S. I've got a Galaxy Nexus. My brother
has got a Samsung Galaxy S, too. Android family. All different devices. There you go.
>>Nick: Beautiful story.
[laughter]
>>Richard: We've all got our Nexus stuff. I've got one.
>>Todd: I can also tell you right now, they announced that Jellybean got, started rolling
out for the Zoom, also. They just started it.
>>Nick: Oh, yeah?
>>Todd: About a few hours ago. They said on XPA that some people started getting it.
>>Nick: Great. So, that's a Galaxy Nexus, Nexus S, obviously the Nexus 7 and now the
Zoom, wi-fi.
>>Al: The Zoom wi-fi rollout is only preview. It's not going out to the public over the
air. It's part of Motorola's Early Adopter Program. They're trying to get people to test
it before they do a live rollout.
>>Todd: I doubt that--.
>>Nick: This is Motorola pushing out their devices, not the ones that Google control.
The American wi-fi builds.
>>Todd: American wi-fi I thought was being controlled by Google, isn't it?
>>Al: Motorola run a test program before they release the stuff across to Google. And they're
running the test program at the moment for the Zoom.
>>Todd: Well, I am trying to install it right now. I'm not part of the test group, but I
downloaded it, manually. Hopefully, I'll be able to start with the USB.
>>Richard: That's the Android way, Todd. Of course you downloaded it manually. Of course
you pushed the device.
>>Todd: What about the--.
>>Richard: The latest in, our Nexus 7 commercial, they were using an unlocked Nexus 7.
>>Todd: But where is the fun in that? If you get it straight away without trying to install
it yourself.
>>Richard: See. You feel like you're in control, right?
>>Todd: And what about the Nexus Q? What version of Android does that run on its base?
>>Richard: What did you find on yours, Al, when you decomposed it?
>>Al: I was running a tweaked version of Ice Cream Sandwich, like four oh four. It had
lots of little changes in it 'cause it was an Android at home device.
>>Nick: Sneaky.
>>Richard: All right. Excellent stuff. We'll keep the video down in length a little this
time and see if it increases the number of YouTube watchers later on. So, thank you all
very much for dropping by today. And we'll see you all again at two PM next week for
the next Android Developer Office Hours.
>>Man in the Hangout: Thanks, guys. Hey guys, I have one big off-topic question. Can I just--.
>>Richard: I'm pressing the button.
>>Man in the Hangout: OK, so I have Chrome browser. And when I select text, Chrome thinks
it's a mouse gesture. How do I turn it off?
[laughter]
>>Richard: Chrome browser on Android?
>>Man in the Hangout: No, on my PC.
>>Richard: What? There's no gestures in Chrome on your PC. Just select text.
>>Man in the Hangout: I select text from right to left and it takes me back a page.
>>Richard: Have you just installed a new mouse?
>>Nick: Yeah. That sounds like an Apple--. On which device?
>>Man in the Hangout: On an HP Dell Probook.
>>Richard: Well, maybe you need to go to the Chrome Office Hours, not us.
>>Man in Hangout: All right. Will do.
>>Sparky: Do you have any extensions and stuff?
>>Richard: It happened on mine. Yeah. [unintelligible] Safe mode or whatever it's called now. Bye.
Thanks for that.