Jan 24 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Bryan | has entered the room |
Mark M. |
hello, Bryan!
|
Mark M. |
how can I help you today?
|
Bryan |
Hey Mark, I hope you are having a great day
|
Jan 24 | 4:00 PM |
Mark M. |
thanks -- you too!
|
Bryan |
I am trying to see if there is a way to "automate" something in a webview without accessibility
|
Bryan |
my ideal situation:
|
Bryan |
View paste
|
Bryan |
even better would be if I could do it on a headless webview
|
Bryan |
I have read a bunch of stuff out there around this type of interaction (some by you on stack overflow), and have not come away with a clear answer
|
Bryan |
so figured I would ask :)
|
Mark M. |
um, well, that's difficult to answer in the abstract
|
Mark M. |
there are also legal issues, which I won't get into
|
Mark M. |
WebView itself has nothing specifically for this
|
Bryan |
do you know if accessibility has access to the specifics of a webview?
|
Mark M. |
but you can invoke JavaScript in the context of the currently-viewed Web page
|
Bryan |
meaning will it report the ids of the html itself
|
Mark M. |
I doubt it but do not know for certain
|
Bryan |
right, but invoking javascript only helps if you know specifics about the page, right?
|
Mark M. |
well, sure
|
Mark M. |
if you're thinking that you will be able to do this for an arbitrary Web page... that's impractical
|
Bryan |
yeah, I am working under the assumption that I don't know that, and that I would want to "discover" it via the initial interaction by the user
|
Jan 24 | 4:05 PM |
Bryan |
it would only be arbitrary as far as the app knows, the user will know it
|
Bryan |
if that makes sense
|
Mark M. |
well, yes, but unless the user is writing the app, that doesn't help much
|
Bryan |
that was what I was afraid of :(
|
Bryan |
do you know if the the dom crawler and whatnot in chrome is available in the webview
|
Bryan |
all the dev tools on chrome desktop
|
Bryan |
etc
|
Mark M. |
there is a way you can hook up Chrome DevTools to a WebView, IIRC
|
Bryan |
internally, or via adb?
|
Mark M. |
adb, IIRC
|
Bryan |
internally meaning in app
|
Mark M. |
the tools themselves are in Chrome
|
Bryan |
ok, thanks, not necessarily what I was hoping for, but good to know :)
|
Bryan |
I have another question if you have time
|
Mark M. |
it's reminiscent of how Stetho leverages the DevTools protocol to allow you to inspect a non-WebView android app
|
Bryan |
gotcha
|
Mark M. |
sure -- there's nobody else in the chat room at the moment
|
Bryan |
so I quickly, too quickly, moved my app to support SDK 26
|
Bryan |
and it wreaked havoc on a bunch of things
|
Bryan |
due to how much I was using background processes, etc
|
Bryan |
so I am going to have to do some serious rewriting
|
Mark M. |
do you mean that you set targetSdkVersion to 26?
|
Bryan |
yeah
|
Bryan |
:(
|
Bryan |
live and learn
|
Bryan |
the nice thing is that my app has an expected persistent notification
|
Bryan |
but currently I have multiple services that were running in the background
|
Bryan |
it seems that I need to move the functionality of those into one service that is attached to the notification
|
Jan 24 | 4:10 PM |
Bryan |
so they can run in the background
|
Bryan |
is that correct?
|
Mark M. |
probably
|
Bryan |
meaning the service running in the background has to be bound to the notification
|
Mark M. |
I have not experimented with that scenario
|
Bryan |
it doesn't whitelist all services from an app if they have a notification
|
Bryan |
ok
|
Mark M. |
mostly because having 2+ services running simultaneously is a code smell
|
Mark M. |
it is possible that having a single foreground service is sufficient
|
Mark M. |
but I haven't tried it
|
Bryan |
yeah, when I originally wrote it it seemed good to separate the functionality out
|
Mark M. |
separate functionality, in terms of Java classes, is fine
|
Mark M. |
separate functionality, in terms of independent services, is probably overkill
|
Bryan |
makes sense
|
Bryan |
ok, thanks for the time!
|
Mark M. |
off the cuff, having a single foreground service ought to work
|
Mark M. |
assuming that all of the services are in one process
|
Mark M. |
as "foregroundness" is a process-level construct
|
Bryan |
yeah, I hope to merge them all down into that and move over to rxjava
|
Mark M. |
("foregroundosity"? "foregrounditude"?)
|
Bryan |
I think they all work ;)
|
Bryan |
have a good rest of your day!
|
Bryan |
I am sure I will be back soon
|
Mark M. |
you too!
|
Jan 24 | 4:20 PM |
Dave S. | has entered the room |
Jan 24 | 4:25 PM |
Mark M. |
hello, Dave!
|
Mark M. |
how can I help you today?
|
Jan 24 | 4:30 PM |
Bryan | has left the room |
Dave S. |
Hey, Mark. I finally broke down and j'ined up. I did NOT expect a 4500-page book! Are you now doing office hours? I sort of stumbled onto this page. In the future, to get into an office hours lecture, seminar, colloquiem, whatever it's called, do I just go straight to https://commonsware.campfirenow.com/room/249110, or does the last part of the URL change, and if so, how do I get it? Do I sign up somewhere, email you, etc.
|
Mark M. |
"I did NOT expect a 4500-page book!" -- well, technically, there are three books, with a fourth on the way
|
Dave S. |
Colloquium
|
Mark M. |
"Are you now doing office hours?" -- been doing 'em for the better part of a decade: https://commonsware.com/office-hours/
|
Mark M. |
"does the last part of the URL change" - yes
|
Mark M. |
"how do I get it?" -- visit https://wares.commonsware.com, log in, click the "Office Hours" nav bar link
|
Mark M. |
if the chat is live, that link is in green, and there's an "Enter the Chat" button above the calendar of upcoming chats
|
Dave S. |
Ah. Just go to the URL I mentioned and you'll have changed the last part to something else.
|
Jan 24 | 4:35 PM |
Mark M. |
the Campfire chat room URL is different on each chat
|
Mark M. |
at least, I think
|
Mark M. |
I haven't really paid attention to that part
|
Mark M. |
I've been focusing on the URL that goes into the Warescription site
|
Dave S. |
BTW, I MEANT to ask "are you doing office hours right at the moment." I knew you had done so for awhile
|
Mark M. |
yup, in the rotating schedule, I have office hours today from 4-5pm US Eastern
|
Jan 24 | 4:40 PM |
Dave S. |
Well, my daughter's boyfriend, who is about 50, had a stroke, I just found out, so I have to leave abruptly. He went to a local hospital and they plan to send him to U. of Cincinnati. Thank God. Local is very lacking. Anyway, thanks for all the hard work you've done over a couple decades, I guess, or more. Including helping me so many times. Thanks especially for that. I'm sitting tight waiting for news about which hospital, but I'm still going to leave the room.
|
Jan 24 | 4:45 PM |
Mark M. |
my condolences -- I wish everyone the best of luck
|
Dave S. | has left the room |
Mark M. |
and thanks for the kind words!
|
Jan 24 | 4:55 PM |
Mark M. | turned off guest access |