07.01.2013 Views

David Defour - Université de Perpignan

David Defour - Université de Perpignan

David Defour - Université de Perpignan

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.

jeudi 26 janvier 12<br />

OVERALL WIDGET PROJECT<br />

LAYOUT<br />

Java co<strong>de</strong><br />

Images and XML files that refer to sets of images. The<br />

layout files will refer to these images via @drawable/<br />

base_file_name (e.g., @drawable/gps). The first<br />

ImageButton example will use an image file, and the<br />

second ImageButton example will use an XML file<br />

containing references to image files.<br />

Layout files. The Java co<strong>de</strong> will refer to the overall layouts via<br />

R.layout.base_file_name (R.layout.main, R.layout.buttons, etc.). The<br />

Java co<strong>de</strong> will refer to specific GUI elements with<br />

findViewById(R.id.element_id).<br />

Strings. The Java co<strong>de</strong> will refer to these via<br />

getString(R.string.string_name). The layout files will refer to these with<br />

@string/string_name. You can also <strong>de</strong>fine arrays of strings here, or put the<br />

arrays in a separate file typically called arrays.xml. Arrays are used in the<br />

next lecture on Spinners.<br />

In or<strong>de</strong>r for one Activity to start another Activity in the same project, you need some<br />

entries in here. See Spinner lecture.

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

Saved successfully!

Ooh no, something went wrong!