screen size of emulator?

by mmkr » Thu, 10 Sep 2009 11:04:56 GMT

Sponsored Links

How can i get the screen size of my emulator?
i used

Display display = ((WindowManager) getSystemService
        int width = display.getWidth();

But it gives me different values each time. How to find the exact

screen size of emulator?

by Dianne Hackborn » Thu, 10 Sep 2009 11:35:54 GMT

 You generally don't, your views get told the size they should be as part of
the view hierarchy layout.  Directly getting the size of the display is not
recommended, because it may have no relation to the actual space your UI has
available (such as if there are other screen decorations around, like a task
switcher or who knows what).

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. When to expect traffic overlay for UK?

Android Maps application has traffic overlay which works fine in the
US but doesn't show any overlay in the UK. Is there any expectation of
when this will be fixed? UK traffic is already working on the PC and
from Windows Mobile devices.


2. Some Useful Things someone should Integrate into the core apps.

Features I like to see on the G1/Android Operating System

Just check it out love Android and it does everything I want and
these might be some more plausable Ideas that can be reviewed and
added to future updates.

-Photo Address book
I would like to be able to see a picture next to the name and number
of the person I would like to call. It helps me since I have such a
large address book and when I want to call somebody I have to go
through a sea of names instead of just being able to look at a lot of
pictures which helps me identify who the person is that I would like
to speak to. The view should be in the same form is the contact list
is in now just a small picture to the right of the person name.
There should also be a grid view which lets me choose if I want to see
9 or 16 or 25 pics on the same screen (evn 25 might be a little to
much. And for contacts with no picture just have a filler pictuire
that says no picture.

-Photo Caller ID
I would like to be able to see a LARGE picture of the person that is
calling my phone. It should take up the whole green calling sqaure (at
least) and have the contact information below the screen. This would
make the picture much more useful and aesthetic for the phone when I
calling or receiving a call.

Call Log Condensing
An option to show just the people that have call history on the phone
(selectable via the menu button) would be nice. What you would do is
actually select iew by Contactand it would condense the whole call
log to just names and then you can long press the name in order to
either call the person or go into the history of everytime they have
an event in the call log. This option along with maybe an option to
view missed calls would be another valuable feature.

Contact Labels
As everyone knows Labels is arguably one of the best features in Gmail
and even though to do it in contacts would require a whole different
system of organization I believe that what works in one system can
work in the next if you play it out right. I have many contacts that
live in Houston and are my Houston Friends and I have others that Now
live in Austin but are still my Houston Friends and now Austin Friends
(by the way these are all roupsthat are set up on my phone). What
I would like to do is be able to add a contact under all contacts and
then label that contact as Houston, Austin, Austin Friends, Houston
Friends (on my phone of course) instead of having to make sure I have
the right Display Group in my contacts, adding the contact, then going
back to my computer and trying to add the person to the right group.
What I don want to have to do is file someone under my Houston
Friends and then not be able to see them under my (general) Houston
group or vice versa.

Camera Features
        People sometimes like chaging to Sepia and B&W modes for their
pictures. I mean the camera is just so not working for me. I would
like to for w/e reason beable to chage the resolution of the pictures,
chg from fine to superfine or medium, ability to change how much light
the camera let in while taking the pictures because the auto-adjust
(most of the time) doesn work in the user favor.

Music Shuffle
        A cool feature for the phone would be the ablity to shake the phone
in order to shuffle a song. I realize this feature might not work best
at all times but if constructed correctly in the software the it would
be perfect. I would like to be able to see the Album artworkin a large
(nearly fullscreen) format.

Integrated Voice Recorder+Notes
        Enough said..well it needs features and quality adjustments.

IM Picture contact list
        Enough saidt can be done on every other multi-IM client.

Accelerometer/Ranting about stuff that I sure people have though of

        Since Ie seen the fact that the G1 does have one built in the
ability to actually switch from portrait to landscape mode should be
as easy as it is in some other applications. I assuming that there
is a reason or patent infrindgement behind the reason it couldn be
done in the first installment but if there isn then it should be
more easily integrated in the Maps, Messaging, Browser and any other
Google App that is provided with the phone. As I said I sure there
is a reason for this.
Just as there is probably is a reason for no Google Docs App that
would better enable me to throw features of my phone into my friends
faces and beable to type up whole papers mobily like I was able to do
when I had my MDA from T-Mobile. And of course the classic... it sucks
having to open up the phone for everymessage that I type. Now when I
had my MDA I NEVER used the touch keyboard (because it SUCKED) but
with this chin in the way it makes 1 handed typing that much more
difficult; I believe my blackberry has spoiled me because I could type
ANYthing with just one hand and with two thumbs I was just a beast. I
sometimes feel that with the keyboard I could type just as effectively
on a touch screen which I never felt with the awesomeness of the
nimble BB Curve keypad. But that just emotion and who reallyq cares
since I love my phone and it fits everything I need in a phone:

- Full QWERTY hardware keyboard
-Nice/Big Screen (touch is nice)

-Add Loads of useful applications
- No Windows Mobile

The G1 is the Only phone that meets these specshe only other phoen
that comes close Is the blackberry Curve.


3. Android Based Stream Server

4. ProgressDialog woes...

5. Whether is android compatible with GWT?

6. (Service == Process)?

7. hardware information