How to set item's height of ListView

by Jiang » Wed, 01 Apr 2009 15:42:33 GMT

Sponsored Links
 Hello, Guys.
The default item's height of ListView is too large, how can I set it's height? 
just like ApiDemos/Views/Lists/6. ListAdapter Collapsed.



Other Threads

1. Best way to determine device capabilities, chipset, etc

I have a need to classify the device on first run to set some default
settings for my games.  This is my first time doing this and I've
already hit some snags as to how to handle such a thing.

Basically I want to figure out if I can run the game with full quality
everything on, which would be for the following phones:
Nexus One
Maybe devour, haven't tested
Any other snapdragon or cortex/pvr device

Everything else with a GPU gets low quality settings
Anything without a GPU gets low quality plus a warning saying that the
game will not perform adequately on their device

Ideally, I would retrieve some information like:

CPU = MSM7200, MSM7600, CortexA8, etc..
GPU = MSM7200, PVRSGX530, etc..
- OR -
CPU speed = 378Mhz or 600Mhz, or 1000Mhz
GPU max = GLES 2.0 or GLES 1.1, etc

but of course that's not really available as I only have a few pieces
of information in android.os.Build, which mostly are:

Build.BOARD (IE trout)
Build.DEVICE (IE dream)
Build.MODEL (IE T-Mobile G1)
and then whatever is in /proc/cpuinfo which I could fetch easily
through either Java or native.  I'll post examples on the end of this

So here are the 3 approaches I was hoping to try:

1)  Benchmarking - Run a simple test for 2 seconds and ballpark the
raw cpu power from that.
Pros - easy to implement, fairly reliable
Cons - If it happens to run during a high-load moment on the phone
(which can last for several seconds) it will be very far off and will
misclassify devices.
2)  Use a really big list of DEVICE or MODEL names and check against
that list.
Pros - It'll work
Cons - The list is already over 60 entries and is growing at an
incredible rate.  It would be very hard to keep it current and keep
all the variants straight
3)  Pull some raw info out of linux and use that.
Pros - Most detailed info available
Cons - Can't find things like raw CPU Mhz, OpenGL version support,

So, any better ideas on how to do this?  Thanks!

cpuinfo for a G1:

Processor       : ARMv6-compatible processor rev 2 (v6l)
BogoMIPS        : 245.36
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant     : 0x1
CPU part        : 0xb36
CPU revision    : 2

Hardware        : trout
Revision        : 0080
Serial          : 0000000000000000

cpuinfo for a Nexus One:

Processor       : ARMv7 Processor rev 2 (v7l)
BogoMIPS        : 162.54
Features        : swp half thumb fastmult vfp edsp thumbee neon
CPU implementer : 0x51
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0x00f
CPU revision    : 2

Hardware        : mahimahi
Revision        : 0081
Serial          : 0000000000000000


2. Do VBOs really improve performance? Really?

I've been trying VBOs (3D) and I've seen no improvement at all on my
Motorola Dext over not using VBOs.

I've tried all kinds of configurations, interleaved arrays,
bytebuffers instead of floatbuffers, both direct and indirect.

My question is, has anybody got any measured improvement in frames per
second by using VBOs instead of exactly the same content without VBOs?

If and only if so, what were your fps results? And can you therefore
show me the "proper" way of doing VBOs instead of not?
Has anybody else got exactly the same fps with and without VBOs?


3. Routing Audio to Bluetooth Headset API Level < 8

4. Help - Kernel branches omap, common branches are not syncing for fresh downloads?

5. ListViews Columns instead of rows

6. How to expose methods of an application to another application