Sunday, September 28, 2014

How to Build a Simple Clock for an Android in Eclipse

Instructions

    1

    Open the Android Eclipse programming software and open the Android project you want to edit. Double-click the XML file for your app.

    2

    Add the "LinearLayout" tag container. This container holds the objects such as buttons, text and the clock, so you can display the objects in one screen. Add the following code:
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    3

    Add the clock tag to display the object in the layout container. Place the following code in the LinearLayout tag container:
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

    4

    Click the "Save" button and click "Run" to execute the code in the Android emulator.



No comments:

Post a Comment