30.04.2013 Views

Android - CommonsWare

Android - CommonsWare

Android - CommonsWare

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Handling Multiple Screen Sizes<br />

scaling that <strong>Android</strong> would do if we said we did not support certain screen<br />

sizes.<br />

Our main layout is size-independent, as it is just a full-screen ListView:<br />

<br />

<br />

Our row, though, will eventually need some tweaking:<br />

<br />

<br />

<br />

<br />

<br />

For example, right now, our font size is set to be 20px, which will not vary<br />

by screen size or density.<br />

Our EU4You activity is a bit verbose, mostly because there are a lot of EU<br />

members, and we have to have the smarts to display the flag and the text in<br />

the row:<br />

package com.commonsware.android.eu4you;<br />

import android.app.ListActivity;<br />

import android.content.Intent;<br />

456<br />

Subscribe to updates at http://commonsware.com Special Creative Commons BY-SA 3.0 License Edition

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!