Office Hours — Today, April 6

Saturday, April 3

Apr 6
8:20 AM
Mark M.
has entered the room
Mark M.
turned on guest access
8:30 AM
Dmitry Y.
has entered the room
Dmitry Y.
Hello!
Mark M.
hello, Dmitry!
how can I help you today?
Dmitry Y.
Actually, I met the same problem as always. I was waiting for a chat 3 days. And found solutions for all problems by myself :)
Even if all of them were not simple for sure.
Mark M.
I'm glad that you got past those problems!
Dmitry Y.
View paste
I discussed with you the process management, my accessibility service was killed by the system. THe issue was on Xiaomi devices. 
There is a `clean up` button in their task manager. When the user clicks on it, the accessibility service was terminated together with the process of the app. And only rebooting the device could help
Mark M.
ah, yes, I remember that
8:35 AM
Dmitry Y.
I was looking for separating the processes - but it didn't help. Accessibility service didn't start when I set `isolatedProcess` to True. Or even when I just set `process` name in the manifest file
Mark M.
I am surprised that the android:process did not work, but I have little experience with AccessibilityService
Dmitry Y.
But I found out that TalkBack Accessibility service is not terminated by the system. So I found its source code in Github, and checked the settings of the accessibility service in the project.
Leora
has entered the room
Mark M.
hello, Leora!
Leora
Hi Mark! I'm on time :)
Mark M.
Dmitry: I can take a question from you if you have one; if not, I should let Leora ask a question
Leora
Hi Dmitry!
Dmitry Y.
View paste
And what do you think was an issue :) Suprising but: The `accessibilityFeedbackType` preference. 
I changed `feedbackGeneric` to `feedbackSpoken` and it fixed the problem. Looks like the feedback type is used a sign that the service is doing something important for the user and should be saved even on memory clean up.
Hi Leora!
Mark M.
my guess is that was a Xiaomi decision to pay attention to that and behave as it is
Dmitry Y.
I finished. The question is not exactly about android actually. I think I will wait
Mark M.
OK, I will be back with you shortly
Leora: how can I help you today?
Leora
Hey, so I have a bunch of heavy video clips in this app.
8:40 AM
Leora
They seem to be more quality than I need for a small screen
So, can you tell me the minimum size or resolution or...whatever factor...I need for small screens
Like compress them I guess?
And if to put a second set (presumably the originals) for tablets
Mark M.
well, there are some phones that have fairly high-resolution screens (4K, even)
so, really, the answer of "minimum size" is to try something and see if it looks OK to you and to whoever needs to approve this change
Leora
Yes, but 4.9MB for a 6 second video (and it's a child's app! but my boss wants top quality)
that size seems excessive
Mark M.
what is the file format? MP4?
Leora
what factor do I look for to start - size?
yes mp4
Mark M.
if your boss wants top quality, then my guess is that you should be focusing first on making the boss happy :-)
Leora
then I have another 6 second one that's only 900KB, another 1.3MB etc
Mark M.
what versions of Android are you supporting? IOW, what is your minSdkVersion?
Leora
But couldn't I compress this at say 75% at least with no visual difference on a small screen?
minSDK 21
Mark M.
MP4 is already compressed
hence, I am assuming that by "compress" you mean "change the resolution"
Leora
even on a tablet it looks amazing, so I'm assuming there's room to downsize for telephones
8:45 AM
Mark M.
you can certainly use a video transcoding tool to change the resolution
Leora
umm...yes?
Mark M.
but I cannot tell you whether it will be acceptable to your boss
Leora
hahaha of course not
but what parameters do I look for?
Mark M.
here, by "resolution", I am referring to the number of pixels in each dimension (X, Y)
a video player or other tool can probably tell you what the resolution is
I am an Ubuntu user; if I want that information, I right-click on the video file in the Nautilus file explorer, and I can get that from the properties dialog
Leora
ok, you want to come back to me I will check?
Mark M.
sure, let me know when you are ready!
Dmitry Y.
Before question. I read your book about Android 6.0. it was 5 years ago approximately. It boosted my growth in Android Development and I used it several years after for searching deep docs about webview and other android services. Since then I made tons of great features, created complicated architectures and now managing several different projects. I find a lot of interesting facts during development, for example the one I found for Xiaomi recently. But for me it is not clear if my ideas and solutions are valuable for the community. And it stops me from writing any blog posts about anything. The question is: How to deal with my doubts and do you have an idea how I can be sure that the research and solution will rich the community?
Mark M.
in the meantime...
Leora
I was ubuntu for 4 months :/ wifi disconnected constantly
and on windows other problems!
Mark M.
Dmitry: "How to deal with my doubts and do you have an idea how I can be sure that the research and solution will rich the community?" -- personally, I would not worry about the "will rich the community" part
write what you want to write
if it is useful, people will find it
usually, there is little harm in writing something
8:50 AM
Mark M.
and the act of writing it down may have its own value to you, both personally and for your career
Dmitry: if you have another question, go right ahead!
Dmitry Y.
Usually, I finish with the fact: probably it is written by someone else already. And my text would be just developing a bicycle.
Mark M.
if it took you X hours to come up with a solution, probably it would take the next person a similar amount of time
if there was something already written that took the X hours down to Y minutes, you probably would have found it in your own research
Dmitry Y.
And the second the most annoying fact: I don't use TDD in development. I know how to write tests, but always take too much time, and the task on the beginning not clear enough to write tests before MVP version of the feature.
Mark M.
and, even if it exists but you did not find it, by writing your own piece, you increase the likelihood that somebody else will find the solution, either by finding yours or finding the earlier work
personally, I have yet to work on any project for a customer that really does TDD
TDD proponents talk a lot about TDD, but I have little evidence that TDD is all that common
8:55 AM
Mark M.
it's a lovely concept, in a "it would be lovely if I were not balding" sort of way -- a very nice idea that may not be practical in many cases
Dmitry Y.
Hearing this from you is very helping, thanks!
Leora
haha you really need to add emojis to this chat :)
Mark M.
🤔
Leora
ooo not fair
Mark M.
(Campfire does not support emojis in any direct fashion, but you can copy-and-paste them in from Emojipedia or elsewhere)
Leora
😊
Mark M.
Leora: did you find your video resolution?
(if not, that's OK -- I just wanted to check)
Dmitry Y.
Thank you for your support! I will probably write my first article about themes switching.
Leora
yes, and it's a surprisingly regular 1280x720
Mark M.
Dmitry: sounds good!
Dmitry Y.
dark/light
Mark M.
Leora: I am surprised that a 6 second video at that resolution wound up that large
9:00 AM
Mark M.
(in terms of file size)
Dmitry Y.
Have a good day, Mark, Leora!
Leora
Yay Dmitry! Go for it!
Mark M.
Dmitry: you too!
Dmitry Y.
has left the room
Mark M.
Leora: is there somebody on your team who is responsible for creating the videos? can you ask them to give you smaller files?
also, do the videos have sound or are they silent?
Leora
how can the same duration videos of the same resolution wind up different weights?
yes i can but i need to know what to tell him or I can change them myself with FFMPEG
since it's in cmd and he doesn't know how
Mark M.
MP4, like MP3 and JPEG, uses lossy compression, so the complexity of the video and the range of the color palette can affect the resulting file size
Leora
ohhhh I see
still surprised that a video clip of a duck will be that much less/more than that of a horse
Mark M.
I suspect that reducing the resolution further is not going to be a good approach, unless you are fairly certain that your app will be used mostly by low-end phones -- I would worry that a lower-resolution video will look poor on high-resolution phones
however, there may be color depth or other settings that you can play with
if the videos were silent, you could consider converting them to animated WebP images -- I recently converted some animated GIFs to animated WebP for an Android project and was stunned how small the WebPs got
you could try converting the MP4s to WebM and see if they still play back and how big the files are
Leora
they aren't silent
9:05 AM
Mark M.
and there may be other tricks you could use -- I certainly am not a video format expert
Leora
i see there's a value called data rate that's much smaller in the lighter videos of the same durtion
Mark M.
"frame rate" would refer to frames per second
I am not certain what "data rate" would mean in this context
Leora
maybe the data rate is what you are saying about color depth etc
Mark M.
possibly -- it might be some combination of frame rate and average frame size in bytes or something
Leora
so webM would be for 'talkies' correct?
Mark M.
yes, it is a video container format, like MP4: https://developer.android.com/guide/topics/medi...
VP8 and VP9 are the relevant codecs, and those work on your versions of Android
Leora
ok I'll look into it
Mark M.
personally, if I need "higher level" stuff than FFMPEG, I'll turn to tools with "presets" for various types of devices, like Handbrake
9:10 AM
Leora
Handbrake eh? Yeah I's prefer that he'll have UI and deal with it
another question but hopefully less complicated
Have you released to the Chinese markets?
Mark M.
not directly
Leora
then indeirectly? haha
Mark M.
AFAIK, none of my consulting clients have distributed outside of the Play Store -- at least, they never mentioned it
back when I used to ship *The Busy Coder's Guide to Android Development* in APK form, that might have wound up in China, but I distributed directly from my Web site
Leora
ok well, then it;s my funeral
Mark M.
so, I have no experience with Chinese app markets, other than there are a lot of them
Leora
btw ...i have downloaded all your books and their updates. if i'm looking for a specific topic, do you have a general directory?
kinda cumbersome to open each pdf and do a search
Mark M.
there is full-text search on https://wares.commonsware.com
the Web site full-text search spans all the books
Leora
oooooo! wow. glad I asked :)
Thanks Mark, for all you do
Mark M.
happy to help!
9:15 AM
Leora
Good day sir
Mark M.
you too!
Leora
has left the room
9:30 AM
Mark M.
turned off guest access

Saturday, April 3

 

Office Hours

People in this transcript

  • Dmitry Yurchenko
  • Leora
  • Mark Murphy