DAN GALPIN: Hello!
We're back with #AskAndroid.
And we'd like to welcome Kenneth Ford and Neto Marin
to the next session of the livestream.
Now, Kenneth is a developer advocate
for Chrome OS, also focused on foldables, while Neto
is a regional DA and a Latam expert based in Brazil,
and he's also an expert on Android TV
and things like billing and other stuff.
NETO MARIN: Sure.
LYLA FUJIWARA: OK.
So if you couldn't see from the way
that we described our guests, we are
talking about form factors, which
includes things like Auto, Wear, TV, Foldables, Chrome OS.
And that is a bunch of topics.
So we're going to try to do our best to get your questions.
Again, if you have questions, just use the #AskAndroid
in either the livestream or on Twitter,
and we will try to get to those.
So, Dan, do you have a first question?
DAN GALPIN: Sure, sure.
So I guess this is a question that's probably
on the mind of a lot of developers,
but why or when should you care about using all
these different form factors?
KENNETH FORD: So I think when you
talk about Chrome OS and foldables and tablets,
it really just comes into what kind of experiences
can you bring to your users that are different from on a phone.
And if you feel like those are valuable,
then that's kind of when you should
think about actually targeting these kind
of different devices.
DAN GALPIN: And developers actually have a lot of success
with apps on Chrome OS.
It may not be something you think about,
but developers are building whole business built
on getting these apps to work really well in these large form
factor devices.
KENNETH FORD: And we see increased engagement rates
and stuff like that, because these devices are meant
for longer experiences, more kind of in-depth usage
patterns, and things like that.
NETO MARIN: And the same for TV, because you
need a very specific experience, because you're
using a remote control and not using your fingers to touch
and everything.
So if you are thinking about onboard and TV--
and for example, in some regions, TV,
the house is built around TV.
So there you have the family, the family room.
So you need a really good experience.
DAN GALPIN: Yeah, I know people who
watch their TV all the time.
[LAUGHTER]
NETO MARIN: I have two daughters, two small daughers.
LYLA FUJIWARA: Some people out there
might be watching their TV.
NETO MARIN: Thanks for watching.
LYLA FUJIWARA: Yeah, thanks for watching.
OK, so another question that we get
a lot is, do you need a separate APK for different form factors?
KENNETH FORD: So for things like mobile phones, foldables,
Chrome OS, and these kind of Android-based desktop
environments, it's all the same APK.
I think you have more information
on the TV APKs and stuff.
NETO MARIN: Yeah, you have two options.
If you are using App Bundles, you
can have just the same APK with the bundles,
because it's not actually an APK.
It's the bundle that the Play Store will deliver.
But if you are not using the App Bundle,
then you need a different APK.
And a good thing to measure is that the version number
must be always higher than the mobile version number,
because if you update your mobile with the higher version
number, the TV will get this mobile version.
It can mess up with your application.
So yes, you need the multiple APKs
if you are not using bundle and a higher version number
for TVs.
DAN GALPIN: The best answer is just use the App Bundle.
LYLA FUJIWARA: Yeah.
NETO MARIN: Please.
KENNETH FORD: Well, about that, most Chrome OS devices
are x86 architecture.
And they're different densities a lot of times
than most phones.
So App Bundles really allows you to ship a substantially smaller
APK specifically for using native code.
LYLA FUJIWARA: OK, cool.
So-- yeah.
KENNETH FORD: Use App Bundles.
LYLA FUJIWARA: Yeah.
NETO MARIN: Yeah, the same for TV, because you have 4K,
full HD.
You have different resources.
And they are big in this case.
LYLA FUJIWARA: And App Bundles just sort of takes care
of all that complexity for you.
NETO MARIN: Please use the bundle.
Exactly.
LYLA FUJIWARA: All right, cool.
DAN GALPIN: So one of the questions
that came in from the Twitter stream
is-- and I don't if we can really answer this,
but it's kind of a fun question.
So why does Android TV have the model view presenter
pattern in Leanback?
And is there any way to upgrade it?
It's really hard to design for things like MVVM.
NETO MARIN: Yeah, yeah.
It's because the way we have it on TV-- because it's
a simplified pattern if you think about for presenting
media content, because the Android TV apps,
they are more focused around media content.
So when you have the model, you get your information
about this stream.
Then you have the view that is specifically
about how you display this on TV and the presenter,
is because you're taking care about the media transmitter,
the stream, et cetera.
So in this case, we thought that it's a easier way
to start doing Android TV apps.
But yes, we continue to work in our libraries,
and probably are going to have something
in the future updating according to the community feedback.
And if you have a feedback, send it to us.
Yeah.
Because it's important to know how developers are using
and what their demands.
This is how, for example, our components was born, right?
DAN GALPIN: Yeah, exactly.
NETO MARIN: So you heard the feedback.
LYLA FUJIWARA: So you just mentioned,
if you have feedback, send it to us.
What is the way that you like getting feedback?
NETO MARIN: Well, we have the @AndroidDev Twitter handle.
You can send to one of the DAs, so @NetoMarin.
But you also can send to--
LYLA FUJIWARA: DM Neto.
NETO MARIN: Yeah, yeah.
But there is a bug tracker, so you can open a issue there
and put your feedback there.
LYLA FUJIWARA: OK, so a Twitter handle,
a bug tracker are good ways to get some--
NETO MARIN: And if it's something with the samples--
DAN GALPIN: Yeah, Github.
NETO MARIN: --you always can use the Github
issues to register that.
DAN GALPIN: Yeah, or send us PRs.
LYLA FUJIWARA: OK, so Avi12641 asks,
what is the best and easiest way to optimize
the app for all screen sizes?
KENNETH FORD: So I think a lot of that really just comes down
to building out different layouts
and finding ways of taking advantage
of the different screen sizes.
So making sure you have layout files
for kind of all the different screen
sizes that you feel like your product should change at,
and then really caring about, at the larger screen you generally
get to, the more landscape-first it is.
So just thinking about kind of not only how your layouts work
in portrait, but also kind of testing landscape and rotation
changes and things like that.
DAN GALPIN: Is there any recommendation
around, like, art assets and things like that if you're
dealing with larger screens?
KENNETH FORD: You should think about not only the screen size,
but maybe how far away the person is
going to be from the display.
So on a phone, it's usually really close,
where on a laptop or something, you're
a little bit further away.
So just thinking about maybe you should scale these assets up,
provide bigger assets.
And really, it comes down to testing
on these different devices, because that's really
where you'll see for your product and your app kind
of what kind of breaks down.
NETO MARIN: And also, think about the navigation.
Also on TV and this kind of device,
sometimes, even though you are using it on the laptop,
we don't want to touch, for example, where you use
the keyboard or the navigation.
So pay attention to the navigation
is also very important, and for TV is even more important,
because people are, again, using remote,
using other ways to control that.
DAN GALPIN: We talked a little bit about this
in our session, too, of bottom nav bar kind of breaks
down as you get to wider screens,
and so thinking about how you can pull it out
to a left side nav or something like that,
just to give people a more intuitive experience
that they're used to on these kind of devices.
LYLA FUJIWARA: So you mentioned your session.
Do you want to give some key points
that you went over in the session,
or maybe why folks should watch if they
haven't watched it already?
KENNETH FORD: So really, the thing
we drilled in our entire session is just
handling configuration changes.
You can't really run away from them anymore.
You can't really just lock the portrait
and move on and not worry about saving
state and things like that.
If there's one key point that we can kind of take away
from that talk is handle configuration changes.
And we talk a lot about what configuration changes you'll
see, whether it's folding a device, resizing it,
and things like that.
So if you kind of want more information
on what to look for, we talk quite a bit
about that in our session.
DAN GALPIN: Yeah, I was going to say also,
the speed of handling configuration changes
becomes really important, especially when you're
on a Chrome OS device and people are
trying to resize the window.
Do you want to ask that one?
Does that sound--
LYLA FUJIWARA: Yeah, sure.
So Adrian asks, should the multiple form factors
be used to continue a user's experience or as
a standalone experience independent of each other?
KENNETH FORD: I think it depends on what form
factors you're talking about.
So I think TV is probably a pretty separate experience.
NETO MARIN: Yeah.
It's totally different.
OK, again, repeating, you use a remote or sometimes
they're using the Google Assistant to ask for something.
So the experience is totally different.
KENNETH FORD: And something that we talk about in our session,
too, is just from a desktop to a phone or a foldable,
in that world, it should be the same kind of experience,
but think about how you can surface
more options and things like that for a specific context.
DAN GALPIN: All right.
Well, I think that's all the time we have.
So thanks, Kenneth and Neto, for all your form factor insights.
And thank you, Android community,
for submitting great questions.
Make sure to check out our guide on developer.android.com
for more about targeting your app to different form factors,
and of course, catch the rebroadcast of their talk.
[MUSIC PLAYING]