A. Buat Project
Buatlah project baru dengan konfigurasi yang sama seperti tugas sebelumnya atau bisa dilihat kembali pada pengerjaan tugas modul 3, minggu lalu. Lalu save dengan nama latihan4_marizkaB. Coding
1. Masukan source code dibawah ini pada activity_main.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:orientation="vertical"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Username" android:inputType="text"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Password" android:inputType="numberPassword" android:minHeight="40dp"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Email" android:inputType="textEmailAddress" android:minHeight="40dp"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Phone" android:inputType="number" android:minHeight="40dp"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Website" android:inputType="text" android:minHeight="40dp"/> <RadioGroup android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Jenis Kelamin" android:textSize="15sp" /> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:hint="Laki-laki"/> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:hint="Perempuan"/> </RadioGroup> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:text="register" android:backgroundTint="@color/teal_700"/> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="Login" android:backgroundTint="@color/design_default_color_primary_dark"/> </LinearLayout> |
2. Setelah itu kita Run di virtual emulator android
3. Berikut tampilan pada virtual emulator ketika sudah di run


Comments
Post a Comment