Dec 21 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Dec 21 | 4:00 PM |
Suzanne A. | has entered the room |
Mark M. |
howdy, Suzanne!
|
Mark M. |
greetings from Dublin!
|
Suzanne A. |
hi mark
|
Suzanne A. |
dublin? is it cold there?
|
Mark M. |
very
|
Mark M. |
well, at least, very for Dublin
|
Mark M. |
breaking 150-year-old records around here
|
Suzanne A. |
Is it possible to start a time widget from a preferences screen? (in the middle of the cold)
|
Mark M. |
time widget = TimePicker?
|
Suzanne A. |
yes
|
Dec 21 | 4:05 PM |
Mark M. |
there's no built-in preference for that, but creating a TimePreference as a DialogPreference subclass should be straightforward
|
Suzanne A. |
so I have to subclass DialogPreference?
|
Suzanne A. |
or start it from a menu or button?
|
Mark M. |
Step #1: Subclass DialogPreference and override
the right methods to put a TimePicker in the dialog and persist/restore
the value
|
Mark M. |
Step #2: Use your custom DialogPreference in your preference XML by fully-qualifying the class name
|
Suzanne A. |
ok
|
Mark M. | |
Suzanne A. |
ok, thanks
|
Suzanne A. |
next question ..
|
Mark M. |
this is covered in a chapter of _The Busy Coder's Guide to Advanced Android Development_
|
Suzanne A. |
which chapter in advanced?
|
Mark M. | |
Suzanne A. |
great !! okay, next question
|
Suzanne A. |
do you have an example of a robust rest client service?
|
Mark M. |
Um, not really
|
Mark M. |
at least, not for any definition of 'robust' I'd use
|
Suzanne A. |
or any rest client service?
|
Mark M. |
well, you may recall the National Weather Service examples from the training
|
Suzanne A. |
yes
|
Mark M. |
those are in _The Busy Coder's Guide to Android Development_
|
Mark M. |
the weather API as a service has been reworked
|
Suzanne A. |
do you mean, reworked in the chapter?
|
Dec 21 | 4:10 PM |
Mark M. |
yes; unfortunately, the rework was in part to
demonstrate an anti-pattern: forcing the activity to deal with the
background thread
|
Mark M. |
I say "unfortunately" because that exacerbates the lack of "robust"-ness
|
Suzanne A. |
so we don't want to do that, right?
|
Mark M. |
no, it'll generally be better to hide the threads in the service
|
Mark M. |
one less thing to deal with on rotation events and other configuration changes
|
Suzanne A. |
can I start with your example and build on it?
|
Mark M. |
sure, I suppose
|
Mark M. | |
Suzanne A. |
okay, good
|
Suzanne A. |
I haven't written a REST client yet, so this will be an adventure
|
Mark M. |
it's a bit tedious in Java
|
Mark M. |
You might also check out Novoda's RESTClient, which is implemented as a content provider, IIRC
|
Suzanne A. |
novoda? a content provider I can call?
|
Mark M. |
yes -- and it's RESTProvider, not RESTClient
|
Mark M. | |
Suzanne A. |
superb! I'll check it out and try to come to chat next week
|
Suzanne A. |
to let you know how it's going
|
Dec 21 | 4:15 PM |
Mark M. |
ok
|
Suzanne A. |
you'll be on tuesday, right?
|
Mark M. |
8pm Eastern, 5pm Pacific
|
Suzanne A. |
okay, i'll do my best to be there
|
Suzanne A. |
happy holidays, in the meantime
|
Mark M. |
likewise!
|
Suzanne A. |
thanks. how long will you be in dublin?
|
Mark M. |
another couple of days -- flying back Friday (barring weather-related trouble)
|
Suzanne A. |
okay. thanks for the help, as always. I gotta run now, but tty next week
|
Mark M. |
see ya~
|
Mark M. |
er, ya~
|
Mark M. |
er, ya!!!
|
Mark M. |
(sheesh, I can't type today)
|
Suzanne A. |
ya too! too cold to type
|
Dec 21 | 4:20 PM |
Suzanne A. | has left the room |
Dec 21 | 4:35 PM |
Alfred V. | has entered the room |
Dec 21 | 4:40 PM |
Mark M. |
howdy, Alfred!
|
Alfred V. |
hi Mark
|
Mark M. |
how can I help you today?
|
Alfred V. |
i have this one view that is simply not firing its onClick event!
|
Alfred V. |
there must be something ridiculously simple i am overlooking
|
Mark M. |
maybe it's on vacation
|
Mark M. |
:-)
|
Alfred V. |
i've set it android:clickable=true in the xml
|
Alfred V. |
i have an onclick listener...
|
Alfred V. |
it's driving me nuts
|
Mark M. |
ok
|
Mark M. |
can you give me a bit more to go on?
|
Alfred V. |
ummm... :-/
|
Alfred V. |
it's a simple LinearLayout
|
Mark M. |
can you upload the XML to gist.github.com or something and link it here?
|
Alfred V. |
i even have it set up so that its background drawable shows that the click state
|
Alfred V. |
and it shows a clickstate
|
Alfred V. |
but just doesn't call my handler
|
Mark M. |
OK, then maybe I'll need to see the Java
|
Mark M. |
how are you registering for the click -- android:onClick, or setOnClickListener()?
|
Alfred V. |
the funny thing is... i swear i had it working some time ago
|
Alfred V. |
setOnClickListener
|
Dec 21 | 4:45 PM |
Mark M. |
one possibility is that something else is in front of the LinearLayout -- you would use hierarchyviewer to help detect that
|
Alfred V. |
oh okay
|
Mark M. |
another possibility is that you are calling setOnClickListener() on the wrong object accidentally
|
Mark M. |
you might try switching to android:onClick and see if that helps, if you are not planning on supporting Android 1.5
|
Alfred V. |
okay
|
Mark M. |
otherwise, I don't really have any advice based just on the symptoms you have listed here
|
brack | has entered the room |
Mark M. |
howdy, brack!
|
brack |
Hi, sorry to join so late! How are you, Mark?
|
Chris | has entered the room |
Mark M. |
OK, and you?
|
Dec 21 | 4:50 PM |
Mark M. |
howdy, Chris!
|
Chris |
HI there.
|
Mark M. |
brack: do you have a question?
|
brack |
great, minus the recent troubles with PVPlayer on Motorolas. have a quick question about that whenever you're availabkle
|
Mark M. |
what is PVPlayer?
|
brack |
yeah- I'm using the standard MediaPlayer with
streaming content. it works fine on my HTC G2, when seeking to an
unbuffered position
|
brack |
but when on Motorola, seeking to unbuffered causes it to just ignore the seek outright.
|
brack |
PVPlayer is motorola's underlying media player. AwesomePlayer is HTC's (from what i can tell)
|
Mark M. |
PVPlayer sounds like the plain PacketVideo OpenCORE stuff, maybe
|
Mark M. |
they usually prefixed their stuff with PV
|
brack |
I don't know if I need to be doing some custom
streaming and using a FileDescriptor with MediaPlayer, or what, but i
was just generally curious
|
brack |
yeah, PacketVideo sounds familiar
|
Mark M. |
do you have a third data point? in other words, is the G2 or the Motorola the odd case?
|
brack |
there's a ticket on it in google code, and it's been open for a while, doesn't seem very active
|
Mark M. |
you mean b.android.com?
|
brack |
motorola is the odd case afaik, the AVD handles it well too
|
Mark M. |
ok, then you probably should take it up with MOTODEV on the relevant support board
|
brack |
yes, b.android
|
Mark M. |
they're pretty good about responding to inquiries
|
Mark M. |
if you want, tell 'em I sent you their way... :-)
|
Mark M. |
be sure to include the link and any samples you can provide
|
brack |
oh, that's awesome. thanks! any suggestion for
trying a filedescriptor with streaming? Stitcher's app seems to seek to
an unbuffered position just fine on moto
|
Mark M. |
(link to the b.android.com)
|
brack |
yeah, i will do that
|
Mark M. |
never used a FileDescriptor with streaming, so I have nary a clue
|
Mark M. |
Chris: do you have a question?
|
brack |
cool, thanks Mark! appreciate it! have a nice night
|
Chris |
Mark - Just signed up and admit I haven't read
through the books yet :-( ... but I've been killing myself trying to
figure out how to get a reference to a color in the current theme.
|
Dec 21 | 4:55 PM |
Chris |
(I've been away from the code for a while, so I'm trying to reorient my brain some here... new to Android ...)
|
Mark M. |
Chris: I'm not sure what you mean by "get a reference to a color in the current theme"
|
Chris |
Mark: So my issue is that I can do something like
"+@android/attr.textColor" in the XML but I can't figure out how to do
it programmatically...
|
Mark M. |
oh, beats me
|
Chris |
So let me back up: What I want to do is highlight
text (make it bold), but I want to get the "bold" setting from the
current system theme instead of hard-coding it. Make sense?
|
Mark M. |
um, bold is bold, AFAIK
|
Mark M. |
it's a font thing
|
Chris |
I didn't come to class prepared. :)
|
Mark M. |
yeah, and unfortunately, the school bell is about to ring
|
Mark M. |
FWIW, I have another one at a similar time slot on Thursday
|
Chris |
My app doesn't have it's own theme - I'm using the
system theme. From what I understand, different carriers have
different default themes.
|
Chris |
So I want to use android.R...textColor and ...textHighlight. I can do this in the XML, but not in code.
|
Dec 21 | 5:00 PM |
Chris |
I can set an invisible widget to this in the XML and then query it for its values (I think) but not do it direct.
|
Chris |
I'll be travelling Thursday but I'll get back to this in '11.
|
Mark M. |
yeah, off the top of my head, I'm not quite sure how to solve that
|
Mark M. |
sorry!
|
Chris |
ok, thanks for your time.
|
Chris |
I'll ask again when it bothers me enough. :)
|
Mark M. |
OK
|
Mark M. |
that's it for today's chat
|
Mark M. |
next one is Thursday
|
Mark M. |
have a pleasant day, everyone!
|
Chris |
bye Mark
|
Chris | has left the room |
Alfred V. | has left the room |
brack | has left the room |
Mark M. | turned off guest access |