Mar 31 | 3:50 PM |
Mark M. | has entered the room |
Mar 31 | 3:55 PM |
Mark M. | turned on guest access |
Steve S. | has entered the room |
Steve S. |
hi, Mark!
|
Mark M. |
hello, Steve!
|
Mark M. |
how can I help you today?
|
Steve S. |
Let me paste in a question:
|
Steve S. |
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
|
Mark M. |
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
|
Mark M. |
and prior to 5.0, there's nothing, other than hacks or custom firmware
|
Steve S. |
ok
|
Steve S. |
Another question:
|
Steve S. |
Can I start a started service from an IntentService subclass?
|
Mark M. |
sure, at least prior to Android 8.0
|
Mark M. |
on Android 8.0+, the standard "can I start things from the background" limits still apply
|
Mark M. |
if the started service will be a foreground service, you can use startForegroundService() from the IntentService on 8.0+
|
Mar 31 | 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)
|
Steve S. |
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
|
Mark M. | |
Mark M. |
admittedly, that's just coming onto the market now
|
Mark M. |
getting Android One devices like that previously required more work
|
Steve S. |
great, thanks
|
Mar 31 | 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
|
Steve S. |
but i'll discuss this with the powers that be
|
Mark M. |
well, that ZTE is a phone
|
Mark M. |
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
|
Steve S. |
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
|
Mark M. |
though I would expect that to be newer than 4.3
|
Mar 31 | 4:10 PM |
Steve S. |
ok
|
Steve S. |
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
|
Mark M. |
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
|
Mark M. |
(other than the life of whatever component is being created, of course)
|
Steve S. |
ok
|
Steve S. |
no more questions today
|
Steve S. |
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 |
Mar 31 | 4:20 PM |
Janice | has entered the room |
Mark M. |
hello, Janice!
|
Mark M. |
how can I help you today?
|
Janice |
Hi Mark
|
Janice |
Working with Room. Have another best practices question.
|
Mark M. |
I don't know if we know enough about Room to declare "best practices" :-)
|
Mark M. |
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
|
Mark M. |
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
|
Mark M. |
ideally, the UI layer, along with its ViewModels, neither knows nor cares about those pesky details
|
Mar 31 | 4:25 PM |
Janice |
View paste
|
Janice |
Bye Mark. thank you again.
|
Mark M. |
you're welcome!
|
Mar 31 | 4:40 PM |
Janice | has left the room |
Mar 31 | 5:00 PM |
Mark M. | turned off guest access |