Android Developer Office Hours EMEA
Articles Blog

Android Developer Office Hours EMEA

August 12, 2019

>>Sparky: Welcome to the Android Developer
Office Hours. [someone whistles]>>Sparky: We are your Android EMEA Developer
Relations team. I’m Sparky in Munich, Germany. I’m also joined by Matt and Rich and Nick
in London, UK. We’re here to answer any questions that you have regarding any topics around
Android development. We won’t answer any questions about unannounced things. But barring our
refusal to look into the future, we’re here to talk about whatever interests you regarding
Android development. So let’s see who’s in the Hangout and what’s goin’ on.>>Rich: Well, we’re here Sparky. Hey, good
to see you again. We’ve changed rooms this week as you may have noticed. It’s not just
a faulty camera, our room’s turned blue. We’re in Haskell instead of the standard Android
room.>>Sparky: Haskell? [inaudible]>>Rich: [unintelligible] I’m shoppin’ around
here.>>Sparky: Oh, oh. Well, we don’t talk about
future product directions do we, so? [laughter]>>Rich: Yes, this is the Haskell room, soon
it will be [inaudible]>>Sparky: We, we emphatically deny that Haskell
is going to be the future of Android. [laughter]>>Rich: Please deny that a lot. I don’t want
to have to learn that. [laughter] Just ’cause we got the ball rolling.>>Nick: It worked out quite well today. ’cause
I’ve got an Android t-shirt and Matt’s got a Google TV t-shirt. So we’re quite clearly
product [inaudible] [laughter] Who knows about Richard’s. Bit of everything.>>Rich: I just do IO. It’s fine. Bright here,
as well. Interesting. Well, better lit than normal. So, yeah.>>Nick: Who else is live in the Hangout? Who
do we have?>>Rich: Hey Johann, good to see you there?>>Johann: Hi guys. [clears throat]>>Rich: You alright? Is that actually your
office now? I don’t think you’ve called in from your office before.>>Johann: No, that’s true, that’s true. It’s
the office.>>Rich: Nice. [laughter]>>Rich: I’ve just bought my ticket for DroidCon
Holland, so I’ll be seeing you out there in November.>>Johann: Good, good, good, good.>>Rich: Quite looking forward to it.>>Johann: That’s good. Yeah.>>Rich: You can [inaudible] us coming up already.>>Matt: I’m already on it.>>Rich: Oh, yeah, that’s right, you’re speaking
at DroidCon Holland.>>Matt: Yeah.>>Rich: There you go, you’ve got two of us
heading there already. I don’t know that Nick is going to DroidCon UK? Are you going to
DroidCon UK? You’re speaking at DroidCon UK, aren’t you?>>Matt: Yep. I’m working my way ’round.>>Rich: So both of those guys will be at DroidCon
UK and us guys will be, and maybe Nick as well, will join us at DroidCon Holland.>>Nick: Maybe.>>Johann: Very good.>>Rich: Looking forward to the DroidCon Season.>>Johann: Yeah.>>Rich: Good chance to get back and see all
the developers. Who else is on the Hangout today? We’ve got Ravi? Hey there Ravi.
Do you have, um–?>>Nick: Where are you phoning in from Ravi?>>Rich: Can you have a microphone today? Or
are you just on chat?>>Nick: Well, we can’t hear you right now.>>Rich: Yeah.>>Ravi: Uh, can you hear me now?>>Rich: Yeah.>>Nick: Yes we can.>>Ravi: Yeah. Um.>>Nick: Nice fat dings>>Ravi: Yeah, can you hear me now?>>Sparky: Yes, we can hear you.>>Ravi: Yeah. OK. Um, I just have some questions
about audio. Handling audio in Android.>>Male #1: [inaudible] this morning [inaudible]
about KPI [inaudible]>>Rich: Uh, one second Ravi. Because. [multiple people talking, background noise]>>Rich: That should be [inaudible]. Sorry,
carry on Ravi. [man talking indistinctly in background]
>>Ravi: OK. [inaudible] take longer than [rustling noise]. So I’ve been working on audio in Android.
So I’ve got this stream, which I’m doing streaming soundtrack. Streaming to the headphones. Are
you clear so far?>>Nick: Yeah.>>Rich: Yeah, yeah.>>Nick: [inaudible] is just about a half
hour, so.>>Ravi: And now what I just need is another
audio track or maybe a sound tool, which sends the audio to a speaker only, which means that
the headphones signal will be uninterrupted. And the SoundPool, which sends to the speakers
would be an independent one. Is there any way to do this?>>Matt: I think I catch you. So you, are you
trying to play a sound through the speakers as well as the headphones at the same time.>>Ravi: Yeah. Different.>>Rich: Different sounds? I don’t think that’s
actually physically possible.>>Ravi: I’ve been trying through using AudioTrack
which sends a sound, a continuous sound through speakers, I’m sorry, headphones. And I’ve
been using SoundPool to use this as an audio manager. Using an audio manager stream ring.
Do you get it?>>Sparky: Yeah. We’ve had some questions like
this before. I think the first thing I would ask is, why do you want to do that? I mean,
I think that one of the strongest use-cases for headphones is that you don’t play sound
out through the speakers. So, I mean, you know, it seems like you have the possibility
of circumventing the basic contract that the device makes that says when you plug in your
headphones you won’t be annoying your neighbors. [male voices in background] [door slams]
>>Ravi: Mm-hm. But the thing is here, we are actually sending the entire audio input signal
as in one source, while the other one we’re using has maybe more [unintelligible]stuff
. When we use a notification on the ring, [inaudible] in a stream, it’s interrupting
the stream to wait. And in this audio’s finished, and then it returns the signal back again.
Which is quite, not what we are expecting to do.
[someone comments in background, inaudible]>>Sparky: I don’t think, I don’t know if any
of us are really that expert in the multimedia framework. I don’t know, maybe, I won’t speak
for you guys in London. I mean, technically I don’t know the answer. I’m just not convinced
that it’s a good idea. Maybe you guys in London have a perspective
on this.>>Rich: Well, I think we’d know about it if
it was possible. ‘Cause you’d end up setting separate volume controls for the speaker,
to the headphones. And you know, when you, there’s events that happen when you plug in
headphones and unplug them for example. The music will stop playing. So I know that you
can get events to tell you that event’s been plugged in but then [inaudible] speakers. Probably confuse users somewhat as well, ’cause
they would be expecting the speakers to mute as soon as they plugged in the headphones.
Could be potentially embarrassing. I’m guessing it’s just not possible.>>Ravi: Mm.>>Sparky: Or if it is possible, maybe the
way to do it is to do it in the NDK. You know, once you get below the Java framework, then
you can get much more direct control over the actual hardware devices and you might
be able to open electrical audio channels that might just might not be possible to populate
at the NDK, or at the framework level.>>Rich: Sounds like a good question to try
on StackOverflow and see if you get any response.>>Ravi: I’m already in a discussion with StackOverflow.>>Rich: OK. Great. If you want you can post
a>>Ravi: Yeah, so.>>Rich: Question in the chat window and we’ll
have a look at it as well.>>Sparky: Did you also, are you the poster
of the questions in the Moderator as well?>>Ravi: Yeah.>>Sparky: OK.>>Ravi: Android Boy.>>Sparky: Good. Yeah, I gave about the same
response in the Moderator that I just told you. I wanna thank you for coming into the
Hangout and to let us consider your question live. That’s great. That’s what we’re here
for.>>Ravi: Mm-hm.>>Ravi: Thank you very much.>>Rich: Yeah, thank you, thank you.>>Sparky: Does anyone else want to jump in
with a question.>>Male #2: Hi. I wrote a question down on
the chat bar. But I wanted to know if, I just wanted to see if we were able to use Google
credentials inside of Android.>>Sparky: You mean like Open OPS? Or Open—
[background feedback throughout]>>Male #2: Yeah. I’m using OPS. I’m using
the account manager to get an OPS token. And then I want to use Google credentials in order
to fetch data from the, from I don’t know, from contacts or from calendar and so on.
And—>>Nick: So, yes there is a good way, and it’s
coming soon.>>Male #2: OK.>>Nick: And basically we’re working on a new
file library [inaudible] Right now it’s [inaudible]. Anything, you can try that.>>Male #2: Yes.>>Nick: Android. You watch that [inaudible]
So your API is going to write for an app. So you can get up to speed [inaudible] ’cause
when you [inaudible.]. So that would be, I think now.>>Male #2: OK. And for now, is there a workaround
or something? Besides the Google Java API?>>Nick: Well, yeah, you still can use like
O Authors and C Scape [inaudible]>>Rich: I put the link in the chat for you.
[feedback continues]>>Male #2: Oh, OK. I just saw that now.>>Nick: [inaudible] the API.>>Rich: Yeah. [inaudible] authorization.>>Nick: So, in the side bar, the chat bar,
do you see that Rich has put a couple of links. Yeah?>>Male #2: Yeah.>>Nick: It’s that [unintelligible] I just
mentioned. And at first there’s an example of [inaudible] using the Google Tasks API
which [inaudible]>>Male #2: OK. GoogleTasks will also be the
one, the example one that I can use and switch to, I don’t know, to get contacts, get calendar
events and so on?>>Nick: Yeah, you would have to use different
scopes. Different [unintelligible] scopes.>>Male #2: Yeah.>>Nick: To collect data. But yeah, it’s the
basic steps.>>Male #2: OK. Thank you.>>Rich: Right.>>Nick: [unintelligible] in the comments in
the G Plus links.>>Rich: Yeah. That’s right. So, I will check
the situation. There it is. Google Tasks. Or is this Google?>>Nick: Did we have any more live questions
to people in the Hangout?>>Sparky: We’ve got a pretty full house here.>>Rich: Yeah.>>Sparky: So, looks like Talid has joined
us but I don’t see him.>>Nick: Richard, go ahead. Please ask away.
Feel free to either speak it if you can or type it in the sidebar.>>Matt: [inaudible]>>Sparky: Does anyone want to ask a question
while Richard is typing or should we take one from the Moderator?>>Rich: What happened to users dynamic fragments?>>Sparky: Yeah. [chuckles] Let’s jump in with
one from the Moderator. Here’s, this should be a quick one. Orin in Israel wants to know,
is it possible to show the in-app billing dialog. The Google Play in-app billing in
landscape mode instead of portrait? Um, I suggested that he run one of those utilities
that forces the entire device to landscape and see what happens. That’ll probably work.
I think that, when possible, the Android team tries to make its activities orientation agnostic
and support rotation. And if they don’t support it by default on a particular device, it’s
probably because they weren’t able to get a user experience that they were happy with
in that orientation. And so they locked it out. That’s, so my guess there is that if
they don’t support landscape on the Galaxy Nexus it’s because they weren’t happy with
the UX that they got when they tried it.>>Rich: I thought it was already done, to
be honest. Um, I’ve seen it appear in landscape on multiple devices. Now, certainly on the
Nexus 7 it appears in landscape. Maybe there are some smaller screened handsets that they
still haven’t got a landscape layout.>>Nick: [inaudible] version not [inaudible]>>Rich: No, it was there from IO, I’ve seen
it. But no, there’s nothing you can do to force it. There were versions of the market
client that would only show in portrait mode which was annoying. And they are updating.
Yeah, the ones that we have here are showing in landscape. I’m just concerned that maybe
he’s testing on a smaller screen device, like, just—>>Matt: Yeah.>>Sparky: It’s the Galaxy Nexus.>>Rich: Yeah? Well on Galaxy Nexus it should
already be done.>>Sparky: I’m never sure of what everyone
else is seeing on the Galaxy Nexus. ‘Cause I’m usually running some hairy dog-food build
that’s you know, several steps removed from what any sane person would dare to load on
their only device.>>Matt: Living life on the edge.>>Sparky: OK, we have a question from Richard.
“I’m trying to implement the Up button for the tablet version which has dual pane layout.
All the fragments in the dual pane layout share an activity and implement an interface.”
Um. Up button. Well, I mean you don’t need the up button if you’re just changing, say,
fragments on the same activity. The up affordance is for changing between activities. Generally
speaking when you have a dual pane layout, right, you’ve got a selector in one fragment
and your detail in the other fragment. And we don’t really do like, we don’t do back
history and that. And we don’t do navigation history and that. Navigation is for changing
activities. Is that about right, Nick?>>Nick: So I’m going to interpret this question
as you have like layers of hierarchy and navigation. But instead of having separate activities
it sounds like you just have one activity and you just dynamically change the content
of that one activity depending on which layer of navigation you’re at there. That’s how
I interpret it. That you’ve done so differently.>>Sparky: OK.>>Nick: So it sounds like you’re trying to
almost, take control of what you [inaudible] activities [inaudible]. Uh. Which [inaudible]
a little bit. You know, it’s timing your control. You just click on an option item, select it
[inaudible] [someone in the hangout speaking, inaudible] So, you can just kind of react to it as that,
or if you use the latest, the later version of the support library. Um, if you wrote to
the activities you can provide a metadata tag, saying “Defining the name of the parent
activity” so that it will handle the up button popping the stack and reproducing the parent.
So that could work. But I’m not quite sure what the exact question [unintelligible] is. [laughter]>>Sparky: I suppose, to, taking what you said
there and running with it a little bit. If he’s swapping out fragments rather than changing
the activity, then you want no parent activity. And you just wanna receive that menu event
that option menu event and handle it by changing out the fragment instead of—>>Nick: I would caveat that there are some
places where the up button’s kind of overloaded. And doesn’t just do navigation. So I think
a good example there is the expand-collapse pattern. Which is probably best demonstrated
by Gmail. Where if you’re reading am message, kind of in landscape. And then you go to portrait.
The message expands to take up the entire width of the screen and hides the kind of
sidebar with the list of messages. And in that instance you might use the up button
there to create and out for the content. So it’s not always just kind of hierarchical
navigation.>>Sparky: Hm.>>Nick: Just to complicate things.>>Sparky: Right.>>Nick: But yeah, is that your question? Is
that, how do you literally react to it, say? In which case it’s the on-option item selected
on the Android.ab.home isn’t it? Yeah. It’s in the action bar docs.>>Sparky: Right, and while we’re on the topic.
In the cases where you have that slide-in, that slide-in control panel on the left side.
Like in the YouTube app.>>Nick: Yep.>>Sparky: Our guidance there is to not implement
that if there’s any parent activity. Right? That’s only for top portal activities with
no parent.>>Nick: Yeah. Correct.>>Rich: OK, so whilst two people are typing,
we’ll have a quick look at the Moderator. There’s a few questions in the Moderator from
Markus that actually came through for our session last week, but then got answered at
the Mountain View low-level media session. So the top one was how to detect if the audio
codec was for AMR wideband on a certain device. They got to the point where they could detect
whether a device supported AMR, but not whether it was wideband or narrow band. So they didn’t
answer for that one. And we’re looking into what you could find out about that.>>Nick: I think that got answered in the Mountain
View when James Dong was there.>>Rich: Yeah.>>Nick: Um, but interesting on this one—>>Rich: I thought James had some more information
on it.>>Nick: No, you should stick with that.>>Rich: OK.>>Nick: But interestingly, one thing I did
see today in my streams, is ACRA. If any of you out there are using the Android crash
reporting system. It’s quite a handy little system lots of people are using. For catching
core exceptions and sending them to Google Spreadsheet. There’s a new thing that Kevin,
is it? The, is that it? Uh. Can’t remember his name. I think it’s Kevin. Has added a
protocol action on Jellybean devices, also report back all the codecs. And the device
you’re experiencing crash on supports. So if you’re having this kind of media stuff,
and you’re using acra, I’d encourage you to take a look at that so you get a bit more
debug information about, oh, the device doesn’t support it or whatever. So, definitely worth
looking into.>>Rich: Alright. Do you wanna have a go at
the next question in the moderator, Sparky?>>Sparky: Um, let’s see. What is the next
question in the Moderator. [laughs]>>Rich: Ah.>>Sparky: The next one I see is one about
SQL.>>Rich: OK.>>Sparky: OK. So this says, oh wait. No, actually,
the one I see before that is “How would a malicious Android keyboard be treated in the
Google Play Store?” Well, if you know of a malicious keyboard, you should go into your
Google Play Store application and flag it as inappropriate. And then that’ll be escalated
to the Google Play team. When the Google Play team finds applications that are misbehaving,
they are suspended. And in extreme cases the developer may be banned and his account can
be blocked. So we don’t treat lightly malware in the application store.>>Rich: No. And malware keyboards could be
potentially really, really bad of course. ’cause they could read everything you’re typing.>>Nick: Be careful of any keyboard asking
for friends app permissions.>>Rich: Be careful of anything asking for
friends app permissions. I would totally agree with that. If you want to provide more detail
on your error report, instead of opening the Google Play client on your handset, and reporting
it as inappropriate, if you go to Google Play Help on the web, we have a nice form that
you can fill in there. To report inappropriate apps. And you can just Google for Google Play
Inappropriate Apps and it comes up straight away. You can click on that and fill in the
details. And it just gives our team a little bit more to go on. When they’re trying to
figure out why you think it’s malicious. OK. Let’s take that one off. Anyone else in
the hangout have any questions before we jump to the next–?>>Nick: Who is that with the scariest avatar
face there?>>Matt: Yes.>>Rich: Yeah, thank you Ben S. for having
a really scary avatar.>>Nick: Yeah. I think you know exactly who
it was typing, straight away. [laughter]>>Rich: Benedicta. It’s me. Same question
here. Its SQL. Ah.>>Sparky: OK then, well, let’s answer it.>>Rich: [unintelligible]>>Nick: Do you wanna ask it live then?>>Rich: Do you have a microphone there. I’m
guessing not.>>Nick: Everyone must get bored of seeing
us chatter on.>>Sparky: [laughs]>>Rich: He’s typing. At the same time I’ll
check the—>>Sparky: OK. He’s got a lot of background.
Well, thank you for muting then. We appreciate that. [laughter] OK. “I’m creating an app where the user enters
some value daily and I store it to SQL eight. That should work offline, but, if the user
has multiple devices, his data should be synchronized. Instant, not necessarily. What’s the best
way to do this?” Um, this says to me, you want a Google app engine app up there. And
you should be syncing data up there to your app engine. What do you guys think.>>Nick: Or, Google Drive. I would do, whenever
I did, might be to use Google Drive and a sync adapter. So you could have a sync adapter
to periodically call the drive API to sync up somewhere. So if you don’t wanna go down
the route of having to maintain your own storage service, which is what the app engine side
would be doing, you could ask the user to store it in their Google Drive folder or Drop
Box or something.>>Sparky: Yeah, well if you’re going to go
there then you don’t even need SQL, do you? I mean you could write rows into a spread
sheet or something, couldn’t you? Can we do that with the drive API?>>Nick: Yes.>>Sparky: Cool.>>Nick: Yeah, and that’s right actually, we
talked about the talk earlier on, which Rich even linked to earlier on, about using Google
Drive from Android. So if you take a look at that talk from Google IO, it’s exactly
that. It takes the notepad application, which many of you might have used. You might have
worked through that sample code as a first time resource SQL like database. And it takes
that and every time you save a note in, so not every time. But it has a sync adapter,
just what you want. So it periodically backs up that database. It just inserts and updates.
To Google Drive backed up files. So you can have it on multiple devices. All in sync.
And it handles checking MP5 hashes to make sure you were there. [inaudible] and all that
good stuff.>>Sparky: That’s pretty cool. I’ve written
a, I’ve written a Google Drive app that tied a spreadsheet t to a web app. But I’ve never
done it on Android before. So, maybe I should tried that next.>>Nick: Yeah. Fun to be had.
[chuckles]>>Sparky: Right, uh, let’s see, next. Oh,
my world is upside down. I’m living on the bleeding edge here, I just updated to Mountain
Lion and all my scroll bars are backwards. [laughter]>>Rich: It took me a good week to get used
to but it’s worth persevering with. ‘Cause now everyone else’s scroll bars are backwards. [laughter]>>Sparky: Yeah, yeah, I don’t know how many
years I’ve been using scroll bars where you mouse down to scroll up. And—>>Rich: Every mouse move has run down, every
scroll bar has run—except the ones on my callback.>>Sparky: But actually, I kinda like it this
way. Because now, because you know, since I’m using a track pad instead of a mouse,
then now, my, well, my laptop works exactly the same as my tablets. So.>>Rich: Yes. Exactly.>>Sparky: So it’s all good.>>Rich: That’s why it feels a bit more natural.>>Sparky: Huh.>>Rich: OK. There was a question. “I am a
user but I have a problem. From NDBJR. In, from nowhere actually. It doesn’t have a location.>>Nick: Aw.>>Rich: OK. “The system pop-up, about Google
authentication apparently. The pop-up only stays up for one second and contains too much
info to discern. Where can I find the message to look at longer?” Is this, wow, I can’t
really ask you ’cause you’re not in the hangout. Uh, we need a bit more information on that
before we can answer the question. It’s whether, if you’re developing an application and you’re
seeing this pop up, then it should be up until you approve it. So, I don’t know what you’re
doing to override the pop-up and make it disappear. But as Sparky mentioned in the Moderator,
check your log CAT and see what’s actually happening to make that pop-up disappear. Because
our authentication screen should be dialogs that come up for quite a long time and let
you accept or deny them or approve. NTK. Oops.>>Sparky: Hm. Paul Hanson has a question.
“Regarding NFC. I’m missing the ability to card emulate. Is there a way to do this to
beam?” Um, I mean, there is some sort of a card emulation
feature isn’t—I mean, there’s an API for it. It’s in NFC extras. I looked this up just
earlier today for somebody else. Maybe I can find that for you. I don’t know exactly what
it means, I just know that there’s an API to turn it on. I guess it’s needed for some
of the e-commerce related applications.>>Nick: Yeah, I think we have very limited
card emulation.>>Sparky: OK.>>Rich: OK. So it looks like actually the
rest of the Moderator questions have already been dealt with. In last week. Unless you—In
there Sparky that we haven’t answered.>>Sparky: Shouldn’t be. No. I think we’ve
got a few, actually. Let me take a look at this. Um. Let’s see. Keyboard SQL. AudioCodec.
Um, there’s one from Markus about encoding. Was that also in the detailed session last
week? ‘Cause I didn’t, or in the Mountain View session? ‘Cause I answered it but I didn’t
know—>>Rich: What was the question.>>Sparky: That—>>Rich: Oh, [unintelligible]>>Sparky: All these ones from Markus have
they all been answered before?>>Rich: I think so. They did mention quite
a few questions from Markus.>>Sparky: OK.>>Rich: But he’s still there.>>Sparky: Well, I can answer it anyway. He
says “How can I encode media that is not from camera or microphone? Or how can I decode
something without also outputting it?” Um, search StackOverflow. There’s lots of examples
of people who have done this. [laughter] I mean, that’s—>>Nick: And then you can go look at the new
MediaCodec classes. Um, introduced in Jellybean.>>Rich: Yeah, if you want to encode it for
Jellybean I’d always look at MediaCodec. ’cause that’s awesome. Um, although, it’s much better
at the moment in decoding than it is in encoding. Also, if you want to do it over a wider variety
of formats and platforms. FFMPEG is always a good group to check out. OK. So does anyone in the Hangout have anything
else to ask?>>Sparky: Um, if you guys can stall for a
minute I will find that note that I sent about the NFC API.>>Nick: Uh, there’s one live question that’s
come in on the G plus post. “Do you guys recommend a good way the usage
tests for Android applications like Selenium?” Any favorite testing approaches?>>Rich: Oh, auto testing. Or—>>Nick: Yeah.>>Matt: Or [unintelligible]>>Nick: [inaudible]>>Rich: Yeah, there’s a couple out there that,
roboelectrics slash roboting combination. There’s one that a lot of people talk about>>Nick: [inaudible] The unit tests.>>Rich: Johann. How do you test your Android
apps? Put you on the spot.>>Johann: [chuckles] Currently, currently
not. [laughter]>>Rich: Excellent.>>Johann: I’ve, I’m currently working on an
app which needs the Wi-Fi, so and that’s not available in the emulator. And I, I know the
robotium can test a real device as well, but at the time when I made the decision, so I’m
more in the project now, so—>>Rich: Well, OK. One suggestion. At Google
IO we had a Talks partner in called TestDroid. It’s a product called TestDroid by Bitbar.
And they do a really nice thing. They have a system where they let you record your entire
test on the device using key presses whatever focuses. And then records it as a script,
it uploads it to their cloud. Where they then replay it across any number of devices that
you’d like. And they have like 100 varieties of Android devices up there. And they photograph
the screens for you and they do all the touch presses and everything. Automated in their
cloud. So you can run, you can choose exactly which devices you want to run it on. And you
can just go and say “I want the Motorola Droid One, I want Sony X, and Xperia. Whatever.
Ark. Maybe. And a Galaxy Nexus and a Nexus 7.” And submit. And it just runs through.
Runs them all for you. And it seems like a pretty cost effective way of being able to
test your application on a number of devices. Which they’re working on integrating that
into people’s project build flows. [Hangout dings] So that at the end of each, so you
can sanity check, basically, as you’re doing your builds, that will automatically upload,
and run the tests. So there are other services out there.>>Matt: Trying to think if there may be one
way you can actually get access to a live device with a video camera on top of it.>>Rich: That would be [inaudible]>>Nick: [inaudible]>>Matt: [inaudible]>>Rich: [inaudible] when I was at DroidCon
last year.>>Matt: I’ve got a Testdroid [unintelligible]
that I remember from DroidCon. [Hangout dings]
>>Rich: I’d like to finish all of them. If you Google TD services. Also—>>Matt: MonkeyRun [inaudible]>>Rich: MonkeyRun and stuff like that. Yeah.
It might be MonkeyRun scripts that Testdroid uses. Um.>>Matt: OK.>>Rich: And I think it was Samsung which opened
up their own online testing lab free for developers if you sign up for Samsung Developer. Was
that Samsung or Sony, Nick?>>Nick: Samsung had an online legend, Sony
had a [inaudible]>>Rich: [inaudible] devices. So you can go
to the OEM developer sites as well. Alright, it sounds like you can borrow devices from
Sony and Samsung is a bit like Testdroid. The one that you mentioned. [all speak together] Device [inaudible]>>Rich: Where you can go online and [crashing
sound] the device.>>Nick: If you’re using Selenium, I’d probably
check out [inaudible] as my first tool.>>Rich: Yes. [door closing sound]>>Johann: Well, Rich, to put a question back
to you then. Um how do you test apps which use like a server, server side back end? Do
you, and which might be intermittent or so, do you mock that out? Yeah.>>Rich: Yeah, if it was gonna be like a high
grade application that needed testing, that was being built as a contract work. Then yeah.
I would mock it out as I was building the application so I could run through the tests
and make sure I was happy with the server side component. And then test the server side
and run it separately and bring it all together.>>Johann: Yeah.>>Rich: Can’t say that I ever actually went
to those lengths. [laughs] ‘Cause I just build the applications for myself. And as is often
the way with Android, we test on our users. Users are pretty eager to give feedback at
Android, right?>>Johann: Yeah. [chuckles]>>Matt: Um, there was a, uh, thing that you
posted up a long while ago, Nick. About being [unintelligible] like a beta. APK, and we’re
disputing it. It’s kind of [inaudible]>>Nick: [indistinct] is the popular one these
days. [inaudible]>>Rich: A few of those as well.>>Matt: Yeah, [unintelligible] doin’ it.>>Sparky: So, apropos of testing on your users,
I will give a piece of advice. Which is, don’t do live user testing for your negative test
cases. “Oh my God, you just deleted my entire album!” [laughter] “Yeah, I know, it was supposed
to do that. Success.” [laughter]>>Rich: OK, did you find that thing, Sparky?>>Sparky: I did. I just posted into the file
that implements the functions for card emulation. For turning on and off card emulation is called
“NFCadapterextras.Java” and I found it in the AOSP just by Googling on the file names.
So that’s what I suggested that Paul do. So. I don’t have like documentation for what exactly
it does or how to use it or anything. Just, you know, somebody asked “Can you do a card
emulation?” and the answer is “Evidently, yes.”>>Rich: I think it’s pretty limited as well.>>Sparky: Yeah.>>Rich: Unfortunately.>>Sparky: Alright. Looks like Yossi’s going
away. So, farewell to Yossi. Does anyone else have an issue they want to bring up?>>Richard: Yeah, I’d just like to follow up
on my issue earlier.>>Rich: Hey, Richard.>>Richard: Hi there.>>Sparky: There’s two of you. [laughter]>>Richard: I jumped on another machine. I
thought it might be easier if I jumped on in person. To try to find a quiet spot.>>Nick: [inaudible] So you had the issue with
the dynamic fragments, right?>>Richard: Yeah. So I’ve got, um, an app.
I’ve got the sort of, seems to be working fine for the sort of mobile version. The tablet
version, I have sort of a search list and then when somebody performs a search, they
get a list of results that slides in and then when they sort of click on a result it then
slides in the detail screen. And that will then allow them to slide in a more detailed
screen. Again after that. So I wanted to do something like the Gmail app. Which then allows
you to sort of navigate back upwards. [Hangout dings]
>>Sparky: Mm. Right, so maybe the little up button would simply close the rightmost tab
essentially? Or close the rightmost detail view?>>Rich: I apologize for that Richard. We dropped
out just as you were saying about the fourth list that drops in. Our Hangout dropped out
for a second there.>>Richard: That’s fine. So it just goes to
results list and then a summary detail screen and then goes into a more detailed screen.
And I’m just looking to do something like the Gmail app where you just hit the back
button, it would take you from the very detailed screen to the detailed screen, up to the search
results, then up to the search screen.>>Rich: Mm-hm.>>Richard: So I’ve kinda got out a structure.
All my for the tablet layout, all the fragments are sort of contained within a search activity.
And all the fragments implement and interface that calls back to that— >>Richard: that will do all the fragment transactions
and swap out all the screens appropriately. Now, where I’m having the issue is, is obviously
for the initial top level search screen, I don’t want the up button on that screen. I
just want it in all the sort of child screens. So because everything shares the one activity,
it’s a, what is the best way of having, specify I want the up button to be there for every
screen except for that top level screen? And then b, how do I handle the view suppressing
the up button? That those are the two problems that I’m facing.>>Sparky: Well, you can show and hide that
chevron, right? I mean that’s a function call. A method. Which I recall.>>Nick: Yeah, it’s [unintelligible]>>Sparky: It seems to me like what you just
wanna do is know your, sort of know your depth of view. And anytime your depth is greater
than one, close the rightmost fragment and decrease your depth. That’s kind of, I mean,
it sounds like a pat answer. But that’s what I’m seeing when I hear you describe it.>>Nick: Yeah, well it sounds like simply,
you know you have certain states which you get into. Like maybe just, you know, define
it or as constant in it, and you know, just call up your current state and you know, so
you can say, at home “Set up button.” You know. And you pass in your current state.
And you know, if you’re in the root with those you don’t show it. Something like that. But
yeah, I think you’re basically gonna have to manage it yourself.>>Richard: So [inaudible]>>Sparky: [inaudible] would be a good implementation
for that.>>Nick: Say again, Sparky?>>Sparky: I’m trying to think if you could
get some good UX by using the, a view pager there. And rather than just popping fragments
in and out of existence. I don’t know. I’m sort of mulling over it.>>Matt: You might be able to if you had, if
they weren’t taking up the entire screen. There could be some really weird stuff that
you could do with it but, not sure whether it would make sense or not.>>Nick: ViewPage doesn’t have [inaudible]>>Matt: Yeah, exactly. So you could have sort
of a third—yeah, that would be interesting. Could you dynamically change the width developments?
The ViewPage width?>>Nick: Yeah, the page width on the adapters.
You could do that. You could change it.>>Sparky: Well, if you stick your fragments
in a linear layout, can you give them layout widths? Mm.>>Nick: No, if it’s in the ViewPager it wouldn’t
respect that. You’d have to use the set page width, which, API on, Set, page, width. The
API on the page adapter I think.>>Rich: Oh yeah.>>Nick: But yeah. Yeah, that’s the question.
Um. Yeah, I think essentially you’re gonna have to handle your own state. So whatever
you do, like join those callbacks you talk about. So when a fragment is talking to the
activity to do the fragment transactions, that’s the point at which you wanna kind of
enable, save all the app [unintelligible]>>Richard: Yeah, so I think I’ve got something
to do that. I wasn’t sure it was the best way. The other problem I’m having is about
handling the user pressing the up button. ‘Cause I found various ways online, but it
just jumps the user straight back to the home screen.>>Nick: So you can override that with the,
in the activity, if you add override the option item selected method. And switch on the idea,
I’m pretty sure it’s I think that’s it.>>Richard: Yeah, so I’ve implemented that
method and I’m checking for that case.>>Nick: So you’re saying that sometimes when
you hit the up button it’s not going active?>>Richard: Well, my slight question is, what
code should I be putting in there because I found some example code online. And um,
what’s OK, or I think I’ve got some slightly bad code. I’ve been using for the mobile stuff,
which works find. But with the tablet layout, having the screens side by side, I found some
code about using an intent. And calling an intent. But that always jumps the user back
to the –>>Nick: Yeah, I think it [unintelligible]
you probably wanna be invoking your own callbacks to do whatever any one state they’re in, so.>>Sparky: Right, it seems to me like that
on options menu, options item selected, is where you want to look at your depth of detail
and remove the fragment and decrease the depth. Or you know, change your state variable, whatever
that happens to be.>>Richard: Yeah, I was thinking I have to
do something custom to deal with my own program transactions. I was just wondering if there
was anything better, a better way of doing it inbuilt. But it sounds like the answer
is “No.”>>Sparky: There’s nothing particularly wrong
or hacky about using the fragment manager to remove a fragment.>>Richard: OK.>>Rich: Great.>>Sparky: I guess you could. I mean you could
allocate all of your fragments statically and just show and hide them. You just stick
’em in the XML and if you know that there’s exactly one of each, you could hide it. And
then when you need to see it you could populate it with the right stuff and show it. Um, I
don’t know. It’s another way to do it, I guess.>>Richard: OK. Thank you.>>Rich: OK.>>Sparky: I suppose if you statically create
them all then you don’t ever need to actually search for one. You can just get the IDs of
your fragments and just access them directly. Might be a little bit simpler that way, I
don’t know.>>Rich: OK, we’ve had another question dropped
into the Moderator. From Weimar, as well. So, um, we can have a quick look at that.
He posted his StackOverflow question and then linked to it in the Moderator. Which is great.
StackOverflow question is, “One of my activities embeds a video view. And on pausing and resuming,
it’s calling OnPause and OnResume respectively but OnResume is called before the activity
is actually visible to the user. And it’s happening when he presses the power button
to lock the device, and then presses the power button again to unlock it. OnResume gets called
before the user unlocks the screen. This is something actually we’ve spoken about
quite a bit in terms of games. Uh, “Games That Play Nice” was a talk that Dan and Ian
did. And there’s also a blog post on it.>>Nick: [inaudible]>>Rich: There was a blog post in there that
was also in there at the Google IO talk this year. You actually need to lock the OnResume
and the OnFocused changed event. To say that you’ve gained focus again. Because the lock
screen, before Jellybean, wasn’t actually an activity. It was just something that appeared
on the very top of the actual screen. Your application became resumed. But there was
something still on top of it. And it was only once the user unlocked it, or got to that
screen, you got the focus back again. But some, it’s like complications. In just
waiting for OnFocus changed, or OnResumed. So, you need to look for both of them. But
it’s in the blog post. I’ll post it on the StackOverflow to explain the exact blog post
in there. But you, yeah, it’s a well-known issue. And from Jellybean, it doesn’t’ exist
anymore. So if you test it on a new Galaxy Nexus or a Nexus 7, you’ll see it doesn’t
happen. Because the lock screen has been changed.>>Matt: Nice.>>Sparky: Let’s see, we have another question
from Paul in the chat here. He wants to know “Can I use NFC to bootstrap a Wi-Fi communication
channel?” Um, maybe? Did we have that for Jellybean? Do you know, can you use the–?>>Nick: What kind of Wi-Fi communication?
You mean, like to [inaudible]>>Sparky, no, I think he’s talking about using,
yeah, using NFC beam to, or using Android beam to initiate the transfer and then. Oh,
no that’s not Wi-Fi. That hands it over to Bluetooth for the bulk transfer, doesn’t it?>>Nick: I don’t think you can. I think there’s
no programmatic way to turn on Wi-Fi direct, if that’s what you’re talking about. I think
it requires user intervention.>>Sparky: There’s, there’s an emerging standard
for this, isn’t there? It’s like sort of a, it’s a recognized practice. I just don’t know
if we’ve implemented it yet. I don’t think we have.>>Nick: Paul, can you be a bit more specific
about what you mean by Wi-Fi communication channel. What are you trying to do?>>Matt: I’ve kind of got this image of someone
scanning an NFC card and then input in the Wi-Fi password or something. And turning it
on. And just—>>Nick: I’ve thought about making an app like
that one. You see the hacker farms, you walk up and you [inaudible] the Wi-Fi.>>Matt: But anyway [unintelligible] the settings
and there’s some way you know to write the actual pass code for that, the keyboard.>>Nick: Which you can do.>>Matt: Yeah. That’d be pretty cool. [Hangout dings]
[microphone interference sound] [loud typing]
>>Rich: Hey there.>>Sparky: Look like we’ve just been joined
by a new viewer, Lindon. Hello, welcome to the hangout.>>Lindon: Hi. [loud microphone interference noises]>>Sparky: is there anything you have to discuss
related to Android development? What are you working on right now? Do you have any questions?
[Hangout dings]>>Nick: So Paul has provided more information
in the sidebar saying that he’s basically looking to transfer data. As far as using
NFC to kind of initiate the connection. And then [unintelligible] through Wi-Fi. Well
the good news is, as of Jellybean, that’s exactly what Android beam does for you. So
you get that for free. So it will initiate a Bluetooth connection through the two devices
and send it via the Bluetooth. It doesn’t use any form of Wi-Fi yet. I know Samsung
had rolled their own solution there, I think. S Beam or something. Which [unintelligible]
to Wi-Fi direct. Which is good for them. But at the moment the IP for Android platform
won’t do that. Um, so that’s Jellybean onwards. If you are trying to bring that back to older
devices like I guess Gingerbread or ICS, then I imagine you could do that but you’d be setting
up an insecure Bluetooth connection. But I would have to look into that. Haven’t tried
it myself.>>Rich: Yeah. Yeah I don’t know if there’s
any part of that Bluetooth connection that would need the secure part of the system.>>Nick: I think, yeah.>>Rich: But you can have a Bluetooth zero
connection actually without the user’s [inaudible].>>Nick: I think it also needs the exchange
there, the NFC. ’cause most of the NFC stuff is about pushing your way. And where this
is an opportunity to exchange like [inaudible] or whatever. [inaudible]>>Sparky: Yeah. Of course NFC is just a great
way to transmit a shared secret because it works over such a short range. So that’s why
it’s ideal for bootstrapping something like a Wi-Fi or Bluetooth connection.>>Rich:[inaudible]>>Sparky: Alright. ViewPager with multiple
pages on screen. See Mark Murphy’s recent blog post. Cool. Yeah.>>Rich: Plus one. [laughter]>>Sparky: That was nice.>>Rich: Well I saw a plus one thing in the
comments on the Google plus hangout. There’s a Google plus hangout. You would have thought
they would have had plus one buttons, but. You have to make them yourself.>>Sparky: Yeah, it’s a good idea. But it looks
almost suggestively obscene. I don’t know. [laughs]>>Nick: [inaudible] have any, it died and
there’s a hangout so there’s no URL to which to go.>>Rich: Are we up to ten?>>Nick: So, have we answered everyone’s questions?>>Rich: Oh! We’ve got another new one come
in. From “S” from Nowhere.>>Nick: [inaudible] out.>>Rich: Uh, it’s a long one. That’s all right
there. “How do you make those one by one shortcut widgets which link to other widgets? But the
one by one settings. Also, is there a high level summary of these somewhere? I couldn’t
find anything in the API guides search section?” So, a one by one widget is just that. You
just give it out, well, like an icon. One by one. You [inaudible]>>Nick: [inaudible] [laughter]>>Rich: Well, when you touch it, it files
an intent which launches the settings page. You can see those intents often if you plug
the device, I don’t know why I’m doing it. Sorry, I’m not bored. If you plug your device
into your ADB long cat. It’s often, when you press settings, you’ll
see the settings intents file. And you just need to file the same intent. They’re all
listed. So all the service intents documented as well. So you can build them very quickly
and usually it’s these one by one widgets. For about five rows of code. It’s nice if
you put different resolution icons in there. So people on different devices having the
ability to get them the best one. And then touch it and file intent.>>Nick: I don’t quite get what you mean by
link to other widgets.>>Rich: Mm. like the one by one settings.
Oh, do you think when you say, “settings” and then it says, “do you want settings for
this, this, or this, or this?” So, widget settings.>>Nick: Yes. Don’t know.>>Rich: Do we do that? I think we do. They
did it on [inaudible]>>Matt: [inaudible]>>Rich: Yeah. And if you drop it, it’ll say
then, yeah, so that’s just it.>>Nick: That’s just your configuration [inaudible]>>Rich: Yep. OK. Does he mean the folder–?>>Nick: Yeah, so basically the feature of
widgets which is when you picked it, and you add it to the home screen, you can optionally
then have a configuration setup. So, you supply this configuration activity. At which point
they can then pick what actually you wanted to stay on that widget. So that’s, so check
out the widget docs for that configuration info.>>Rich: Yes. Just in case they are actually
watching.>>Nick: And are there any [inaudible] docs
anywhere. Yes.>>Rich: [laughs]>>Nick: Are you?>>Sparky: So I did get one more questions
in the Moderator. Which said “Can you please look at this issue in the IssueTracker?” Which
I’ll go ahead and read. He says, um “I override getchildstaticstransformation to create my
own transformations according to locations. The child I am drawing every child worked
fine before Jellybean but fails when hardware acceleration is on.” Etcetera, etcetera. And
yeah, some canvas drawing operations are not supported in hardware acceleration. I don’t
know if this is one of them. But every time I’ve reported something like this to the guys
on the engineering team, the one who implemented it, usually Romain Guy, says, “Oh yeah, that’s
not supported in hardware acceleration. Just turn off hardware acceleration and use software
rendering.” So I would say, in cases like this, if software rendering is acceptable,
then just you know, bite the bullet and use that. Otherwise, we can look into it and see
if it’s a bug but it’s probably not a bug. So. It’s probably intentionally not hardware
accelerated, is my guess. Let’s see.>>Nick: Hey Al, how’s it going?>>Al: Hey guys, pretty good. I was trying
to join using a mobile device but was having no luck. So I thought I’d go back to the PC. [laughter]>>Nick: Aw.>>Rich: Oh dear. It’s a relatively new feature.>>Al: I could hear you guys but I couldn’t
see any video and couldn’t broadcast audio. Couldn’t broadcast video. But as you say,
it’s early days, so.>>Rich: Wow.>>Al: I did get one, uh, basically, more than
five second delay. So it was wanting to report a “application not responding.” So I put that
through. Hopefully things will get better. [laughter]>>Nick: [unintelligible] [laughter]>>Rich: Oh.>>Nick: You got any questions this week, Al,
or are you just hanging out?>>Al: I’m just hanging out. I’ve been playing
with the multi window stuff on the Samsung Note, so—>>Nick: Cool.>>Al: It’s, I’ve been doing a bit of delving
into it and it’s written in a way that potentially could appear in a future version of Android
if I guess all the legal guys work it out and it’s all deemed acceptable. So it could
be useful little bit of technology.>>Nick: So I’ve not actually tried it yet.
So this is in the Galaxy Note ten, one. Right? And you said it’s also present in the S three
which lets you have two apps on the screen at once, right?>>Al: Yeah, basically splits the ten inch
screen in two. So when you’ve got it in landscape mode, you can have one app on the left and
one app on the right. And they get equal spacing. But it’s only for a certain select few applications.
Which are part of the stock firmware. Um, the reason behind that, is there’s a lot of
private APIs that are used to firstly detect whether it’s, the functionality to do two
apps on the screen at once is present. And secondly actually to implement the switch
between the dual screen mode and single screen mode.>>Nick: So is it, well my concern is, it’s
not really a dual screen mode. It’s, one app that’s actually– [loud unintelligible talking from other hangout
participants]>>Al: Sorry Nick, I lost you there, mate.
I just got—>>Nick: So my concern, like I said I’ve not
played with it. But I’ve only seen, this is all based on the Burgess feature review of
the ten one note. It looked like one app was kind of paused and one app was kinda running.
So that if you tried to switch back and forth there’d be like a, I don’t know, what, you
kind of like unpause the other application, you run back to the other, had to unpause
that one, and—>>Al: It, from what I can see, the judder
doesn’t seem to be noticeable. It may be that only one is active at any one time and certainly
when dialogs pop up they can be modal dialogs. You can’t switch to the other app and leave
the modal dialog on one of them. It takes control of the whole screen. It’s, it may
be pausing it. I would suspect it is. But it’s nothing that’s sort of a severe judder
on most of the switches. I guess that’s something that they’ve sorted out recently. ‘Cause there
was one firmware update I’ve had for it so far.>>Rich: Interesting.
[Hangout dings]>>Nick: Well, I did see they are using the
Android name space. They’ve just gone right in there, and added the Android name space.>>Al: [laughs] Yeah, they’ve used Android.sec.
Samsung electrical corporation. So they’re trying to tuck it away in their own little
area. But the way it’s written, the actual multi window, window manager is very similar
to the window manager that already exists in Android. So my, from looking at the S3
firmware as well, it looks very much like they’re using this as a base part of all of
their Ice Cream Sandwich and Jellybean firmwares. And this is why I think it’s a potential for
being upstreamed and put into the IO SP at some point. Because the way it’s written,
it wouldn’t involve a lot of changes for most applications. To make use of it.>>Nick: Interesting. So, it makes an interesting
scenario is where an app going from a full window into a half window, like what new configuration
do they get notified.>>Rich: I assume it switches to portrait.>>Al: Yeah, it does. It does. It switches
to portrait. And it’s, it’s exactly the same as you’ve got, an orientation rotation. So
it’s–>>Nick: Yeah? It was the pad phone I guess
was one of the first devices that you know, had those quite drastic changes in configuration
and most apps just died. Don’t they? When you plug the phone into the tablet.>>Al: The Sony P series is exactly the same
thing. That’s the one with the two screens and the clamshell design. You’ve got a button
on the task bar which allows you to make apps on both screens or limited them to one. And
even stuff like Google Music was crashing originally. So, it’s there’s stuff to be wary
of. But from what I’ve seen of the framework stuff. And looking at some of the way they’ve
implemented it, it looks almost the same as any app would get, by being put on a phone
and twisted in orientation. So most apps, most well written apps, should be able to
handle it a lot easier than the kind of huge change in dimensions that was present when
you were using things like the P Series and the Pad Phone and stuff like that.>>Nick: Interesting.>>Al: Yeah, it will be interesting to see
how it goes.>>Rich: Were you just dissecting it first,
though?>>Al: I was. It’s one of those things that
I’ve been working with some devices that do TV’s and when you’ve got the space for a TV,
having two apps on the screen at once is quite possible. So it was interesting to see whether
it could be an Android driven device. And doing those two things on screen at once.>>Matt: IT would be interesting to see what
it does with intents. Like open intents have started becoming a lot more feasible, you
can then just start launching apps on the others. So it comes a part of your app and
then starts communicating on the same sort of basis. Like at the same time. Be kind of
cool.>>Al: It would be brilliant. At the moment,
all that happens is when you select multiscreen you get the drop down list of like five or
six apps. And you select which other one you want to go in the pane. So it’s limited like
that. But yeah. That would be a really cool—>>Nick: [inaudible] those apps are Samsung
Mail, Samsung Browser, not Gmail and Chrome.>>Al: The browser is actually the Android
stock browser with very small amount of tweaks. I did a quick comparison of some of the classes.
And most of the tweaks seem to be in the UI rather than anything more fundamental. And that’s literally because the way they’ve
implemented it, they’ve put in the action bar the button to go between multi-screen
and single screen mode, rather than making it part of the strip bar at the bottom where
the most of the buttons, most of the settings are.>>Nick: Well, it’s decompiling framework.Java
for fun and profit. [laughter]>>Nick: So I think that pretty much brings
us to the end of our time.>>Rich: Yeah. If we didn’t get to answer your
question today, but I think we got through most of them. Um, same time next week. Don’t
know if there’s anything special on next Wednesday? Um, thank you all for joining us today in
the hangout. And answering such, answering? Asking such good questions. [laughs]>>Matt: Thanks guys.>>Nick: Yep.>>Sparky: Answering, too.>>Matt: Cheers. Bye, everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *