Mark M. | has entered the room |
Mark M. | turned on guest access |
Oct 8 | 7:30 PM |
Tad F. | has entered the room |
Oct 8 | 7:35 PM |
Tad F. |
Hi Mark!
|
Mark M. |
hello, Tad!
|
Mark M. |
(sorry if there was a delay there -- I was distracted)
|
Mark M. |
how can I help you today?
|
Tad F. |
NP! Have a question for you about dynamically changing the title of my main screen fragment.
|
Tad F. |
I'm using the navigation components, so I believe it takes the value from the android:label value of the associated nav_host.xml file.
|
Tad F. |
I saw your post last year about defining more than one attribute, but my need is a bit different
|
Mark M. |
you mean https://stackoverflow.com/a/54504353/115145 ?
|
Mark M. |
'cause I was just gonna link to that :-)
|
Tad F. |
Basically, I want to be able to show the "long version" of my app name on devices that can handle it, and shorter one on devices that can't.
|
Tad F. |
Wow that's really impressive how fast you can reference that link
|
Tad F. |
How do you do that?
|
Mark M. |
in SO, in the top bar, there's your avatar and reputation score
|
Mark M. |
if you click that, it takes you to your profile... and fills in the search field to search your stuff
|
Mark M. |
so, in my case, it pre-fills in user:115145
|
Tad F. |
good to know!
|
Mark M. |
seriously handy for me to look up my past posts
|
Mark M. |
but, anyway, back to your problem...
|
Tad F. |
I'll bet - you must have in excess of 10k
|
Oct 8 | 7:40 PM |
Mark M. |
I haven't looked into this much since that post, as I haven't had a need for the Navigation component with my clients, and my book samples aren't that complex
|
Tad F. |
Yeah - so in keeping with the navigation components approach, how can I dynamically change it?
|
Mark M. |
but, unless you pass another argument with the preferred title bar, I think you're stuck with manual overrides in code
|
Tad F. |
Just doing a setTitle then?
|
Tad F. |
I'm ok with that what's the safe place to do it - onCreateView?
|
Mark M. |
yeah, though timing could get tricky, to ensure you come in after whatever Nav does
|
Mark M. |
to be honest, off the cuff, I'm not certain
|
Mark M. |
give me a minute to look up some stuff
|
Tad F. |
Another timing issue <sigh>. My app is a great case for how to juggle timing issues :). I've got webRTC going, pubnub signalling going, all sorts of stuff that can send events at any time causing changes in the app behavior. Amazing how this stuff starts to compound after a while.
|
Mark M. |
you can try onCreateView(), though I suspect that Nav comes in after that
|
Mark M. |
OnDestinationChangedListener might work, but that's for the whole NavController
|
Tad F. |
But setTitle is ultimately what I need to be dealing with, just at the right time, correct?
|
Mark M. |
yes
|
Mark M. |
assuming that you're using an action bar or Toolbar
|
Tad F. |
Yep
|
Oct 8 | 7:45 PM |
Tad F. |
Btw - I'm targeting 21 or greater, seems that catches the bulk at this point, agree?
|
Tad F. |
I was thinking of upping that to 23 (~85%), any opinion?
|
Mark M. |
21 is like 95% or so -- unless you're specifically targeting "emerging markets", you're probably fine
|
Mark M. |
if you're comfortable with 23, and your target audience isn't pre-disposed to older/cheaper devices, that's probably reasonable
|
Tad F. |
Not specifically, but there will be some users. Screen size on those devices will be an issue anyway, even if the app worked so...
|
Tad F. |
I mean the kind of devices running even 21 in emerging markets
|
Mark M. |
well, nothing much new should be shipping with either 5.0 or 6.0 at this point
|
Tad F. |
In those markets my biggest issue is bandwidth anyway
|
Mark M. |
yeah, that too is an issue
|
Tad F. |
And connectivity drops - I've spent a *lot of time* coding for network issues, et al, but still its an issue
|
Oct 8 | 7:50 PM |
Tad F. |
What are your thoughts on Room these days - should it be the standard for new apps?
|
Mark M. |
if you are using SQLite, Room or SQLDelight are the two leading options nowadays
|
Tad F. |
Is it mature enough to handle scale?
|
Mark M. |
scale in terms of... what?
|
Tad F. |
Users
|
Tad F. |
sorry -transactions
|
Mark M. |
how many users use a single phone? :-)
|
Tad F. |
on the device
|
Mark M. |
that's going to be more limited by SQLite than the wrapper around it, AFAIK
|
Mark M. |
SQLDelight is better if you want to think in terms of SQL, as it generates code from your SQL statements
|
Mark M. |
Room is better if you want to think in terms of objects, as it generates SQL from your classes
|
Tad F. |
Room for me.
|
Tad F. |
If/and when Realm doesn't do it for me
|
Tad F. |
Still so far, I'm pretty pleased with it
|
Tad F. |
I also really curious whether Flutter will end up sticking around, and Realm doesn't support it.
|
Mark M. |
Flutter isn't likely to vanish, though I'm also not certain how much bigger it will get
|
Oct 8 | 7:55 PM |
Tad F. |
Yeah - I have talked with some of the senior directors of engineering at fairly well known companies that have offices where I am and they are still sticking to native Android and native iOS development.
|
Mark M. |
in 2 years, I expect Jetpack Compose for Android/desktop/Web(?) and native iOS UI, using Kotlin/Multiplatform for common code, will be a contender
|
Tad F. |
Do you think Android wear has hit a plateau? Is it even relevant?
|
Mark M. |
"plateau" is a pretty good term for it
|
Oct 8 | 8:00 PM |
Mark M. |
another killer app for the wearable form factor could change the dynamic
|
Tad F. |
I mean, what devices are actually supporting it?
|
Tad F. |
I know samsung has something.
|
Mark M. |
actually, theirs are mostly Tizen IIRC
|
Tad F. |
But anything else?
|
Mark M. |
I haven't shopped for one recently, so while I see various brands (e.g., Fossil) mentioned in Android-related posts, I don't have a current lineup
|
Tad F. |
I've been trying to break into roku and firestick with my app - its tough.
|
Tad F. |
Apple seems to have cornered these other device types
|
Mark M. |
"firestick" meaning Amazon Fire TV Stick?
|
Tad F. |
y
|
Tad F. |
My target recipient audience is the elderly and mentally infrim
|
Tad F. |
infirm
|
Tad F. |
so the UI experience and what they have to do to enjoy it is critical
|
Tad F. |
And most know how to operate a TV
|
Tad F. |
most shy away from smart phones, social media, etc.
|
Tad F. |
too complicated
|
Tad F. |
But I've been trying to make the app for a "digital frame" (i.e. android tablet) super simple
|
Tad F. |
TV is a natural progression
|
Oct 8 | 8:05 PM |
Mark M. |
TV also has the advantage of being based on a remote
|
Mark M. |
I'm under the impression that motor control skills are a problem with touchscreens and the elderly, even with UIs designed for accessibility
|
Tad F. |
I read a hilarious article about what comcast went through when they were beta testing their voice controlled remote.
|
Tad F. |
Yes to the motor skills issue
|
Tad F. |
but even more - just the "connecting the dots" problem of what you have to do to get what you want.
|
Tad F. |
Regional language/slang comes into play in a big way, depending on the decade we are talking about.
|
Tad F. |
'Shoot a photo' - big no-no
|
Tad F. |
for example
|
Tad F. |
Anyway - as always, thanks so much for what you offer to the Android community - I'm gonna sign off now.
|
Oct 8 | 8:10 PM |
Mark M. |
happy to help!
|
Mark M. |
and, have a pleasant evening!
|
Oct 8 | 8:20 PM |
Tad F. | has left the room |
Oct 8 | 8:25 PM |
Mark M. | turned off guest access |