Office Hours — Today, April 9

Tuesday, April 7

Apr 9
7:20 PM
Mark M.
has entered the room
Mark M.
turned on guest access
7:30 PM
sudokai
has entered the room
Mark M.
hello, sudokai!
how can I help you today?
sudokai
Hi Mark!
7:35 PM
sudokai
I'm using Android Studio and can't access my app's internal storage directory
Using the Device File Explorer
Has this ever happened to you?
Mark M.
are you building a debug or a release build?
sudokai
I think it's a debug build
Mark M.
you can't view internal storage for release builds on hardware, which is why I asked
is this on a device or emulator that you are having trouble?
sudokai
Real device
I'm getting a permissions error
run-as: /data has wrong owner: 0/1000, not 1000
Mark M.
are you able to see any of internal storage? or, what specifically are you doing that is triggering that error?
sudokai
I'm going through the Explore Android book and I just wanted to take a peek inside the directory
But I'm not able to
Mark M.
OK, but, what did you click on (or right-click on, or something) that caused that error to display?
sudokai
For apps that I installed through Play Store, I get "run-as: package not debuggable: com.discord"
Mark M.
right, and that's a release build
sudokai
But for the todo app, I get "run-as: /data has wrong owner: 0/1000, not 1000"
7:40 PM
sudokai
So, I get to see data/data
and the list of apps
Then I double click on com.commonsware.todo
And I see this error
Mark M.
OK, that's new
it shows up in the same place as the "run-as: package not debuggable" message?
sudokai
I've tried both Android studio 3.6.2 and 4.0 beta, same thing on both IDEs
Yes, exactly!
Red text
Mark M.
what is the device?
sudokai
A Huawei Mate 20 (Android 10)
I know, one of the worst OEM manufacturers
Mark M.
yeah, I was going to say something like that
sudokai
Maybe it's related to some update of theirs
Mark M.
if I had to guess, it's a device issue
they also used to have this screwy system where you needed to get an account on one of their servers to be able to enable USB debugging
if that's still the case, it may be that this problem is a side-effect of that system
sudokai
I used to be able to see the files when connecting the same device to a Linux workstation
Mark M.
that's interesting -- what OS are you trying now?
sudokai
But now everyone is quarantined and from my home macbook, it doesn't work
Mark M.
hmmm... I would have expected similar results there
had you said "Windows", there might be a driver issue
7:45 PM
sudokai
Again, they might have changed the behavior in a recent OS update, but I'm not really sure because they update the phone overnight and sometimes you don't see any update notifications
Mark M.
yuck
sudokai
It's all done transparently
Mark M.
there's a difference between "transparently" and "behind your back" :-)
sudokai
I saw a single Stackoverflow questions with the exact problem
But no answers
from February 2020
You've never seen this before, have you?
Mark M.
no
now, I happen to run Linux
sudokai
Well, I'll definitely check again with Linux when I get to go to the office
Mark M.
and I don't test on Huawei hardware other than Nexus models they made (6P, IIRC)
sudokai
I did manage to get WiFi debugging working on this device though :)
Mark M.
well, that's a plus
though that does raise a question: have you tried your scenario with a USB cable, or only over WiFi?
sudokai
I tried it with a USB cable
Yes, because the new modern phones don't have a headphone jack, only the usb c connector
Mark M.
OK -- the WiFi debugging was just unusual enough that I figured it was worth checking
sudokai
So it was annoying not being able to use your headphones when your phone was plugged in for debugging
7:50 PM
Mark M.
in my case, I've acquired a lot of hardware, so my "daily driver" device isn't the one I usually test with
(unless I need a test with that specific model)
sudokai
What kind of devices do you test on usually?
Manufacturers? Android versions?
Mark M.
usually a Pixel for day-to-day stuff
and I have a lineup of Samsungs, LGs, and Nokia when I want to try other scenarios (OS version, screen dimensions, etc.)
but, overall, I have ~60 devices
sudokai
Anything unusual you've seen? Like oh, I always need to test with a Samsung phone because of X
Oh wow
That's a looot!
Mark M.
I can't say that I have categories of problems that I need to test on certain manufacturers' hardware
but, for example, one of my Nokia devices is an Android One device
and a couple have notches or pinholes for the front-facing camera
sudokai
You must have spent a fortune acquiring them
Mark M.
yes, but they are business expenses, so...
sudokai
Oh, notches!
Mark M.
it used to be that I was acquiring hardware specifically to test cameras, back when I maintained camera libraries
since I got out of that, more of my purchases have been for those specific sorts of hardware things, in case I needed them
7:55 PM
Mark M.
so, a recent purchase was a Samsung Galaxy A50, as it has an in-screen fingerprint reader
sudokai
So before releasing an app, you go through all those devices?
Mark M.
well, I don't release apps personally too much -- my client has that job
(for whoever my consulting client is at the time)
most of the testing is actually for the books and blog posts and stuff
but, I will try my clients' apps on different hardware where I anticipate problems
or, for variety
sudokai
I finished Explore Android. Very nice book.
Mark M.
thanks!
sudokai
I like your iterative style.
Mark M.
that book (and its predecessors) is a pain to maintain
sudokai
Also, I don't CTRL C and CTRL V. Rather I type the code in.
Old school.
:)
Mark M.
perfectly reasonable
sudokai
I find that it really helps
I've looked for different learning materials
and books like Explore Android are the ones that suit me best. Iterate and then incrementally understand the process, while doing something end to end.
I find most video lessons very slow and not even well explained.
Mark M.
I've had that sort of step-by-step materials for a long time, mostly stemming from when I teach Android app development live
sudokai
I'm all the time like, just show me an example. I can read code!
8:00 PM
Mark M.
on the other hand, there are lots of developers today who would not dream of reading a programming book
different people have different approaches that they prefer
sudokai
I also like the fact that you use the latest libraries and techniques
Mark M.
yeah, I'm updating *Exploring Android* now for Android Studio 3.6
sudokai
There's nothing more offputting imo, than getting the sample and spending at least 30 min trying to fix all the compilation problems
I saw that Udacity is still teaching RecyclerView with the Android Support Library
All Java, no Kotlin
Mark M.
those sorts of training videos are *really* a pain to maintain
which is why a lot of places don't do it
sudokai
That's something that really irks me. Like, I'm learning and what I'm learning is already deprecated.
Did you see they are changing the onActivityResult stuff?
Mark M.
you mean with the ActivityResult class (or whatever it's called -- I forget the name)
sudokai
no the callback
there's a new way to do it, but it hasn't made it into stable yet
Mark M.
there's a whole family of ActivityResult* classes
sudokai
but the docs have been changed
8:05 PM
sudokai
"While the underlying startActivityForResult() and onActivityResult() APIs are available on the Activity class on all API levels, it is strongly recommended to use the Activity Result APIs introduced in AndroidX Activity 1.2.0-alpha02 and Fragment 1.3.0-alpha02."
Mark M.
yeah, Gogole advocating alpha libraries grates on my nerves
(er, "Google", not "Gogole")
sudokai
Well, I like the new way :)
Mark M.
oh, it's almost certainly an improvement
at the same time, newcomers shouldn't be using alpha-grade Google code
sudokai
Yeah, they are also promoting the heck out of the Firebase beta libraries
Even sent a newsletter
Btw, back to the topic of phone manufacturers for a moment, you know these manufacturers, like Huawei, that kill background apps... Anything you can do about it as a developer?
It seems like there's nothing you can do.
Mark M.
other than drown your sorrows in your beverage of choice, AFAIK, there is little that you can do
I've gotten to the point of trying to steer developers away from background processing
sudokai
They kill your app when the screen is off for a few minutes
Foreground services, whatever
They don't care.
8:10 PM
Mark M.
yeah, they got on a serious battery-savings kick ~3 years ago
and that's when all those sorts of things started in
based on all the reports I've seen
sudokai
I really wish Google would do something about this.
Because users always blame the app makers.
Mark M.
I wouldn't rule out Google trying to constrain how bad this gets, but I wouldn't count on it, either
sudokai
I know it's a lot of work to maintain the books, but man, The Busy Coder's Guide is a life-saver
8:15 PM
Mark M.
it has a lot of depth, though for core stuff it's starting to show its age
sudokai
Do you plan to migrate more stuff over there to Elements of Jetpack?
Mark M.
not much
I want *Elements of Android Jetpack* to remain a reasonable size
so, there's lots of things in *The Busy Coder's Guide* that are unlikely to get revisited
sudokai
I mean, I really like the fact that you can find almost anything there
Mark M.
part of the problem is that I can't spend time on the books the way that I used to
sudokai
Oh that's a shame!
Mark M.
writing *The Busy Coder's Guide* and teaching classes was literally my full time (plus) job
however, book sales have fallen off, and corporate training has as well
so, I do more consulting and similar sorts of contract work
which leaves less time for the books
sudokai
I'm sorry to hear that. As I said before, maybe charge more?
I see all sorts of subscription sites that charge 20 dollars per month
8:20 PM
sudokai
For those video lessons we talked about before. Udacity's nanodegrees? Way more expensive.
Mark M.
at this point, particularly for a book-centric offering, I don't think I can charge anywhere near those prices
the difference between the early years and now is partly the change in format (more videos) and partly the fact that Android has matured a lot so there's a ton of blog posts and stuff
sudokai
I mean, take any Manning book, they are not even updated or mantained once released
They charge you 50 bucks
Same with OReilly
Few video courses are worth it
I took the beginner Android course on RayWenderlich. 2.5h of videos and they teach you to make a single activity with one button and onRestoreInstanceState for rotations.
Mark M.
that's... slow
sudokai
Well, the Udacity courses are not any better
8:25 PM
sudokai
Tbh, I think there's a big hole in the Android training market
I see way more quality stuff for web development
Mark M.
yes, though I haven't figured out a pricing and delivery model that I like, other than classic corporate on-site training
and that particular segment may take ages to recover from COVID-19
sudokai
In webdev, the golden standard of video training is Laracasts by Jeffrey Way.
Jeffrey Way absolutely nails it and he has years and years of content.
But nothing even close to that for Android.
That's how I actually ended up finding your books.
Mark M.
through Laracasts?
sudokai
No no, I mean
I exhausted my search and still couldn't find anything
Then I saw your books and I thought, well, who knows if they are okay, but 20 dollars is really cheap so what the hell
:D
Turned out to be top quality
Mark M.
thanks!
8:30 PM
Mark M.
tell your friends!
:-)
sudokai
Okay, sure!
I think people are afraid of books
Because 1. there are a lot of words
2. A lot of them, if not most, are outdated
I've been burned so many times by Manning and OReilly
Elasticsearch in Action. The day the book came out, none of the sample code worked.
Because weeks before, a major version of Elasticsearch had been relesed.
Mark M.
classic print publishing lead times are a problem
sudokai
I think Explore Android is the sweet spot.
For learning.
Then The Busy Guide for reference.
Like I need to work with NFC. Okay, I got a chapter on that.
Mark M.
that chapter hopefully holds up, but I probably have not touched it in 5 years
sudokai
Well, I don't mind sending you emails if I find anything out of date.
Mark M.
on the whole, consider *The Busy Coder's Guide* to be something to set you in a direction to go, but there may be some adjustments needed
8:35 PM
Mark M.
though in NFC, the only thing I can think of is that Android Beam got dropped
so the APIs that I discuss should still be fairly relevant
sudokai
btw, I think there's another instance of the same errata I sent you a while back
Towards the end of Explore Android
viewLifecycleOwner
Do you remember?
Mark M.
I remember you pointing out a bug where I missed using it
sudokai
I'll try to find the exact page
Yes, so there's another place
Where instead of using viewLifecycleOwner, you use this
Mark M.
OK, I'll keep an eye out for it as I go through the current round of revisions
the problem is that "this" compiles so nicely... :-)
sudokai
Well, I get a nice red lint error
Anyway, I think I gtg. Talk to you next time Mark! I'll try to find this page on the book.
Mark M.
thanks!
and have a pleasant day!
sudokai
You too!
sudokai
has left the room
Mark M.
turned off guest access

Tuesday, April 7

 

Office Hours

People in this transcript

  • Mark Murphy
  • sudokai