Apr 25 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 25 | 4:00 PM |
Kai H. | has entered the room |
Apr 25 | 4:05 PM |
Mark M. |
hello, Kai!
|
Kai H. |
Hello there
|
Mark M. |
how can I help you today?
|
Kai H. |
I have no question right now
|
Mark M. |
ah, OK
|
Mark M. |
if you come up with a question, ask away!
|
Kai H. |
Sure :)
|
Apr 25 | 4:15 PM |
sudokai | has entered the room |
Kai H. |
:D
|
sudokai |
Hi :)
|
Mark M. |
hello, sudokai!
|
Kai H. |
Hi
|
Mark M. |
sudokai: how can I help you today?
|
sudokai |
Hi Mark, do you know how often do Android phones check for app updates?
|
sudokai |
I swear I saw it's every 12h, but I can't find the source
|
Mark M. |
I have no idea, sorry
|
Mark M. |
and it would not surprise me if it varies by manufacturer
|
sudokai |
I'm referring to Google Play Store updates
|
Mark M. |
oh, wait, sorry, I misread your question
|
Mark M. |
I don't know much about the mechanics of that
|
Mark M. |
it's entirely possible that it is more of a push, rather than a poll
|
Mark M. |
Google knows what apps you have installed, after all
|
sudokai |
When I was looking into Play Store staged rollouts, I swear I saw this 12h interval somewhere, but I can't find it.
|
Mark M. |
so, they could use the same engine that powers Firebase Cloud Messaging to tell the device that an update is available
|
Mark M. |
my clients handle their own Play Store distribution, and I haven't shipped something of my own on the Play Store in years
|
Apr 25 | 4:20 PM |
Mark M. |
so I don't have much hands-on experience with that aspect of the overall process -- sorry!
|
Apr 25 | 4:20 PM |
sudokai |
It's alright, thanks anyway!
|
Apr 25 | 4:25 PM |
Mark M. |
if either of you come up with a question, go right ahead!
|
Apr 25 | 4:30 PM |
sudokai |
Not a question, but I had a lot of trouble subscribing to your Jetpack Compose newsletter
|
Mark M. |
what sort of trouble?
|
Mark M. |
I know of at least one person who was having difficulty getting getrevue.co to load
|
Apr 25 | 4:35 PM |
sudokai |
Toubles with the iframe
|
Mark M. |
meaning that the content would not load in the iframe?
|
sudokai |
So I went to https://jetc.dev/ and when I entered my email and clicked submit, the iframe gave some sort of security error
|
sudokai |
"Refused to display 'https://www.getrevue.co/profile/jetc' in a frame because it set 'X-Frame-Options' to 'sameorigin'."
|
sudokai | |
sudokai |
Oh wow, the url is being stripped by the chat
|
Mark M. |
they must have changed their site settings and don't support iframe
|
Mark M. |
crap
|
sudokai |
Between the single quotes in the error above, it's 'https www.getrevue.co/profile/jetc'
|
Mark M. |
yeah, I can reproduce it here
|
Mark M. |
this used to work
|
Mark M. |
I'll work on coming up with some other solution tomorrow
|
Mark M. |
thanks for mentioning it!
|
sudokai |
I do have another question, now I remember it!
|
Apr 25 | 4:40 PM |
sudokai |
Do you recommend using ConstraintLayout everywhere or is there some situation where another layout would be more performant?
|
Mark M. |
for trivial stuff (e.g., where you just need a background and some padding), I'd use FrameLayout
|
Mark M. |
I tend to use ConstraintLayout for pretty much everything else
|
Mark M. |
I do not know if any scenarios where ConstraintLayout is slower than, say, a bunch of nested LinearLayouts
|
Mark M. |
(sorry, that should have been "know of any scenarios")
|
sudokai |
I mean, common sense makes me think that ConstraintLayouts may not be that performant as they claim it to be. It has to perform many calculations.
|
Mark M. |
you'
|
Mark M. |
you're assuming the others don't, though
|
Mark M. |
a bunch of nested LinearLayouts will require many calculations as well, just spread over N containers
|
sudokai |
Yeah, but as you said, nesting ConstraintLayouts might be bad right?
|
Mark M. |
I'd avoid it unless you have a concrete need for it
|
Mark M. |
if your design requires it, then you don't really have a lot of choice
|
Mark M. |
and that's not strictly a ConstraintLayout-holding-ConstraintLayout problem
|
sudokai |
So you would only use the ConstraintLayout for the outer container
|
sudokai |
?
|
Mark M. |
I'd use what I need to use :-)
|
sudokai |
:)
|
Apr 25 | 4:45 PM |
Mark M. |
the only reason I can think of off the top of my head to need to nest a container in a ConstraintLayout is because the container itself has visible properties, such as a background
|
Mark M. |
if the nested container itself has no such properties, you should be able to avoid nesting containers, relying just on ConstraintLayout rules plus virtual helpers (e.g., Barrier)
|
Mark M. |
if the nested container does have visible properties, and it only needs one child, use a FrameLayout as the nested container
|
sudokai |
Well, I have a small component that's a custom view
|
sudokai |
That uses ConstraintLayout
|
Mark M. |
presumably, it has more than one child view
|
sudokai |
Then this custom view is inserted dozens of times in a fragment
|
sudokai |
That uses ConstraintLayout
|
Mark M. |
dozens?
|
Mark M. |
do you have screen space for dozens?
|
sudokai | |
Mark M. |
that's not strictly a problem
|
Mark M. |
after all, we use ConstraintLayout for rows in a RecyclerView all the time
|
sudokai |
Well, dozens in plural might be an overstatement, but 1 dozen yes
|
sudokai |
Okay thanks
|
Mark M. |
and usually performance, from a layout standpoint, is only an issue in scrolling
|
Apr 25 | 4:50 PM |
Mark M. |
so, items in a RecyclerView need to render cheaply, so when the user scrolls the list/grid/whatever, it scrolls smooothly
|
sudokai |
Coming from the web world, I find the Android tooling for this stuff lacking tbh
|
Mark M. |
what is "this stuff", specifically?
|
sudokai |
This UI stuff
|
Mark M. |
um, that wasn't very specific :-)
|
sudokai |
I mean, for a website, scrolling is not a problem unless you do something horribly wrong
|
Mark M. |
sure it is
|
Mark M. |
you paid the price when you loaded the page, though, more than likely
|
sudokai |
You don't need to do this fancy recycling stuff unless you need to be Google Photos
|
sudokai |
Btw, on the topic of UI, do you know of any good resources on building custom UI components for Android? Could be a link, articles, books, etc.? Anything.
|
Apr 25 | 4:55 PM |
Mark M. |
there's a chapter on it in *The Busy Coder's Guide to Android Development*
|
Mark M. |
I don't have any links handy for anything else
|
Mark M. |
on the whole, creating custom views isn't that common
|
Mark M. | |
sudokai |
Thanks. It's because I think I have a big knowledge gap to cover.
|
Mark M. |
it's a bit old, and isn't as in-depth as it could be, but it's all I have
|
sudokai |
I'm able to put premade stuff together, like Material Components
|
Mark M. |
and that's what the vast majority of developers do
|
Mark M. |
roughly speaking, there are two main scenarios for doing something other than that:
|
sudokai |
But then I go to Play Store and I see apps with beautiful, custom UI
|
Mark M. |
1. you want to reuse the custom view across multiple projects, including things like releasing it as open source, which is all fine
|
Mark M. |
2. you are trying to make domain-specific custom views (e.g., a RestaurantView), which isn't really how Android development usually works
|
Mark M. |
"beautiful, custom UI" does not necessarily mean custom views, though it could
|
Apr 25 | 5:00 PM |
sudokai |
Okay, thanks I'll read your chapter
|
Mark M. |
a lot can be accomplished with the stock views, coupled with styles, themes, drawables, etc.
|
sudokai |
Maybe it's my lack of experience, but I find web styling much more straightforward
|
sudokai |
Just throw some CSS on top of your HTML
|
sudokai |
You can do anything easily
|
Mark M. |
Android styles and themes have a lot in common with CSS, but they were not well-documented in the early years
|
Mark M. |
even today, it's lacking
|
Mark M. |
anyway, that's a wrap for today's chat
|
Mark M. |
the next chat is Tuesday at 7:30pm US Eastern
|
sudokai |
Thank you!
|
Mark M. |
have a pleasant day, and stay healthy!
|
sudokai |
You too!
|
Kai H. | has left the room |
sudokai | has left the room |
Mark M. | turned off guest access |