Android Development Notes
XML and GUI Building

Ugh, I guess I will assent to working with XML to the extent that it is necessary.  Why would you use XML for an intra-IDE data format?!  For God’s sake, it’s an IDE!  The data format can be whatever you want!  Just make the interface not suck, and—oh.  Well, there’s my answer.

The raw basics for layout actually aren’t bad:


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical" 
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/MyColor"
> <EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:inputType="numberSigned|numberDecimal"></EditText> <RadioGroup android:id="@+id/RadioGroup01" android:layout_width="wrap_content" android:layout_height="wrap_content"> <RadioButton android:id="@+id/RadioButton01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/celsius" android:checked="true"></RadioButton> <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/fahrenheit"></RadioButton> </RadioGroup> <Button android:id="@+id/Button01" android:layout_height="wrap_content" android:onClick="@string/buttonHandler" android:layout_width="wrap_content" android:text="@string/calc"></Button> </LinearLayout>

I’m sure it gets hairier once you start building really complex and functional interfaces, but this doesn’t have any of the bloat that usually makes me terrified of XML.  Also, I like the way it separates constants like strings and colors from the actual layout by letting you reference an XML file (as in android:text=”@string/someconstant”).  I wonder how much of this is Eclipse, how much of it is Eclipse Helios, and how much of it is the Android SDK.