Feb 23 | 7:20 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Feb 23 | 7:25 PM |
Steve | has entered the room |
Mark M. |
hello, Steve!
|
Steve |
Hi, Mark!
|
Mark M. |
how can I help you today?
|
Steve |
I have a question about animated Gifs. Here it is:
|
Steve |
View paste
|
Mark M. |
whew
|
Mark M. |
I thought your question was "can you hit the monkey?"
|
Steve |
no, that's for a different site
|
Steve |
sorry, it should be: android.graphics.Movie
|
Mark M. |
there are libraries now on the Android Arsenal that offer some amount of animated GIF
|
Mark M. |
er, animated GIF support
|
Mark M. |
I haven't used any of them
|
Mark M. |
WebView is very heavyweight, and IIRC Movie was as well
|
Steve |
ok. so that would be reasons one might avoid the approach i mentioned.
|
Mark M. |
AnimationDrawable is not that tough, once you convert over your GIF, though it result in a 'splosion of resources
|
Mark M. |
so, for that reason, you might poke around at those libraries
|
Feb 23 | 7:30 PM |
Mark M. |
I'll need to play around with them myself and update that portion of the book sometime
|
Scott W. | has entered the room |
Steve |
thanks, Mark. i'll take a look at the Android Arsenal libraries. but it sounds like using AnimationDrawable would provide a robust implementation.
|
Mark M. |
OK
|
Scott W. |
Hello!
|
Mark M. |
Steve: let me take a question from Scott, and I'll be back with you shortly
|
Mark M. |
Scott: hi! how can I help you today?
|
Steve |
thanks, Mark.
|
Scott W. |
I'm having a device specific problem with camera flash modes.
|
Mark M. |
aren't we all? :-)
|
Scott W. |
I have an app that has a live preview with a toggle button for the torch light
|
Scott W. |
This toggle works by setting flash mode to FLASH_MODE_TORCH when I want it on, and then back to FLASH_MODE_AUTO when I want it off.
|
Mark M. |
OK, so you're using the classic camera API
|
Scott W. |
right
|
Scott W. |
I'm actually going through your camera2 chapter to see if that fixes the problem right now
|
Scott W. |
but that's a whole lot of work to get a torch feature working
|
Scott W. |
so anyway...
|
Scott W. |
the torch toggle works on Samsung devices, HTC devices, but not Nexus devices
|
Scott W. |
the only way to get it to work on Nexus phones is to set flash mode to OFF first, wait a bit, then set it to AUTO
|
Feb 23 | 7:35 PM |
Mark M. |
is there any particular problem in using that approach for all devices?
|
Scott W. |
100ms wait works, but if I made the call one after another (still committing the parameter changes), it won't work.
|
Scott W. |
I'm nervous about introducing a Runnable anywhere due to asynchronous nature of our app.
|
Mark M. |
is there any particular problem in using that approach for all devices?
|
Mark M. |
:: shrug ::
|
Mark M. |
camera hardware is flaky
|
Mark M. |
I mean, developers have problems with it on all days that end in "y"
|
Scott W. |
aight fair enough
|
Mark M. |
I'm not completely shocked that rapid-fire flash mode changes cause problems
|
Mark M. |
if your concern is literally the Runnable, fork a thread that does Thread.sleep(100) and then changes the parameters
|
Scott W. |
will do.
|
Mark M. |
you could say "only do that on Nexus devices", though there may be others with similar flash issues
|
Scott W. |
how can I pick out just Nexus devices?
|
Mark M. |
Build.MANUFACTURER and Build.PRODUCT, compared against a table of devices that are giving you grief
|
Feb 23 | 7:40 PM |
Scott W. |
I will do this
|
Mark M. |
you might consider having "flash compatibility mode" or some such tucked away in Settings to override default behavior as well, in case users in the field run into this for non-Nexus devices
|
Scott W. |
good idea.
|
Mark M. |
after one failed and one not-yet-failed camera library, I have a fair amount of MANUFACTURER/PRODUCT workarounds under my belt...
|
Scott W. |
have you been using camera2 a lot?
|
Mark M. |
enough to write CWAC-Cam2
|
Mark M. |
(the not-yet-failed library)
|
Mark M. |
in the modern world, we sometimes refer to complex things as "byzantine"
|
Mark M. |
the Byzantines would refer to complex things as "like the Android camera2 API"
|
Scott W. |
why's that?
|
Mark M. |
why has it not yet failed? give it time! :-)
|
Scott W. |
no why byzantine?
|
Mark M. |
I actually pretty much grokked the original API
|
Mark M. |
Camera2... I understand barely enough to write the sections on it in the book chapter
|
Mark M. |
and there's *lots* of hand-waving in that chapter
|
Scott W. |
yeah... I used the Android sample a lot in conjunction with your chapter.
|
Mark M. |
let me take another question from Steve, and I'll be back with you in a bit
|
Scott W. |
ok cool
|
Mark M. |
Steve: your turn! do you have another question?
|
Feb 23 | 7:45 PM |
Steve |
Just one quick question. I took a quick look at the Arsenal, and will probably just follow your chapter.
|
Steve |
Is there any kind of vetting process for the libraries in Android Arsenal?
|
Mark M. |
somebody had to write a pull request and submit it to the GitHub repo that forms the backbone of the Arsenal
|
Scott W. |
I asked this same question to my manager today :D
|
Mark M. |
otherwise, no
|
Steve |
ok. thanks so much for your help, Mark!
|
Mark M. |
I am not aware of any site that offers library reviews and the liek
|
Mark M. |
er, like
|
Steve |
have a good night!
|
Mark M. |
you too!
|
Steve | has left the room |
Mark M. |
Scott: back to you! do you have another question?
|
Scott W. |
yeah
|
Scott W. |
this is venturing into un-researched territory though. Feel free to just point me in the right direction.
|
Scott W. |
I inherited a bunch of code, and one part of the video capturing that I haven't gotten around to is SurfaceTextures
|
Scott W. |
we have this random surface texture mSurfaceTexture = new SurfaceTexture(42);
|
Scott W. |
I don't know what the surface texture is really, or why there's a 42 in there.
|
Mark M. |
well, clearly, that's how many roads a man must walk down
|
Mark M. |
:-)
|
Feb 23 | 7:50 PM |
Scott W. |
It's fun sometimes
|
Mark M. |
while I have used SurfaceTexture, I have gotten it from other stuff, as I recall
|
Mark M. |
I don't think that I have ever created one, looking at the JavaDocs for the constructor
|
Mark M. |
because I haven't the foggiest notion what "the OpenGL texture object name" means
|
Mark M. |
OpenGL is one of many specialized areas in Android that I haven't ventured, nor really plan to
|
Scott W. |
I see
|
Scott W. |
that's 90% of our app
|
Scott W. |
very difficult to work on as a beginner developer
|
Mark M. |
I can imagine
|
Scott W. |
well I don't want to hold you up. I would just be grasping at questions at this point.
|
Mark M. |
no worries
|
Mark M. |
sorry I couldn't be of greater use on that one
|
Scott W. |
I bought your book the day I got this job and it has helped me out a ton.
|
Scott W. |
thank you very much!
|
Mark M. |
you are very welcome!
|
Scott W. |
Oh wait!
|
Scott W. |
quick question
|
Scott W. |
I skimmed through the Android for desktop chapter today
|
Scott W. |
and it seems like an odd chapter to be in the book. Like speculation. Why did you put it in?
|
Mark M. |
hah!
|
Mark M. |
yeah, it's rather unusual that way
|
Mark M. |
I was writing some notes down and decided I may as well roll it into a chapter
|
Feb 23 | 7:55 PM |
Mark M. |
it'll get slowly expanded over the next update or two
|
Mark M. |
and, if predictions come true, it'll get substantially updated after Google I|O
|
Scott W. |
You think Google will pick a direction soon?
|
Scott W. |
ok awesome
|
Mark M. |
I'
|
Mark M. |
er
|
Mark M. |
I'd phrase it more as "Google will emphasize a direction. Or two."
|
Scott W. |
that's exciting
|
Scott W. |
it'll keep us from writing a Windows app hopefully
|
Mark M. |
that'll depend on Google's choices
|
Mark M. |
if the emphasis is on new hardware, then you'll be dealing with Windows for quite a while
|
Scott W. |
:(
|
Mark M. |
if, however, they elect to beef up/overhaul the ARC stuff for Chrome, or they come up with their own Android-on-Windows play, then things get interesting
|
Scott W. |
fingers crossed
|
Mark M. |
or, it could all just be rumors, and they'll do something totally different, like Android for Kitchens
|
Scott W. |
OK I'm going to implement this Nexus workaround.
|
Scott W. |
I read that as Android for Kittens at first
|
Feb 23 | 8:00 PM |
Scott W. |
got preeeetty pumped
|
Mark M. |
I suppose that's another possibility
|
Scott W. |
I plan on taking advantage of these chats in the future, so maybe I'll talk to you later.
|
Scott W. |
Thanks again for all the help.
|
Mark M. |
you're welcome!
|
Scott W. |
bye bye
|
Scott W. | has left the room |
Feb 23 | 8:25 PM |
Mark M. | turned off guest access |