Office Hours — Today, March 31

Thursday, March 29

Mar 31
3:50 PM
Mark M.
has entered the room
3:55 PM
Mark M.
turned on guest access
Steve S.
has entered the room
Steve S.
hi, Mark!
Mark M.
hello, Steve!
how can I help you today?
Steve S.
Let me paste in a question:
Is there a simple way to block access to system options (i.e. prevent expanding status bar)?
Mark M.
um, I think there's some stuff in the kiosk mode options added in Android 5.0
I have never experimented with them
Steve S.
what about prior to 5.0?
Mark M.
but IIRC pinned apps limit the user's ability to navigate elsewhere
and prior to 5.0, there's nothing, other than hacks or custom firmware
Steve S.
ok
Another question:
Can I start a started service from an IntentService subclass?
Mark M.
sure, at least prior to Android 8.0
on Android 8.0+, the standard "can I start things from the background" limits still apply
if the started service will be a foreground service, you can use startForegroundService() from the IntentService on 8.0+
4:00 PM
Steve S.
ok. we're using 4.3
Mark M.
that's, um, old
Steve S.
yes
Mark M.
as in, "OMG think of all the security flaws"-type old
Steve S.
we need to find older devices since they're cheaper (we supply the devices for our application)
is there a more recent but still older version that we should aim for (e.g. 5.0)?
Mark M.
um, I can't really answer that
Steve S.
ok
Mark M.
I would phrase it more as "buy the newest thing that you can within budget"
Steve S.
sure
Mark M.
I mean, you can get a new ZTE Android 8.0 device for $80
admittedly, that's just coming onto the market now
getting Android One devices like that previously required more work
Steve S.
great, thanks
4:05 PM
Steve S.
we're limited in what we can use since we need tablets with a specific form factor to fit in the coffee brewer we sell
but i'll discuss this with the powers that be
Mark M.
well, that ZTE is a phone
for tablets, buy Fire tablets by the carton, or something :-)
Steve S.
we're using Samsung T110/T113, but maybe that's a better choice
Mark M.
if you are a manufacturer, or even a distributor, distributing unmaintainable hardware has legal implications beyond customer satisfaction ones
Steve S.
ok
because of things like security flaws?
Mark M.
yes
Steve S.
ok
Mark M.
now, if you are using old hardware but are loading on some third-party OS (e.g., LineageOS) that is continuing to get updates, that may be OK
though I would expect that to be newer than 4.3
4:10 PM
Steve S.
ok
regarding starting the service from the IntentService: should I use the application context rather than the context of the IntentService?
Mark M.
doesn't matter
Steve S.
ok
Mark M.
so, you may as well just use the IntentService itself -- saves you a method call
and ~20 characters of code :-)
Steve S.
so the service doesn't hold on to the context passed in when it's started (which could lead to a memory leak)?
Mark M.
no
Steve S.
very helpful
Mark M.
no more than Activity B holds onto a reference to Activity A when A starts B
Steve S.
ok
Mark M.
that sort of component-starting-a-component scenarios do not involve long-lived Context objects
(other than the life of whatever component is being created, of course)
Steve S.
ok
no more questions today
thank you so much, Mark!
Mark M.
you're very welcome!
Steve S.
have a great rest of the day!
Mark M.
you too!
Steve S.
has left the room
4:20 PM
Janice
has entered the room
Mark M.
hello, Janice!
how can I help you today?
Janice
Hi Mark
Working with Room. Have another best practices question.
Mark M.
I don't know if we know enough about Room to declare "best practices" :-)
but, I can try to help
Janice
One activity needs a list of all records in database. Another activity needs only a partial list. I know two ViewModels should be created (one for each ui component), but should there be two repositories?
Mark M.
probably not
Janice
What I was thinking. If I understand, the repository should be the sole API, yes?
Mark M.
sole API for accessing the backing store, yes
right now, that backing store is Room (or, it will be, if that's yet to be written)
Janice
Perfect. Exactly what I needed. Thank you!
Mark M.
tomorrow, that backing store might be something else
ideally, the UI layer, along with its ViewModels, neither knows nor cares about those pesky details
4:25 PM
Janice
View paste
Yes, also what I was thinking, but it helps to have the confirmation.  So thank you for that. 
 Using all of the different abstraction layers gets a little fuzzy when one actually starts implementing.
Bye Mark. thank you again.
Mark M.
you're welcome!
4:40 PM
Janice
has left the room
5:00 PM
Mark M.
turned off guest access

Thursday, March 29

 

Office Hours

People in this transcript

  • Janice
  • Mark Murphy
  • Steve S