May 24 | 8:50 AM |
Mark M. | has entered the room |
May 24 | 8:55 AM |
Mark M. | turned on guest access |
midas | has entered the room |
May 24 | 9:00 AM |
Mark M. |
hello, midas!
|
Mark M. |
how can I help you today?
|
midas |
hey mark
|
midas |
I have a few questions
|
midas |
one is about single activity architecture
|
midas |
I wouldnt ask
|
midas |
but from what I understood from io 18
|
midas |
google is now recommending this and is pushing it with the navigation arch component
|
Mark M. |
yes
|
midas |
anyway, I was wondering if one screen can have a tab layout and another not in this framework
|
midas |
since the tabs are part of the app bar layout
|
midas |
which is an activity level ui
|
midas |
or am I making a fundamental error somewhere?
|
Mark M. |
some design choices may force you into using separate activities
|
Milan | has entered the room |
Mark M. |
just because Google steers you towards a single activity does not mean that you necessarily have to use a single activity for everything
|
Mark M. |
(BTW, hello Milan -- I will be with you shortly!)
|
Milan |
(hello Mark, no prob :) )
|
midas |
I agree with that, just find it strange, since one screen having tabs is not that uncommon
|
midas |
how useful can navigation be if it cant handle tabs?
|
Mark M. |
well, tabs do not necessarily have to be in the app bar layout
|
midas |
thats true, unless you want them to collapse with the app bar per material design
|
Mark M. |
and I think Google is leaning more towards bottom navigation
|
May 24 | 9:05 AM |
midas |
which are not supposed to be swipeable tabs
|
midas |
anyway that was the first question
|
Mark M. |
let me take a question from Milan, and then I can return to you for your next question
|
Mark M. |
Milan: your turn! do you have a question?
|
Milan |
feel free to finish with midas
|
Mark M. |
OK
|
Mark M. |
midas: back to you! what's your next question?
|
midas |
ok, thanks milan. The other is about connecting to a wifi enabled device (like a camera w/o data) and remaining connected to mobile network
|
midas |
are you aware of anyway to do that?
|
midas |
Im finding myself forced to manually switch back and forth
|
Mark M. |
IIRC, newer versions of Android offer some ability to control which network connections go on WiFi and which go on mobile data
|
Mark M. |
but I have not spent any time with that problem
|
midas |
IIRC ?
|
Mark M. |
"if I recall correctly"
|
midas |
ah
|
midas |
but can I stay connected to both at the same time?
|
Mark M. |
my understanding is: yes
|
Mark M. |
but, I do not know the details
|
midas |
but you dont know specifically how, or which apis to look at
|
midas |
ok thanks anyway
|
Mark M. |
I'd start with ConnectivityManager, but otherwise no
|
Mark M. |
look in the release notes for Android 7.0-8.0
|
midas |
will do
|
Mark M. |
I think this showed up around there
|
midas |
thanks
|
Mark M. |
the capability has been around for quite a while, as there are nasty hacks on Stack Overflow using hidden APIs related to this
|
midas |
well wifi hotspots were around much longer
|
Mark M. |
it's only in recent versions that they made it official and supported
|
Mark M. |
yes, though I think what you are asking for has also been possible
|
May 24 | 9:10 AM |
Mark M. |
anyway, again, I don't recall the details, as it's not an area that I have worked in directly or spent much time on
|
Mark M. |
so, I can offer you hope, but not much more
|
midas |
ha!
|
midas |
thanks mark
|
Mark M. |
midas: do you have another question? if not, I'll turn it over to Milan
|
midas |
nope thats it for me
|
Mark M. |
OK
|
Mark M. |
Milan: your turn! again! :-)
|
Milan |
My notification is playing a ringtone. With the channels, it is not possible to change a ringtone from application. The only thing I could do is to point user to the settings of specific channel. However, clicking on sound there lists a short tones, not ringtones.
|
Milan |
Any way to force that screen to list ringtones instead?
|
Milan |
Could I share a small piece of code with you to discuss it?
|
Mark M. |
you can, though I am uncertain if it will help
|
Milan | |
Mark M. |
I am not aware of any ability to control what Settings offers here
|
Milan |
I thought it would be possible by .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
|
Milan |
however, same result as with .setUsage(AudioAttributes.USAGE_NOTIFICATION)
|
Mark M. |
hmmm...
|
Milan |
broken api?
|
Mark M. |
what version of Android are you testing on?
|
Milan |
8 and above
|
Mark M. |
I ask, because I just brought up my SAW Monitor app's page in Settings, for my "Whatever" channel
|
Milan |
8.0 currently
|
May 24 | 9:15 AM |
Mark M. |
when I tap on "Sound" -- where my channel just opts into the default -- I get a chooser for picking an audio file
|
Milan |
you mean + Add ringtone option?
|
Mark M. |
no, just a file chooser
|
Mark M. |
so, I tap on "Sound", the chooser shows up, and I can choose a file
|
Mark M. |
presumably, it's scoped to audio files via the MIME type
|
Mark M. |
this is on a Nexus 5X running 8.1
|
Milan |
all I got is pre-populated list of short tones and Add ringtone option
|
Mark M. |
so I am seeing the opposite of you: I don't have short tones or canned ringtones, but I can choose an arbitrary media file
|
Mark M. |
what device?
|
Milan |
mine 5.x on 8.9
|
Milan |
8.0
|
Milan |
5x
|
Mark M. |
whew, you had me scared there for a moment :-)
|
Milan |
:D
|
Mark M. |
note that you have two setSound() calls in your not-a-chromebook branch of code
|
Milan |
first one is commented out
|
Mark M. |
oh, right, sorry
|
Milan |
shared by mistake
|
Mark M. |
FWIW, my SAW Monitor app's notification is: https://github.com/commonsguy/cw-omnibus/blob/v...
|
Mark M. |
I'm just using setDefaults(Notification.DEFAULT_ALL)
|
Mark M. |
I am surprised that Settings behaves differently here for what the user can choose in the channel settings
|
May 24 | 9:20 AM |
Milan |
5X and some devices have +Add ringtone options from that settings screen / sound
|
Milan |
Pixel 2 does not have such option
|
Milan |
not the Samsung devices with 8 and above
|
Milan |
EMUI does not have Sound option at all
|
Mark M. |
hence, this is more of a Settings issue than a notification API issue, most likely
|
Milan |
I would say so
|
Mark M. |
perhaps someday Google will establish and enforce some requirements, though that won't necessarily help with the EMUI case
|
Mark M. |
but I really doubt that there is much that you can do, in your app, to force consistent behavior
|
Milan |
don't care for EMUI at the momment but wondering why it is different on Pixel 2
|
Mark M. |
because Google changed their mind, presumably
|
Milan |
+Essential PH-1 with stock ROM has +Add ringtone option
|
Milan |
8.1
|
Mark M. |
whereas the Nexus devices were a fairly pure AOSP experience, Google is making the Pixels be more Googly
|
Milan |
Pixel 2 has prepopulated list of alarm tones, onlu
|
Milan |
only
|
Milan |
so you think there is no way to force that list to show ringtones instead of alarm tones?
|
Mark M. |
I doubt it
|
Mark M. |
and if there is a way, I have no idea what it would be
|
Milan |
what is the purpose of AudioAttributes::setUsage then?
|
Mark M. |
to be honest, I have never tried that
|
May 24 | 9:25 AM |
Milan |
:) ok
|
Milan |
I guess that is all, then
|
Mark M. |
sorry that I did not have a solution for you
|
Milan |
no prob
|
Milan |
I am just wondering were the notifications good choice for playing ringtone, after all
|
Milan |
before the channels - absolutely yes, I would say
|
Milan |
now, I am not so sure
|
Mark M. |
if the audio is tightly tied to the notification, then I'd say yes, and "let the chips fall where they may" on configurability
|
Mark M. |
if the audio is not tightly tied to the notification, and you're willing to offer your own UI for configuring the rules for playing the audio, then perhaps playing it yourself directly makes more sense
|
Milan |
I have both notifications and UI, UI is displayed when the screen is locked only
|
Milan |
nut main idea is to have notification responsible to answer/decline the call, and that way no need to have activity in fg
|
Mark M. |
your use case is fairly unusual, so managing ringtones yourself seems reasonable
|
May 24 | 9:30 AM |
Mark M. |
though you may wish to explore setting up your own rules for DND, etc., if you do not have them already
|
Milan |
why you think it is unusual?
|
Mark M. |
most apps using notifications are not handling incoming calls
|
Mark M. |
and the term "ringtone" originated with the concept of incoming calls
|
Milan |
I have no option to unlock the screen with notification, especially if user forbid that via channel setting, so I have to provide UI for answering the call, too
|
Milan |
agree and not agree :) most popular messengers have a heads up notificaton
|
Mark M. |
and there are, what, 10 popular messenger apps, out of millions of Android apps?
|
Milan |
true
|
Mark M. |
in your particular product area (call managers), your requirements may be typical
|
Mark M. |
but over the entire Android app space, your requirements are unusual
|
Milan |
with user base bigger than other messanger apps
|
Mark M. |
unusual != bad
|
Milan |
Ah I see what you try to say
|
Milan |
make sense
|
Mark M. |
but unusual does mean that Google's changes may harm you more than it does the average app
|
Mark M. |
and so you may need to get... creative
|
Mark M. |
such as playing the ringtone yourself
|
Milan |
and taking care of DND, native calls and all similar stuff by yourself
|
Mark M. |
yes
|
May 24 | 9:35 AM |
Mark M. |
for your product category, my feeling is that those steps are necessary and reasonable
|
Mark M. |
but if I'm writing a fitness app, and I want to remind the user that they are still 6,349 steps short of their 10,000 for the day, I should not be playing the ringtone myself
|
Milan |
I hoped that AudioAttributes was step forward in direction to minimize developer interfirence
|
Milan |
with the system
|
Mark M. |
well, bear in mind that the AudioAttributes version of setSound() was introduced in Android 5.0
|
Mark M. |
so, when they added it, they may not have been thinking about the sorts of user-managed channels that were introduced with Android 8.0
|
Milan |
hm, good point
|
Milan |
lets create them a ticket and give an idea to Google devs :)
|
Milan |
thanks for your time
|
Mark M. |
happy to (try to) be useful!
|
Milan | has left the room |
Mark M. |
midas: if you have another question, go ahead!
|
May 24 | 9:40 AM |
midas |
nope just listening
|
Mark M. |
no problem
|
midas |
I was hoping to find some more info about the question I had asked
|
midas |
but no success
|
midas |
I was thinking that I might need another process
|
midas |
and use IPC
|
Mark M. | |
Mark M. |
it's older than I thought -- showed up in 5.0
|
Mark M. |
now, I have not attempted to use this, and it may be that this is not what you're looking for, but it is what I thought of with respect to your problem
|
May 24 | 10:00 AM |
Mark M. |
that's a wrap for today's chat
|
Mark M. |
the transcript will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is tomorrow at the same time, 9am US Eastern
|
Mark M. |
have a pleasant day!
|
midas | has left the room |
Mark M. | turned off guest access |