Feb 26 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Feb 26 | 10:05 AM |
Mike Q. | has entered the room |
Mike Q. |
Hi Mark...light day today huh?
|
Mark M. |
Howdy, and yes
|
Mark M. |
Tuesday was a no-show
|
Mark M. |
Wondered if the Campfire link was busted or something
|
Mike Q. |
Ha!
|
Mike Q. |
Well I have a question regarding MapView.
|
Mark M. |
Fire away
|
Mark M. |
been dealing with MapView a fair bit in recent days myself
|
Mike Q. |
I was looking at your tutorial and was able to get a map fired up from my application....
|
Mike Q. |
I set the setBuiltInZoomControls to true and I'm not seeing anything on the map. Am I missing something?
|
Feb 26 | 10:10 AM |
Mark M. |
tap towards the bottom of the screen
|
Mike Q. |
Ok, I'm firing up the app now. I did "tap" all over it in the emulator and didn't notice anything but let me try again.
|
Mark M. |
bottom center should do it
|
Mike Q. |
Also,
I added a default overlay to the map. I thought that would also
pinpoint where the location was on the map by default and yet it seems
to do nothing.
|
Mark M. |
I'm assuming this is a reasonably recent Android environment (1.5+), right?
|
Mark M. |
What is "a default overlay">
|
Mike Q. |
Just did this:
|
Mike Q. |
View paste
|
Mark M. |
That will show your location if you are on the map
|
Mark M. |
If this is an emulator, you'll need to supply a fix, I imagine
|
Mike Q. |
Ok,
well I did touch toward the bottom on the emulator and you are correct,
the zoom controls were there. However, I don't see anything from the
overlay.
|
Mark M. |
Emulator or device?
|
Mike Q. |
Emulator.
|
Mark M. |
Did you feed a fix to it that is within the bounds of the map via DDMS or something?
|
Feb 26 | 10:15 AM |
Mark M. |
MyLocationOverlay will not change the map center, just highlight your location
|
Mike Q. |
No,
I simply passed a GeoPoint to the map and it does bring me to that area
within the zoom level but nothing pinpoints the specific location.
|
Mark M. |
It's possible it only works on hardware nowadays
|
Mike Q. |
Ah, ok, I guess I'll need to deploy it to the device and see what happens.
|
Mike Q. |
So speaking of the emulator.....
|
Mike Q. |
Do you know if there's a way to have it actually "emulate" a device in regard to performance/memory constraints?
|
Mike Q. |
For
instance, we're parsing a large XML doc and it performs very well on
the emulator on my machine but I assume it can take advantage of the
full processing and memory from my workstation.
|
Mark M. |
Actually, I tend to find the emulator runs slower than actual hardware
|
Mark M. |
The emulator has to convert from ARM opcodes to Intel
|
Mike Q. |
Really????
|
Mark M. |
Also, emulator lacks graphics hardware acceleration
|
Feb 26 | 10:20 AM |
Mike Q. |
Wow, well that
|
Mike Q. |
s good news.
|
Mark M. |
I can play video back better on a G1 than I can on an emulator running on a quad-core 2.5GHz with a fairly nice video card
|
Mike Q. |
That's very good to hear.
|
Mark M. |
However, to get back to your original question...
|
Mark M. |
-cpu-delay <delay> will provide a slowdown of the emulator CPU
|
Mark M. |
and I think there may be a config file setting you can use to control the RAM, but I'm not 100% certain
|
Mike Q. |
Cool, I will try that. Thanks.
|
Mark M. |
BTW, speaking of MapView, the next edition of the Advanced Android book will have an "Interactive Maps" chapter
|
Feb 26 | 10:25 AM |
Mark M. |
coverage of how to do pop-up panels, how to have different drawables for different points on an itemized overlay, perhaps more
|
Mike Q. |
That sounds good. When will that be coming out?
|
Mark M. |
2-3 weeks, I imagine
|
Mike Q. |
Great, I'll look for that.
|
Feb 26 | 10:30 AM |
Mike Q. |
Mark, let me throw one more thing out there....
|
Mark M. |
go ahead
|
Mark M. |
not much of a queue today
|
Mike Q. |
Ok,
I have a couple of lists and in one of them I have a button in each
list item and in the other I have an image in each list item.....
|
Mike Q. |
The
only way I've found to add event handlers to each item in the list is
by using the OnClick property in the layout for the row. That is
working fine but that wasn't supported until version 1.6.
|
Mark M. |
Each item in which list?
|
Feb 26 | 10:35 AM |
Mark M. |
And does "item" mean "row"?
|
Mike Q. |
Yes.
|
Mike Q. |
Sorry, I guess I could be more clear here.
|
Mike Q. |
So each row in the list has a button in it.
|
Mike Q. |
I need an event handler on those buttons.
|
Mike Q. |
I have a layout for each row in the list.
|
Mike Q. |
In the XML layout for the row, there's an OnClick property on the button.
|
Mike Q. |
I add a click handler there, but I can't figure out how to add it programmatically to each button in each row in the list.
|
Mike Q. |
Hope this makes more sense.
|
Mark M. |
Follow the recipe outlined in the Fancy ListViews chapter of the Android book
|
Mark M. |
I.e., create your own adapter class and inflate the rows
|
Mark M. |
Then, you can get your hands on the Button and call setOnClickListener() for each row you inflate
|
Feb 26 | 10:40 AM |
Mike Q. |
Ok,
I thought that might be the case. I was trying to avoid writing my own
adapter class. Thought there might be a shortcut I was misssing that I
could still use SimpleAdapter and still do this.
|
Mark M. |
I haven't used SimpleAdapter much
|
Mike Q. |
It seems easy enough to use. I see my situation definitely leaning more toward needing to use custom adapters though.
|
Mike Q. |
One
last quick thing.....is there really a lot of overhead using
findViewById()?? I read somewhere there was. Someone making the case
for using a "holder" pattern, but I haven't seen any performance issues
with this.
|
Mark M. |
Well, I cover that in the Fancy ListViews chapter as well
|
Mark M. |
There is some overhead
|
Mark M. |
For a really long list the user flings, it'll add up
|
Mark M. |
Smaller lists, it won't be a big deal
|
Feb 26 | 10:45 AM |
Mike Q. |
Ok, maybe it was in your book that I read that. It all blurs together anymore! :-)
|
Mike Q. |
Well thanks for your time today Mark. Gonna go shovel some snow!!!
|
Mark M. |
yeah, that's on my agenda too
|
Mike Q. |
Have fun!
|
Mike Q. | has left the room |
Feb 26 | 10:55 AM |
Mark M. | turned off guest access |