1

I am currently putting together an application for my HTC Evo 3D phone which has a screen resolution of 960x540. I have set up a custom layout configuration for designing the interface at this resolution. When in this configuration the widgets (texts views, seek bars etc.) appear small and compact, sparse on the screen. Whereas when I launch the application on my phone the buttons are considerably larger and fill the screen more. Is there some setting in Eclipse that will allow me to view the layout in the editor exactly as it would appear on my phone, allowing for easier design of the interface.

Many thanks, Mat.

  • "I have set up a custom layout configuration for designing the interface at this resolution" -- what precisely does this mean? "Is there some setting in Eclipse" -- what preview device setting are you presently using? When you created an emulator for your desired device characteristics, and set the graphical layout preview to that emulator device definition, what happened? – CommonsWare Feb 17 '13 at 21:17
  • Apologies for my bad explanation, I actually meant custom device configuration for my phone at the correct resolution. I am previewing the app by sending it directly to my phone rather than using an emulator. – Mat Jenkins Feb 17 '13 at 22:21
  • "I actually meant custom device configuration for my phone at the correct resolution" -- what precisely does this mean? "I am previewing the app by sending it directly to my phone rather than using an emulator" -- if you are not using the graphical layout editor and its preview mode, why are you complaining about it? If you *are* using the graphical layout editor, then when you created an emulator for your desired device characteristics, and set the graphical layout preview to that emulator device definition, what happened? – CommonsWare Feb 17 '13 at 22:34

1 Answers1

0

with relevant code would be easer to help, however, if you are using dp unit measure, sizes will change according to resolution:screensize, not just resolution. I think also a "wrap_content" given to a textview/button etc. would change in size, because font size would be in sp. So, look if there is any emulator configuration that fits real device resolution AND screen size. Take a look here for more info about measure units.
EDIT
so are you seeing it in eclipse in the graphical layout of yourlayout.xml? on the top bar of that window there's a dropmenu for display configurations, change it to see the layout in different screens (I don't see any 960x540 btw). however, if you really want to develop for one single device is a matter, but if you're going to release the app for different devices, you need some strategy to make flexible layouts. this is very useful.

Community
  • 1
  • 1
lelloman
  • 13,883
  • 5
  • 63
  • 85
  • Thank you and yeah I am using measurements in dp. I am launching the app directly to my phone so the screen size should be correct, no idea why it appears different in Eclipse. I am currently working around this by arranging elements individually and then running the app on my phone to check the layout look correct and adjusting accordingly, a bit long winded but can be done. – Mat Jenkins Feb 17 '13 at 22:24