Archive

Posts Tagged ‘string.xml’

Android tools – Droiddraw

January 20th, 2009

Droiddraw is a very good tool available to design the android screen layout files.
Let explore the tools in the today’s post.

The tools can be used directory through the browser. Here is the link for Online Droiddraw tool.

The tool can also be download from the above page, but it provide link for version r1b11. If you want to download version r1b12 get it from here .

Here is the tool image

droiddrawimage

The tool provides the android device screen, where user can design the application screens.
An option to change the device screen size is provide which shows all the screen sizes supported by the android device. There are also options to change the basic root layout of the activity xml.

The tool provides support for android basic Widgets like basic button, checkbox, RadioButtons etc. The tool also provides support advanced widgets like Calendar, Clock, TimePicker, ProgressBar, Gallery etc.The widgets can be added on the device screen by dragging and dropping them on the screen.

The layout tab provides android supported layouts like AbsoluteLayout, FrameLayout, LinearLayout etc.
The layouts can also be added on the device screen. The layout can contain other layouts out widgets.

The property tab shows configurable properties of the selected screen component (widget or layout).  Eg. Let’s add an EditText to the screen which can take only integer values (like age).

Drag the EditText widget from Widget tab and drop it on the screen view.
Adjust the position and size of the edit text as required.
Go to the Properties tab set the Id property as ‘@+id/ageEditText’
Keep Text property empty. Set the Number Format as integer.
Click Apply to set the properties.
Click on the Generate button.

Here is the xml generated for above EditText

<EditText
android:id="@+id/textEditText"
android:layout_width="320px"
android:layout_height="wrap_content"
android:text="EditText"
android:textSize="18sp"
android:layout_x="0px"
android:layout_y="2px"
>
</EditText>

Another tab is the Strings tab. The tab allows the user to define the string that can be referred in the application using resource class(R). The string goes in the res/values/string.xml file. String can be used for android:text property as @string/<string name>. It’s a good practice to use string instead of hard coded string values wherever possible. Android document suggest externalizing string as feature like localization and internationalization will be developed around them.  You can also load string in droiddraw if you have string.xml already defined. Go to the Project menu click on Load string resources and select the string xml from file system. The string from the xml will be loaded and shown in the string tab.

The next tabs are colors and arrays, which provide facility to define colors and array values respective. The color values goes in the res/values/colors.xml. And array values are stored in the res/values/arrays.xml.

As you can see using tool like Droiddraw you will never have to write the layout xml file by hand again.

Android Tools , , , , ,