Office Hours — Today, December 21

← Thursday, December 16

Dec 21
3:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:00 PM
Suzanne A.
has entered the room
Mark M.
howdy, Suzanne!
greetings from Dublin!
Suzanne A.
hi mark
dublin? is it cold there?
Mark M.
very
well, at least, very for Dublin
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
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?
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
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
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.
View paste
Creating Custom Dialogs and Preferences
Suzanne A.
great !! okay, next question
do you have an example of a robust rest client service?
Mark M.
Um, not really
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_
the weather API as a service has been reworked
Suzanne A.
do you mean, reworked in the chapter?
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
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
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
Suzanne A.
okay, good
I haven't written a REST client yet, so this will be an adventure
Mark M.
it's a bit tedious in Java
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
Suzanne A.
superb! I'll check it out and try to come to chat next week
to let you know how it's going
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
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~
er, ya~
er, ya!!!
(sheesh, I can't type today)
Suzanne A.
ya too! too cold to type
4:20 PM
Suzanne A.
has left the room
4:35 PM
Alfred V.
has entered the room
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!
there must be something ridiculously simple i am overlooking
Mark M.
maybe it's on vacation
:-)
Alfred V.
i've set it android:clickable=true in the xml
i have an onclick listener...
it's driving me nuts
Mark M.
ok
can you give me a bit more to go on?
Alfred V.
ummm... :-/
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
and it shows a clickstate
but just doesn't call my handler
Mark M.
OK, then maybe I'll need to see the Java
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
setOnClickListener
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
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?
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
but when on Motorola, seeking to unbuffered causes it to just ignore the seek outright.
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
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
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
if you want, tell 'em I sent you their way... :-)
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
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.
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
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
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.
So I want to use android.R...textColor and ...textHighlight. I can do this in the XML, but not in code.
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.
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
sorry!
Chris
ok, thanks for your time.
I'll ask again when it bothers me enough. :)
Mark M.
OK
that's it for today's chat
next one is Thursday
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

← Thursday, December 16

 

Office Hours

People in this transcript

  • Alfred Varnsen
  • brack
  • Chris
  • Mark Murphy
  • Suzanne Alexandra