Apr 29 | 9:25 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 29 | 9:30 AM |
Justin M. | has entered the room |
Justin M. |
Hi there Mark, good morning!
|
Mark M. |
howdy, Justin!
|
Ron B. | has entered the room |
Mark M. |
howdy, Ron!
|
Ron B. |
Hello.
|
Justin M. |
Hi
there, nice to get a chance to talk with you! Just my luck I checked
your office hour schedule and saw they were this morning, the timing
was perfect! Hopefully I have a quick question with an easy answer
|
Mark M. |
I like those :-)
|
Ron B. |
I have a couple of questions, I'll start after Justin.
|
Jake B. | has entered the room |
Justin M. |
So, I have a ListActivity, and I'm trying to disable the default selector bar that's generated when using the d-pad/trackball...
|
Mike Q. | has entered the room |
Mark M. |
Justin: listSelector="#00000000", right?
|
Justin M. |
I
can disable it for touch events by using the
android:listSelector="#00000000" attribute for the ListView in the
layout.xml, but it still seems to be active for d-pad/trackball
|
Mark M. |
it shouldn't be
|
Justin M. |
View paste
|
Mark M. | |
Sebastian | has entered the room |
Jake B. |
Hey Mark, you answered my question about TabActivity with options menus on Stack Overflow yesterday ( http://stackoverflow.com/questions/2707448…
). I came up with a workaround that has fixed it for me so far, and
neither me nor my coworker can see any obvious potential gotchas with
it. Could I run the solution by you, just to make sure there are no
potential problems (obvious potential for crashes or inconsistent
behavior) that we're missing?
|
Justin M. |
And I tried overriding that in a custom selector that I created, but it seems to have no effect
|
Mark M. |
Jake: wait!
|
Jake B. |
sorry
|
Mark M. |
Jake: I'll get to your question in turn, please hold on
|
Apr 29 | 9:35 AM |
Justin M. |
Wondering if it might be a bug that it's not being recognized?
|
Mark M. |
Justin:
I linked to a sample project from the Advanced Android book that
demonstrates using a custom selector by disabling the regular selector
|
Justin M. |
I see the link there, is there someplace in there specific that I should look? I think I was looking at it yesterday actually
|
Mark M. |
AFAIK, that works with the D-pad, as that's the only way to actually test it
|
Mark M. |
there's not all that much to the code
|
Mark M. |
just having android:listSelector="#00000000" on the ListView should suffice
|
Mark M. |
try building that project as-is -- if it works, steal some ideas; if it fails, let me know
|
Mark M. |
('cause then I have some work to do...)
|
Justin M. |
OK,
interesting. I just saw that when I tried it, listSelector="#00000000"
disabled it for touch events, but the dpad/trackball movements still
have that red bar. Well, good to know that I'm not crazy at least! OK,
I'll try your project and get back with you by e-mail then. Thanks for
the sanity check! :-)
|
Justin M. |
I'm good for now
|
Mark M. |
OK, next to sign on was Ron
|
Mark M. |
Ron: do you have a question?
|
Ron B. |
I
am trying to develop a mechanism to provide application updates. The
model is that it is an internal distribution. What type of coding
constructs do I need? Am I copying a file from the server to a location
on the Droid? What location?
|
Mark M. |
any location, AFAIK
|
Mark M. |
you may need to ensure the file is world-readable, though
|
Mark M. |
you can then start an activity that will initiate the install process
|
Apr 29 | 9:40 AM |
Ron B. |
OK, I guess I'm having trouble with the concept, where am I writing to?
|
Mark M. |
SD card or your app-local file store (getFilesDir())
|
Ron B. |
Right now I developed on Eclipse and downloaded. I want the update to go to the same place.
|
Mark M. |
Huh?
|
Ron B. |
I want to replace the application with the one stored on the server.
|
Mark M. |
the installation process itself handles that
|
Mark M. |
you don't need to worry about it
|
Mark M. |
you just need to get the APK file onto the device
|
Ron B. |
Do you have a code sample?
|
Mark M. |
of downloading a file?
|
Mark M. |
hc.apache.org has samples for HttpClient
|
Mark M. |
a whole bunch of Web sites have examples for using URL and HttpUrlConnection
|
Mark M. |
you can also see a download in the Service/WeatherPlus sample app
|
Mark M. |
writing a file from the downloaded data is just standard Java file I/O
|
Mark M. |
this code should work for triggering the install of the downloaded APK: http://android.amberfog.com/?p=98
|
Apr 29 | 9:45 AM |
Mark M. |
(BTW, Service/WeatherPlus is from my original Android book -- http://github.com/commonsguy/cw-android/tr…)
|
Mark M. | |
Ron B. |
OK, I'll run with that for now. Thanks!! Do I requeue for my next question?
|
Mark M. |
yes, please
|
Mark M. |
Jake: you're up now
|
Jake B. |
View paste
|
Jake B. |
oops, didnt realize it would cut off
|
Jake B. |
Basically,
each activity implements that interface and does all its menu work in
afterPrepareOptionsMenu. It feels like a gross workaround, but so far,
it's fixed the problem for us. Do you see any potential problems
(obvious potential for crashes or inconsistent behavior) that we're
missing?
|
Mark M. |
yeah, pasting has its issues...
|
Sebastian | has left the room |
Jake B. |
sorry about that :)
|
Mark M. |
not your fault -- Campfire is a bit strange
|
Mark M. |
it is not clear where you're getting optionsMenuTargetId from
|
Mark M. |
but the general approach of manually delegating menu creation to the right tab should be OK
|
Jake B. |
I'm getting it from onTabChanged
|
Mark M. |
ah, I see
|
Jake B. |
Yeah, we had tried that originally by just using TabActivity.getCurrentActivity, but that was getting equally confused
|
Mark M. |
and that's probably what was triggering your menu problems in the first place
|
Mark M. |
might be a bug in Android
|
Apr 29 | 9:50 AM |
Mark M. |
but, if this system is functionally working for you, I don't see huge problems with it
|
Jake B. |
Great, I really appreciate it. Just wanted to make sure there were no big obvious problems we were missing.
|
Mark M. |
other than my general reservation against activities-in-tabs
|
Jake B. |
Awesome, thanks so much :)
|
Mark M. |
and
sorry for squashing you earlier, but there's only one of me, and I am a
Bear of Very Little Brains, so I can't handle too many things at once
|
Mark M. |
next up is Mike
|
Jake B. |
No worries :)
|
Mark M. |
Mike: do you have a question?
|
Mike Q. |
Hi Mark, can a menuitem register a context menu so I can do a long press on one of the menu items?
|
Mark M. |
no
|
Mark M. |
Menu is an abstraction
|
Mark M. |
while there may be Views under the covers, you don't have access to them
|
Mike Q. |
Well, that was easy huh?
|
Mark M. |
for me, yes
|
Mark M. |
for you, perhaps not so much :-)
|
Mike Q. |
Well that's really all I had. it is a bummer though!
|
Mark M. |
OK, with Sebastian gone, that completes the first pass
|
Mark M. |
Justin: did you have another question?
|
Mark M. |
Ron: I believe you had another question?
|
Ron B. |
Yes thanks! I'm trying to mute Text message arrival sounds but not call ringing sounds? Is this possible?
|
Apr 29 | 9:55 AM |
Mark M. |
beats me
|
Mark M. |
I haven't played around in that area of Android yet
|
Mark M. |
If
a user can do it through the Settings application, you could look at
the code, see how they do it, and see if that's possible for an
ordinary SDK app
|
Ron B. |
Maybe
it's a vocabulary issue. I see "Notification Sounds" discussed as well
as "Ringer Volume". Does the former refer to SMS and the latter to
calls?
|
Mark M. |
hold on, I actually don't have a phone right here
|
Mark M. |
yeah, I'm not sure
|
Mark M. |
I'm over 40, so I'm not a big SMS guy :-)
|
Mark M. |
the latter is definitely calls
|
Ron B. |
Me too! Sometimes the vocabulary is harder than the actual concept.
|
Ron B. |
Thanks anyway.
|
Mark M. |
the Ringer Volume has a checkbox to control whether it manages both ringtone and "notification volume"
|
Mark M. |
my guess is that they treat all notification sounds the same way, whether SMS or other ones (e.g., SD card mount/unmount)
|
Apr 29 | 10:00 AM |
Mark M. |
anyone have another question?
|
Mike Q. |
Actually,
I do have another. Any thoughts on how to keep error logs on the device
and having a way to access them through a menu item?
|
Mark M. |
Usually, the approach is to send error information over a series of tubes back to some central server (e.g., Flurry, DroidDrop)
|
Mark M. |
you really want something in addition on-device?
|
Mike Q. |
Do you have any examples anywhere on that being done?
|
Mike Q. |
That would be preferable to on-device.
|
Mark M. |
well, I haven't published any samples myself, but Flurry has some, and I think DroidDrop had usage instructions as well
|
Mark M. |
there are others -- those are the two names that stick in my head
|
Mark M. |
If you want the whole LogCat, rather than just your exceptions, look for Android Log Collector
|
Mark M. |
I think they're hosted on code.google.com
|
Mike Q. |
Ok, I will check those out. i was unaware they existed.
|
Mike Q. |
Will check that out too. Thanks.
|
Mark M. |
I wrote a blog post about 'em late last year on AndroidGuys
|
Apr 29 | 10:05 AM |
Mike Q. |
Great. Thanks again.
|
Mark M. |
ah!
|
Mark M. | |
Mark M. |
anyone else have a question?
|
Ron B. |
Well,
if no one else is speaking. Is there a way to get an actual address
from a GPS lat/long. Is the Droid GPS accurate enough for this anyway?
|
Mark M. |
by "actual address", do you mean building, street, city, etc.?
|
Ron B. |
Street number, so that a snail mail could be sent if needed.
|
Mark M. |
sorta
|
Mark M. | |
Mark M. |
you'll get an "array of Addresses" to choose from
|
Mark M. |
assuming it has the info
|
Mark M. |
there are third party services for this as well, I think, that you can access via Web services
|
Apr 29 | 10:10 AM |
Ron B. |
Thanks,
that's what I was looking for. I live in 1/3 acre zoning and my Droid
GPS with a third party lookup said I was about 3 houses away. I'll try
to see if I show up on the "list". Thanks!!
|
Mark M. |
anyone else have a question?
|
Justin M. |
Think you also answered another unasked question I had with that, thanks :-)
|
Jake B. |
Mark:
Is there any simple way of just straight up clearing the entire history
behind your activity? We've seen various things with CLEAR_TOP, but
they all seem to have some gotchas.
|
Mark M. |
I've tried to avoid navigation patterns requiring those sorts of shenanigans
|
Apr 29 | 10:15 AM |
Jake B. |
We
have too, but there are a few places where we can't see an alternative
(for example, we don't want people to tap "Log out", and then back into
the activity they were just in (which requires credentials)
|
Mark M. |
what problems have you had with CLEAR_TOP?
|
Jake B. |
i
can't remember off the top of my head, it was a long time ago. i just
figured id run it by you real quick if you didn't have any other
questions. if there's nothing off the top of your head, we're handling
the problem in an acceptable way currently, so no worries.
|
Mark M. |
yeah, sorry
|
Jake B. |
no problem
|
Justin M. |
Mark, how often do you have office hours?
|
Mark M. |
usually one or two a week
|
Mark M. |
depends on my travel schedule
|
Apr 29 | 10:20 AM |
Mark M. |
so, next week, there will only be one
|
Justin M. |
OK, cool deal, and did I see that you do custom on-site training too?
|
Mark M. |
absolutely!
|
Justin M. |
Might have something for you, I'll email you about it :-)
|
Mark M. |
sounds good, thanks!
|
Mark M. |
any other questions?
|
Apr 29 | 10:25 AM |
Mike Q. | has left the room |
Jake B. |
None from me, thank you so much for the help; I really appreciate it.
|
Mark M. |
happy to help!
|
Ron B. |
Thanks Mark, over and out.
|
Ron B. | has left the room |
Mark M. |
well, that's a wrap for today's chat
|
Apr 29 | 10:30 AM |
Mark M. |
have a pleasant day!
|
Justin M. | has left the room |
Jake B. | has left the room |
Mark M. | turned off guest access |