• Solo Great Sale

    Solo Great Sale Powered By Circle Card 2015

  • Solo Great Sale

    Solo Great Sale Powered By Circle Card 2015

  • Oracle Java Magazine

    As Cover of Oracle Java Magazine March/April 2012 issue

  • Launching jDuchess Indonesia

    Gunadarma University 2011

    www.jduchess.or.id

  • Launching jDuchess Indonesia

    Gunadarma University 2011

    www.jduchess.or.id

  • Launching Java 7

    Binus University 2011

  • Eclipse Democamp

    Microsoft Indonesia 2011

  • Oracle Academy

    SMK PGRI 3 Malang 2010

  • Launching JENI 2.0

    ITB Bandung 2012

  • Oracle Academy

    SMK PGRI 3 Malang 2010

  • Java and Android Roadshow

    SMK PGRI 3 Malang 2012

  • Oracle Academy

    SMK PGRI 3 Malang 2010

  • Launching JENI 2.0

    ITB Bandung 2012

  • Oracle Academy

    SMK PGRI 3 Malang 2011

  • Java and Android Roadshow

    SMK Plus Darussalam Kediri 2012

  • Oracle Academy Seminar

    LIKMI Bandung, 2012

  • Oracle Academy Seminar

    Indonesia University, 2012

  • Seminar Android

    Universitas Budi Luhur 2010

  • Java and Android Roadshow

    SMK Hasan Kafrawi Jepara 2012

  • Sosialisasi Kurikulum 2013

    LPMP Surabaya 2013

  • IOSA

    Indonesia Open Source Award 2011

  • Java Training

    SMKN 02 Sukabumi 2010

  • Sosialisasi Kurikulum

    SMKN 01 Tulungagung 2011

  • Sosialisasi Kurikulum 2013

    LPMP Surabaya 2013

Wednesday, March 3, 2010

Posted by Netty Herawaty
| 10:07 PM
Penjelasan tentang macam - macam widget dasar di Android sudah saya jelaskan disini . Untuk bagaimana cara membuat widget tersebut dan menampilkannya di emulator Android ikuti petunjuk dibawah ini :

Buat deklarasi String pada file String.xml
<?xml version="1.0" encoding="utf-8"?>

<resources>

<string name="hello">Hello World, BasicWidgetActivity!</string>

<string name="app_name">BasicWidget</string>

<string name="profile">My Profile</string>

<string name="name">Name</string>

<string name="gender">Gender</string>

<string name="male">Male</string>

<string name="female">Female</string>

<string name="birth">Birth Date</string>

<string name="hobby">Hobby</string>

<string name="shopping">Shopping</string>

<string name="reading">Reading</string>

<string name="singing">Singing</string>

<string name="cancel">Cancel</string>

<string name="submit">Submit</string>

</resources>


Buat macam-macam widget pada file main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/profile"
android:textStyle="bold"
android:textSize="18dp"
android:gravity="center"/>
<TextView
android:id="@+id/text2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/name"/>
<EditText
android:id="@+id/edit1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:hint=""/>
<TextView
android:id="@+id/text3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/gender"/>
<RadioGroup
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<RadioButton
android:id="@+id/radio1"
android:layout_width="15mm"
android:layout_height="wrap_content"
android:text="@string/male"
android:checked="true"/>
<RadioButton
android:id="@+id/radio2"
android:layout_width="15mm"
android:layout_height="wrap_content"
android:text="@string/female"/>
</RadioGroup>
<TextView
android:id="@+id/text4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/birth"/>
<DatePicker
android:id="@+id/tanggal1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/text5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hobby"
/>
<TableRow
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<CheckBox
android:id="@+id/cb1"
android:layout_width="17mm"
android:layout_height="wrap_content"
android:text="@string/shopping"/>
<CheckBox
android:id="@+id/cb2"
android:layout_width="17mm"
android:layout_height="wrap_content"
android:text="@string/reading"/>
<CheckBox
android:id="@+id/cb3"
android:layout_width="17mm"
android:layout_height="wrap_content"
android:text="@string/singing"/>
</TableRow>
</LinearLayout>
</LinearLayout>
Jalankan code diatas dengan emulator Android seperti screenshot dibawah ini



Reactions: