Apr 28 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 28 | 3:55 PM |
Ron | has entered the room |
Ron |
(hello)
|
Mark M. |
hello, Ron!
|
Mark M. |
how can I help you today?
|
Ron |
View paste
(33 more lines)
|
Mark M. |
um, a lot of what you wrote seems mutually contradictory
|
Mark M. |
it is not possible for the activity to always be over everything and also "minimized"
|
Mark M. |
I guess my main point of confusion is "The activity must be displayed on top of anything else that is running"
|
Mark M. |
that seems to be in conflict with the rest of the description
|
Ron |
That is when the device restarts
|
Mark M. |
OK, why not make your app the home screen, then?
|
Apr 28 | 4:00 PM |
Ron |
Not sure what home screen means?
|
Mark M. |
when you press the HOME button, that is where you go back to
|
Mark M. |
it is Android's equivalent of "the desktop" in a desktop OS, if you will
|
Ron |
Hmmm, we have never seen that. Sounds promising. How do we do it?
|
Joshua C. | has entered the room |
Joshua C. |
Hello. :)
|
Mark M. |
(BTW, hello, Joshua -- I will be with you shortly!)
|
Mark M. |
Ron: have your activity implement android.intent.action.HOME instead of (or in addition to) android.intent.action.MAIN, as <action> elements in the <intent-filter> in the manifest
|
Mark M. |
I assume that this app is only going on hardware that you control, that is in some quasi-kiosk sort of setup
|
Ron |
Yes
|
Mark M. |
on Android 5.0+, you might look at actual kiosk mode, with pinned apps
|
Mark M. |
I haven't played with it yet, but that's the general direction Google is heading to support these sorts of scenarios
|
Ron |
Great, we will investigate that.
|
Ron |
You can go on to next question and we will ask more later.
|
Mark M. |
OK
|
Mark M. |
Joshua: your turn! do you have a question?
|
Apr 28 | 4:05 PM |
Joshua C. |
Yes, indeed! So... firstly I am designing a software keybaord that I want to implement in android. I'm new to android but have other programming experience, btw. I've looked a bit at the IME documentation (which doesn't seem to be covered in your book), and can't see any sign of what I want to do and I'm not sure such is even possible...
|
Mark M. |
writing an IME is a fairly niche topic, which is why I have not gotten to it yet
|
Joshua C. |
I want my custom keyboard to not shrink the content activity that it's interacting with, but instead leave it full screen (scroll it in some cases) and use the entire screen to have a translucent keyboard.
|
Mark M. |
yeah, I have no clue if that's possible or not
|
Joshua C. |
Hmm...
|
Mark M. |
you could try asking on a place like Stack Overflow, but that's a really specialized subject, and so I do not like your odds of getting an answer
|
Joshua C. |
Well, any thoughts on what directions, code-wise I could look? Can you do low-level screen writing from an IME at all?
|
Mark M. |
well, AFAIK, the IME itself is a separate window from the activity window
|
Mark M. |
and while standard IMEs use that window for rows of key-like buttons, that's not a requirement
|
Mark M. |
for example, Graffiti2 is available as an app
|
Joshua C. |
Well, in what context that you do know about can one draw low-level over other running apps? Any?
|
Apr 28 | 4:10 PM |
Joshua C. |
Yes... and the IME window could be very small... but could I get access to the Canvas of the current activity?
|
Mark M. |
oh, definitely not
|
Mark M. |
that's in a separate process, let alone a separate window
|
Mark M. |
but you don't need that anyway
|
Mark M. |
the issue isn't drawing
|
Mark M. |
my Graffiti2 reference was in reference to that
|
Joshua C. |
Okay, I'll check out that app....
|
Mark M. |
Graffiti/Graffiti2 was the old input mechanism used on Palm devices, back in the 1990's/2000's
|
Joshua C. |
I remember it.
|
Mark M. |
so that IME did not have keys
|
Mark M. |
instead, it had drawing areas
|
Mark M. |
and showed what your finger/stylus was drawing
|
Mark M. |
if they can do that, rendering what you want should not be a problem
|
Mark M. |
the two problems that I see are: translucency and full-screen
|
Mark M. |
I don't know if you supply the window background on the IME window or if that is system-supplied
|
Joshua C. |
Okay...
|
Mark M. |
and I do not know what degree of control you have over the window size
|
Mark M. |
that's mostly because I haven't written an IME, and therefore I don't know the details
|
Mark M. |
let me take another question from Ron while you chew on this, and I'll be back with you shortly
|
Mark M. |
Ron: your turn! do you have another question?
|
Ron |
It is our understanding that launchMode = 'singleInstance' means that the onCreate will fire only once. Is that correct to your knowledge?
|
Joshua C. |
Great. :)
|
Mark M. |
I'd phrase it more as "the existing activity instance, if it exists, will be reused"
|
Apr 28 | 4:15 PM |
Ron |
If it doesn't exist then it will be created then, correct?
|
Mark M. |
yes
|
Mark M. |
if you somehow ensure that the activity lives for the duration of the process, then there should be only one onCreate() for the duration of that process
|
Ron |
How do we determine if there are any ANdroid known issues on these types of things?
|
Mark M. |
::shrug::
|
Mark M. |
you are welcome to peruse b.android.com and see what's out there
|
Ron |
Okay, you can go to next question and we are going to think a bit on this.
|
Mark M. |
OK
|
Mark M. |
Joshua: back to you! do you have another question?
|
Joshua C. |
Well...
|
Joshua C. |
I'm interested in writing another app I'm not sure is possible...
|
Joshua C. |
Can one write a replacement volume control app? It would need to be able to change the volume on the fly, affecting the various streams that are playing from apps.
|
Mark M. |
I haven't played in this area in a while, but you used to be able to
|
Mark M. |
I have (had?) a Volumizer sample app in the book
|
Joshua C. |
(It's going to take me a while to really properly investigate this keyboard issue, but I'll work on it. I was hoping you had more leads.) ;)
|
Joshua C. |
Okay, I missed that, will go and take a good look at it.
|
Apr 28 | 4:20 PM |
Mark M. |
now, the audio APIs changed somewhat over the years, so I am not 100% convinced that you can still change the audio globally
|
Mark M. |
it's not an area I have paid a ton of attention to
|
Mark M. |
but, IIRC, the relevant methods were on the AudioManager system service
|
Mark M. |
here is the very old sample app: https://github.com/commonsguy/cw-omnibus/tree/m...
|
Joshua C. |
Okay, great. Thanks.
|
Mark M. |
let me switch over to Ron, and I'll check back with you shortly
|
Ron |
View paste
|
Mark M. |
Ron: back to you! do you have another question?
|
Mark M. |
if the results of your query will be over ~1MB, you get a window of data
|
Apr 28 | 4:25 PM |
Mark M. |
as you navigate the Cursor, the database is queried again to populate the next window
|
Mark M. |
if the database changes enough while that is going on, you might get the sort of errors represented by that stack trace
|
Mark M. |
however, a 1MB query result is kinda big
|
Mark M. |
so I'd focus on trying to have more focused queries
|
Ron |
Okay, we agree that 1M is pretty large and we don't think our retrivals will be that big.
|
Mark M. |
in that case, you should not run into this
|
Ron |
Okay, go to Joshua and we will think more.
|
Mark M. |
OK
|
Mark M. |
Joshua: do you have another question?
|
Joshua C. |
Not so much yet. I'm just getting into android and of course all the things I want to write are a bit out of the box and will take more research. :)
|
Joshua C. |
And fiddling of course.
|
Mark M. |
the IME is definitely "diving into the deep end of the pool"
|
Mark M. |
OK, unless somebody else joins in, it's free-for-all time: if you have a question, just chime in
|
Joshua C. |
Yeah, I have a bad habit of that. I've been working on a layout for a while... a one-handed keyboard layout.
|
Ron |
We have enough to research now so we will exit. If we have more today we will rejoin. THANKS!
|
Ron | has left the room |
Joshua C. |
And I really want to implement it. Once I get it implemented (even if not properly in an IME), I also want to figure out a way to use it as a bluetooth keyboard to other devices.
|
Apr 28 | 4:30 PM |
Mark M. |
well, if you want to do something to control other devices, you would not use an IME in all likelihood, but rather just a regular activity
|
Mark M. |
if you want to support both modes, that's fine, but you'll want to try to insulate your code from exactly what it's drawing into
|
Mark M. |
to minimize code duplication, etc.
|
Joshua C. |
Yes... but I want to accomplish both... implementations of the same layout. Getting it to work as an IME is critical, and probably the hard part.
|
Joshua C. |
Yes, good point.
|
Mark M. |
agreed
|
Joshua C. |
I'm starting to implement it now just in a simple activity.
|
Mark M. |
though speaking the HID Bluetooth protocol might not be easy
|
Joshua C. |
Indeed, that will be hard. Hopefully I don't have to completely write the implementation from scratch, but I haven't looked into it yet.
|
Joshua C. |
Anyway, thanks for leads. I'll see where I can get and if I hit a wall, I'll try again, or maybe on stackoverlow. :)
|
Mark M. |
you are very welcome
|
Joshua C. | has left the room |
Apr 28 | 4:35 PM |
Raghav C. | has entered the room |
Raghav C. |
Hello
|
Mark M. |
hello, Raghav!
|
Mark M. |
how can I help you today?
|
Raghav C. |
Hey Mark , firstly thank you for your wonderful book. It is very detailed and has been helpful for me.
|
Mark M. |
thanks for the kind words!
|
Raghav C. |
I am currently working on a project for visually impaired people. I want to support custom gestures . I am not able to find relevant info or samples for the same.
|
Raghav C. |
Do you have any sample accessibility project or docs related to supporting gestures?
|
Mark M. |
I am not clear what you mean by "custom gestures"
|
Mark M. |
and what that has to do with accessibility
|
Apr 28 | 4:40 PM |
Mark M. |
can you give me an example?
|
Raghav C. |
yeah suppose I have a really long list and in order for the user to easily navigate the list, I was thinking of adding some custom gesture which when the user performs the gesture, will scroll through 20 or 30 items directly
|
Raghav C. |
Also, a custom gesture anywhere within the app to bring up the home activity of my application.
|
Mark M. |
the accessibility APIs are for device-wide effects
|
Mark M. |
and you cannot do device-wide gestures especially well
|
Mark M. |
you are certainly welcome to have activities in your app pay attention to gestures
|
Raghav C. |
For accessibility, we have talkback gestures where the user is able to navigate through the application using gestures
|
Mark M. |
AFAIK, Talkback-style cannot be implemented via Android SDK apps
|
Raghav C. |
Ok how can I do that? Is there a way to say listen for a circular gesture and then invoke an action?
|
Mark M. |
beats me
|
Mark M. |
over a list, I presume it's possible, but I can come up with a *long* list of things that I would rather do
|
Mark M. |
coordinating touch events between lots of different moving parts (list rows, the list itself, your activity) is not fun
|
Mark M. |
I settle for what GestureDetector does for me, and that's about it
|
Raghav C. |
ok so what do you suggest instead?
|
Apr 28 | 4:45 PM |
Mark M. |
I do not really have much in the way of suggestions here
|
Mark M. |
I apologize for not being more useful in this particular area
|
Raghav C. |
Ok fine thanks. I was thinking that it will be easier for visually impaired people to use gestures to navigate around the application as well.
|
Raghav C. |
Ok fine. Not a problem. I will keep looking
|
Mark M. |
if you have other questions, go right ahead
|
Raghav C. |
I dont have any other questions. Accessibility is the only topic I had in mind.
|
Raghav C. |
Thanks
|
Apr 28 | 4:55 PM |
Raghav C. | has left the room |
Apr 28 | 5:00 PM |
Mark M. | turned off guest access |