Wednesday, May 31, 2017

Pengenalan Android

Android merupakan sistem operasi yang dikembangkan untuk perangkat mobile berbasis Linux. Pada awalnya sistem operasi ini dikembangkan oleh Android Inc. Yang kemudian dibeli oleh Google pada tahun 2005.
Dalam usaha mengembangkan Android, pada tahun 2007 dibentuklah Open Handset Alliance (OHA), sebuah konsorsium dari beberapa perusahaan, yaitu Texas Instruments, Broadcom Corporation, Google, HTC, Intel, LG, Marvell Technology Group, Motorola, Nvidia, Qualcomm, Samsung Electronics, Sprint Nextel, dan T-Mobile dengan tujuan untuk mengembangkan standar terbuka untuk perangkat mobile. Pada taanggal 9 Desember 2008, ia diumumkan bahwa 14 anggota baru akan bergabung Proyek Android, termasuk PacketVideo, ARM Holdings, Atheros Communications, Asustek Computer Inc, Garmin Ltd, Softbank, Sony Ericsson, Toshiba Corp dan Vodafone Group Plc.

Istilah smartphone tak bisa lepas dari dua sistem operasi yang menandai popularitasnya, yakni iOS buatan Apple dan Android buatan Google.
Mulanya, Apple meluncurkan iPhone pertama bersistem operasi iOS (kala itu dinamai iPhone OS 1) pada 2007 silam. Ponsel itu menjadi cikal bakal tren smartphone hari ini. Setahun setelahnya, pada 2008, Android pertama untuk smartphone lahir dan disematkan pada HTC Dream.
Perbedaan paling signifikan antara iOS dan Android tampak pada prinsip keterbukaannya. Apple memilih menciptakan iOS secara eksklusif untuk iPhone, sementara Google membuat Android secara terbuka untuk semua vendor yang ingin bekerja sama.
Prinsip tersebut yang membuat Android menjadi sistem operasi paling populer saat ini. Perjalanan Android pun sudah sampai ke generasi ke tujuh dalam sembilan tahun terakhir. Berikut sejarah perjalanan singkatnya, sebagaimana dilaporkan DigitalTrends dan dihimpun KompasTekno, Senin (17/10/2016).
1. Android 1.0 (2008)
http://assets.kompas.com/data/photo/2016/05/27/0000293ponsel-3340x340.jpg
Keyboard QWERTY model geser pada smartphone Android pertama, HTC Dream(Wikipedia)
Sistem operasi ini bisa dibilang sebagai Android bayi yang masih sangat sederhana. Pengguna diajak beradaptasi dengan peradaban baru dalam menjajal sebuah perangkat telekomunikasi mobile.
Jika hari ini kita terbiasa menggulir layar ke bawah untuk melihat notifikasi, perlu diketahui bahwa asal-muasalnya dari Android 1.0 ini.
Sebab, di versi inilah Google untuk pertama kalinya memperkenalkan mekanisme pengecekan notifikasi yang kerap diistilahkan pull-down notification tersebut.
Selain notifikasi, dua komponen pada Android 1.0 yang masih digunakan hingga kini adalah widget aplikasi, serta toko aplikasi Google Play Store yang kala itu masih bertajuk "Market".
Sistem operasi ini juga menyatukan layanan Gmail. Dua aplikasi tersebut, Gmail dan Market, menjadi layanan bawaan paling purba yang dipatrikan Google pada Android 1.0.
2. Android 1.5 Cupcake (2009)
Ini adalah debut versi Android yang menggunakan nama kudapan manis. Tradisi tersebut dipertahankan hingga sekarang.
Pada Cupcake, Google juga memperkenalkan SDK widget untuk developer pihak ketiga. Gunanya agar aplikasi pihak ketiga bisa memiliki widget sendiri layaknya aplikasi bawaan Google.
Dua pembaruan signifikan pada Cupcake juga meliputi kemampuan perekaman video dengan kamera ponsel, serta kemampuan keyboard layar sentuh.
3. Android 1.6 Donut (2009)
Masih di tahun yang sama, Google tak sabar menghadirkan Android baru bertajuk "Donut". Pada versi ini, Google mengumumkan bahwa Android bisa digunakan untuk perangkat mobile dengan ukuran layar berapa saja.
Android Donut juga memunculkan kolom pencarian pada antarmuka ponsel. Pengguna bisa mencari informasi di internet, file lokal, kontak, dan apa saja secara lebih cepat dengan kolom tersebut.
4. Android 2.0 Eclair (2009)
2009 memang merupakan tahun produktif bagi Google dalam menelurkan sistem operasi. Eclair menjadi Android pertama yang menghadirkan layanan navigasi Google Maps.
Sistem tersebut menjadi awal mula era GPS yang sekarang bukan cuma ada di ponsel, tapi juga di mobil-mobil modern. Eclair juga menjadi Android pertama yang mendukung HTML5 pada peramban sehingga bisa memutar video.
Kemampuan membuka layar alias unlock-screen dengan mekanisme menyapu atau swipe juga diperkenalkan pada Eclair.
5. Android 2.2 Froyo (2010)
http://assets.kompas.com/data/photo/2016/10/17/1656059lula780x390.jpg
Nexus One(Google)
Tahun 2010, selain meluncurkan Android Froyo, Google juga menghadirkan ponsel Nexus pertama yang dinamai "Nexus One". Ada beberapa pembaruan pada Froyo dibandingkan pendahulunya. Tentu saja pengguna Nexus One menjadi yang pertama mendapat update Android tersebut.
Dari segi tampilan, Android Froyo memungkinkan lima panel layar depan alias home screen. Sebelumnya, batas panel cuma sampai tiga saja.
Froyo juga menambah pilihan keamanan penguncian bagi pengguna. Dari yang sebelumnya cuma penguncian pola (pattern lock), belakangan dilengkapi dengan opsi penguncian PIN atau PIN lock.
6. Android 2.3 Gingerbread (2010)
Menyadari kebutuhan netizen akan selfie, Google pun membangun versi Gingerbread dengan kemampuan kamera depan untuk membidik foto mandiri. Pada versi ini, pengguna juga bisa melihat desain ulang antarmuka yang cukup signifikan.
Selain itu, dari segi fungsi, Gingerbread memungkinkan pengguna memencet keyboard virtual secara berbarengan alias multitouch. Kemampuan ini dipertahankan hingga sekarang dengan berbagai peningkatan kinerja.
7. Android 3.0 Honeycomb (2011)
Sistem operasi ini mendukung kemampuan tombol virtual untuk home, back, dan menu, untuk pertama kalinya. Sasarannya pun lebih ke perangkat tablet ketimbang smartphone. Pada masa itu, memang pasar tablet sedang subur-suburnya.
8. Android 4.0 Ice Cream Sandwich (2011)
Versi ini memboyong kemampuan pada Honeycomb tapi lebih menyasar smartphone. Contohnya saja kemampuan tombol virtual yang hingga sekarang banyak diimplementasikan para vendor.
Beberapa pembaruan fitur lainnya mencakup kemampuan membuka layar menggunakan wajah (face unlock), analisa penggunaan data internet, serta paket aplikasi bawaan dari vendor yang mencakup kalendar, mail, kalkulator, dan lainnya.
9. Android 4.1 Jelly Bean (2012)
Nah, ini dia versi Android yang membawa pembaruan cukup signifikan setelah beberapa kali update yang dilakukan Google hanya membawa perbedaan minor.
Salah satunya, Jelly Bean memungkinkan pengguna menggulir (scroll) cepat home screen ke bawah untuk melihat kumpulan informasi penting, seperti agenda, email, dan laporan cuaca. Sebelumnya, pengguliran ke bawah cuma memperlihatkan notifikasi aplikasi.
Selain itu, Jelly Bean merupakan upaya pertama Google untuk menghadirkan asisten digital yang dinamai Google Now. Mulai dari versi ini, Google semakin berhasrat untuk membuat asisten digital yang lebih hidup, manusiawi, dan relevan bagi pengguna.
10. Android 4.4 KitKat (2013)
http://assets.kompas.com/data/photo/2013/09/04/0306175Maskot-Android-KitKat1780x390.jpg
Maskot Android KitKat(Dokumentasi Sundar Pichai, kepala produk Android dan Chrome, via Google )
Butuh setahun bagi Google untuk menghadirkan KitKat. Versi Android ini memberikan suasana yang segar dengan pembaruan antarmuka beraksen putih dan biru muda.
Pada KitKat, Google menghadirkan perintah pencarian menggunakan suara atau disebut "Ok, Google". Fitur ini dirundung puji-pujian dari para pakar teknologi.
Di saat bersamaan, Google juga meluncurkan aplikasi pesan singkat Hangouts untuk pertama kalinya. Sayangnya, belakangan Hangouts dilabeli sebagai layanan Google yang gagal karena tak menuai penetrasi yang memuaskan.
11. Android 5.0 Lollipop (2014)
Pembaruan yang mencolok pada Lollipop tampak dari sisi desainnya yang diperhalus dan disesuaikan dengan zaman. Selain itu, fitur-fitur yang sudah hadir pada Android sebelumnya ditingkatkan.
Inovasi kurang terasa pada versi ini. Satu-satunya yang lumayan baru adalah dukungan untuk gambar berformat RAW. Format itu memungkinkan para ilustrator, fotografer, atau graphic designer menyimpan file dengan ukuran besar agar bisa diedit tanpa mengurangi kualitas.
12. Android 6.0 Marshmallow (2015)
Menu aplikasi pada Android Marshmallow benar-benar dibuat baru. Desainnya membuat pengguna merasa naik kelas dari versi sebelumnya karena lebih dinamis.
Selain itu, ada juga fitur memory manager yang memungkinkan pengguna mengecek penggunaan memori pada tiap aplikasi. Rentan waktu pengecekannya bisa disetel dari tiga jam yang lalu hingga 24 jam sebelumnya.
Pembaruan kedua ditilik dari pengaturan volume. Pada Marshmallow, pengguna bisa mengontrol volume yang berbeda-beda pada panggilan, media, dan alarm.
Keamanan juga mendapat peningkatan pada versi ini. Google memungkinkan vendor menyematkan sensor pemindai sidik jari karena sudah didukung Marshmallow.
13. Android 7.0 Nougat (2016)
http://assets.kompas.com/data/photo/2016/08/23/0735059lg-v20780x390.jpg
Google benarkan LG v20 sebagai ponsel baru pertama dengan Android Nougat 7.0.(Google)
Nougat adalah versi Android termutakhir yang baru diperkenalkan pada ajang kumpul developer Google I/O, pertengahan 2016 ini. Beberapa lama setelahnya, Google menghadirkan Nougat secara resmi untuk publik.
Pembaruan paling mendasar pada versi Nougat adalah kehadiran Google Assistant yang menggantikan Google Now. Asisten digital tersebut lebih bisa diandalkan untuk menjalankan pelbagai fungsi.
Fitur-fitur baru lainnya mencakup layar split-screen saat dipakai multitasking, serta fitur Doze yang telah dikenalkan di versi Android Marshmallow namun telah ditingkatkan. Android Nougat juga memiliki dukungan terhadap platform virtual reality terbaru Google.

Friday, May 26, 2017

CRUD dengan Menggunakan SQLite

Membuat CRUD dengan Menggunakan SQLite..

SQLite adalah database yang berukuran kecil , berdiri sendiri, bukan database client server, tanpa konfigurasi namun mempunyai fitur penuh perintah SQL. Agar lebih jelas tenang sqlite akan saya jelaskan dalam format FAQ. sudah terjawab diawal artikel ini, namun singkatnya SQLite adalah database SQL embeded.

Proses Pembuatan :
  1. Buka Android Studio
  2. Buat Projek Baru
  3. Berinama Projek yang akan kita buat
  4. kita harus menentukan Target Android Device nya , saya pilih API 15.
  5. Pilih Empty Activity
  6. Selanjutnya pada bagian Customize The Activity biarkan saja default
  7. Setelah ke 6 langkah tadi selesai kita buat DataHelper.java ,
DataHelper.java ini adalah proses pembuatan Database SQLiteSimpan dengan Nama DataHelper.java
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DataHelper extends SQLiteOpenHelper {

   private static final String DATABASE_NAME = "biodatadiri.db";
   private static final int DATABASE_VERSION = 1;
   public DataHelper(Context context) {
       super(context, DATABASE_NAME, null, DATABASE_VERSION);
       // TODO Auto-generated constructor stub
   }
   @Override
   public void onCreate(SQLiteDatabase db) {
       // TODO Auto-generated method stub
       String sql = "create table biodata(no integer primary key, nama text null, tgl text null, jk text null, alamat text null);";
       Log.d("Data", "onCreate: " + sql);
       db.execSQL(sql);
       sql = "INSERT INTO biodata (no, nama, tgl, jk, alamat) VALUES ('1', 'Darsiwan', '1996-07-12', 'Laki-laki','Indramayu');";
       db.execSQL(sql);
   }
   @Override
   public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
       // TODO Auto-generated method stub
   }
}
  1. Kita buat layout xml pada activity_main.xml activity_main.xml

<RelativeLayout 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"
               android:paddingBottom="@dimen/activity_vertical_margin"
               android:paddingLeft="@dimen/activity_horizontal_margin"
               android:paddingRight="@dimen/activity_horizontal_margin"
               android:paddingTop="@dimen/activity_vertical_margin"
               android:background="#ecf0f1"
               tools:context=".MainActivity" >
    <ListView
       android:id="@+id/listView1"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignParentTop="true"
       android:layout_alignParentRight="true"
       android:layout_alignParentEnd="true"
       android:layout_above="@+id/button2">
    </ListView>
    <Button
       android:id="@+id/button2"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       style="?android:attr/borderlessButtonStyle"
       android:drawableLeft="@drawable/icon_add"
       android:text="Buat Biodata Baru"
       android:layout_alignParentBottom="true"
       android:layout_alignParentLeft="true"
       android:layout_alignParentStart="true" />
</RelativeLayout>

  1. kita tuliskan source di bawah pada MainActivity.java

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class MainActivity extends AppCompatActivity {
   String[] daftar;
   ListView ListView01;
   Menu menu;
   protected Cursor cursor;
   DataHelper dbcenter;
   public static MainActivity ma;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);

       Button btn=(Button)findViewById(R.id.button2);

       btn.setOnClickListener(new View.OnClickListener() {

           @Override
           public void onClick(View arg0) {
               // TODO Auto-generated method stub
               Intent inte = new Intent(MainActivity.this, BuatBiodata.class);
               startActivity(inte);
           }
       });


       ma = this;
       dbcenter = new DataHelper(this);
       RefreshList();
   }

   public void RefreshList(){
       SQLiteDatabase db = dbcenter.getReadableDatabase();
       cursor = db.rawQuery("SELECT * FROM biodata",null);
       daftar = new String[cursor.getCount()];
       cursor.moveToFirst();
       for (int cc=0; cc < cursor.getCount(); cc++){
           cursor.moveToPosition(cc);
           daftar[cc] = cursor.getString(1).toString();
       }
       ListView01 = (ListView)findViewById(R.id.listView1);
       ListView01.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, daftar));
       ListView01.setSelected(true);
       ListView01.setOnItemClickListener(new OnItemClickListener() {


           public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) {
               final String selection = daftar[arg2]; //.getItemAtPosition(arg2).toString();
               final CharSequence[] dialogitem = {"Lihat Biodata", "Update Biodata", "Hapus Biodata"};
               AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
               builder.setTitle("Pilihan");
               builder.setItems(dialogitem, new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int item) {
                       switch(item){
                           case 0 :
                               Intent i = new Intent(getApplicationContext(), LihatBiodata.class);
                               i.putExtra("nama", selection);
                               startActivity(i);
                               break;
                           case 1 :
                               Intent in = new Intent(getApplicationContext(), UpdateBiodata.class);
                               in.putExtra("nama", selection);
                               startActivity(in);
                               break;
                           case 2 :
                               SQLiteDatabase db = dbcenter.getWritableDatabase();
                               db.execSQL("delete from biodata where nama = '"+selection+"'");
                               RefreshList();
                               break;
                       }
                   }
               });
               builder.create().show();
           }});
       ((ArrayAdapter)ListView01.getAdapter()).notifyDataSetInvalidated();
   }

}

  1. Buat 3 Empty Activity baru
E:\Hendra Agus\SEMESTER IV\Pemrograman Mobile 1\Laporan\Blog\1.PNG


Berinama Layout Name sebagai berikut :
1) activity_buat_biodata.xml
2) activity_lihat_biodata.xml 3.activity_update_biodata.xml
Dan Activity Name :
  1. BuatBiodata.java
  2. LihatBiodata.java 3.UpdateBiodata.java

  1. Setelah ke 3 Activity tadi di buat tuliskan pada layout xml dengan nama masing masing :

 1) activity_buat_biodata.xml

<RelativeLayout 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"
               android:paddingBottom="@dimen/activity_vertical_margin"
               android:paddingLeft="@dimen/activity_horizontal_margin"
               android:paddingRight="@dimen/activity_horizontal_margin"
               android:paddingTop="@dimen/activity_vertical_margin"
               tools:context=".BuatBiodata" >

    <EditText
       android:id="@+id/editText1"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView1"
       android:layout_below="@+id/textView1"
       android:inputType="number"
       android:maxLength="10">

        <requestFocus />
    </EditText>

    <TextView
       android:id="@+id/textView1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentLeft="true"
       android:layout_alignParentTop="true"
       android:text="Nomor" />

    <TextView
       android:id="@+id/textView2"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText1"
       android:layout_below="@+id/editText1"
       android:layout_marginTop="10dp"
       android:text="Nama" />

    <EditText
       android:id="@+id/editText2"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView2"
       android:layout_below="@+id/textView2"
       android:inputType="text"
       android:maxLength="20"/>

    <TextView
       android:id="@+id/textView3"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText2"
       android:layout_below="@+id/editText2"
       android:layout_marginTop="10dp"
       android:text="Tanggal Lahir" />

    <EditText
       android:id="@+id/editText3"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView3"
       android:layout_below="@+id/textView3"
       android:inputType="date"/>

    <TextView
       android:id="@+id/textView4"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText3"
       android:layout_below="@+id/editText3"
       android:layout_marginTop="10dp"
       android:text="Jenis Kelamin" />

    <EditText
       android:id="@+id/editText4"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView4"
       android:layout_below="@+id/textView4"
       android:inputType="text"
       android:maxLength="1"
       android:hint="L atau P"/>

    <TextView
       android:id="@+id/textView5"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText4"
       android:layout_below="@+id/editText4"
       android:layout_marginTop="10dp"
       android:text="Alamat" />

    <EditText
       android:id="@+id/editText5"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView5"
       android:layout_below="@+id/textView5"
       android:maxLength="100"
       android:inputType="text"/>

    <Button
       android:id="@+id/button1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText5"
       android:layout_alignParentBottom="true"
       style="?android:attr/borderlessButtonStyle"
       android:drawableLeft="@drawable/ic_done"
       android:text="Simpan" />

    <Button
       android:id="@+id/button2"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="Kembali"
       style="?android:attr/borderlessButtonStyle"
       android:drawableLeft="@drawable/ic_arrow"
       android:layout_alignParentBottom="true"
       android:layout_alignRight="@+id/editText5"
       android:layout_alignEnd="@+id/editText5" />

</RelativeLayout>

 2) activity_lihat_biodata.xml

<RelativeLayout 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"
               android:paddingBottom="@dimen/activity_vertical_margin"
               android:paddingLeft="@dimen/activity_horizontal_margin"
               android:paddingRight="@dimen/activity_horizontal_margin"
               android:paddingTop="@dimen/activity_vertical_margin"
               tools:context=".LihatBiodata" >

    <TextView
       android:id="@+id/textView1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentRight="true"
       android:layout_alignParentTop="true"
       android:layout_marginRight="104dp"
       android:layout_marginTop="20dp"
       android:text="TextView" />

    <TextView
       android:id="@+id/textView2"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignRight="@+id/textView1"
       android:layout_below="@+id/textView1"
       android:layout_marginTop="20dp"
       android:text="TextView" />

    <TextView
       android:id="@+id/textView3"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView2"
       android:layout_below="@+id/textView2"
       android:layout_marginTop="20dp"
       android:text="TextView" />

    <TextView
       android:id="@+id/textView4"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView3"
       android:layout_below="@+id/textView3"
       android:layout_marginTop="20dp"
       android:text="TextView" />

    <TextView
       android:id="@+id/textView5"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignRight="@+id/textView4"
       android:layout_below="@+id/textView4"
       android:layout_marginTop="20dp"
       android:text="TextView" />

    <TextView
       android:id="@+id/TextView05"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignBaseline="@+id/textView5"
       android:layout_alignBottom="@+id/textView5"
       android:layout_alignLeft="@+id/TextView03"
       android:text="Alamat" />

    <TextView
       android:id="@+id/TextView03"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignBaseline="@+id/textView4"
       android:layout_alignBottom="@+id/textView4"
       android:layout_alignLeft="@+id/TextView04"
       android:text="Jenis Kelamin" />

    <TextView
       android:id="@+id/TextView04"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignBaseline="@+id/textView3"
       android:layout_alignBottom="@+id/textView3"
       android:layout_alignLeft="@+id/TextView02"
       android:text="Tanggal Lahir" />

    <TextView
       android:id="@+id/TextView02"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignBaseline="@+id/textView2"
       android:layout_alignBottom="@+id/textView2"
       android:layout_alignLeft="@+id/TextView01"
       android:text="Nama" />

    <TextView
       android:id="@+id/TextView01"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_above="@+id/textView2"
       android:layout_alignParentLeft="true"
       android:text="Nomor" />

    <Button
       android:id="@+id/button1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/TextView05"
       android:layout_below="@+id/TextView05"
       android:layout_marginTop="34dp"
       android:text="Kembali"
       style="?android:attr/borderlessButtonStyle"
       android:drawableLeft="@drawable/ic_arrow"/>

</RelativeLayout>

  1. activity_update_biodata.xml 

<RelativeLayout 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"
               android:paddingBottom="@dimen/activity_vertical_margin"
               android:paddingLeft="@dimen/activity_horizontal_margin"
               android:paddingRight="@dimen/activity_horizontal_margin"
               android:paddingTop="@dimen/activity_vertical_margin"
               tools:context=".UpdateBiodata" >

    <EditText
       android:id="@+id/editText1"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView1"
       android:layout_below="@+id/textView1"
       android:inputType="number"
       android:maxLength="10">

        <requestFocus />
    </EditText>

    <TextView
       android:id="@+id/textView1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentLeft="true"
       android:layout_alignParentTop="true"
       android:text="Nomor" />

    <TextView
       android:id="@+id/textView2"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText1"
       android:layout_below="@+id/editText1"
       android:layout_marginTop="10dp"
       android:text="Nama" />

    <EditText
       android:id="@+id/editText2"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView2"
       android:layout_below="@+id/textView2"
       android:inputType="text"
       android:maxLength="20"/>

    <TextView
       android:id="@+id/textView3"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText2"
       android:layout_below="@+id/editText2"
       android:layout_marginTop="10dp"
       android:text="Tanggal Lahir" />

    <EditText
       android:id="@+id/editText3"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView3"
       android:layout_below="@+id/textView3"
       android:inputType="date"/>

    <TextView
       android:id="@+id/textView4"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText3"
       android:layout_below="@+id/editText3"
       android:layout_marginTop="10dp"
       android:text="Jenis Kelamin" />

    <EditText
       android:id="@+id/editText4"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView4"
       android:layout_below="@+id/textView4"
       android:inputType="text"
       android:maxLength="1"
       android:hint="L atau P"/>

    <TextView
       android:id="@+id/textView5"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText4"
       android:layout_below="@+id/editText4"
       android:layout_marginTop="10dp"
       android:text="Alamat"
       android:inputType="text"
       android:maxLength="100"/>

    <EditText
       android:id="@+id/editText5"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/textView5"
       android:layout_below="@+id/textView5" />

    <Button
       android:id="@+id/button1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignLeft="@+id/editText5"
       android:layout_alignParentBottom="true"
       style="?android:attr/borderlessButtonStyle"
       android:drawableLeft="@drawable/ic_done"
       android:text="Update" />

    <Button
       android:id="@+id/button2"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="Kembali"
       style="?android:attr/borderlessButtonStyle"
       android:drawableLeft="@drawable/ic_arrow"
       android:layout_alignParentBottom="true"
       android:layout_alignRight="@+id/editText5"
       android:layout_alignEnd="@+id/editText5"
       />

</RelativeLayout>

12. Tuliskan baris kode java class di bawah dengan nama masing-masing : 
1) BuatBiodata.java

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class BuatBiodata extends AppCompatActivity {
   protected Cursor cursor;
   DataHelper dbHelper;
   Button ton1, ton2;
   EditText text1, text2, text3, text4, text5;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_buat_biodata);

       dbHelper = new DataHelper(this);
       text1 = (EditText) findViewById(R.id.editText1);
       text2 = (EditText) findViewById(R.id.editText2);
       text3 = (EditText) findViewById(R.id.editText3);
       text4 = (EditText) findViewById(R.id.editText4);
       text5 = (EditText) findViewById(R.id.editText5);
       ton1 = (Button) findViewById(R.id.button1);
       ton2 = (Button) findViewById(R.id.button2);

       ton1.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View arg0) {
               // TODO Auto-generated method stub
               SQLiteDatabase db = dbHelper.getWritableDatabase();
               db.execSQL("insert into biodata(no, nama, tgl, jk, alamat) values('" +
                       text1.getText().toString() + "','" +
                       text2.getText().toString() + "','" +
                       text3.getText().toString() + "','" +
                       text4.getText().toString() + "','" +
                       text5.getText().toString() + "')");
               Toast.makeText(getApplicationContext(), "Berhasil", Toast.LENGTH_LONG).show();
               MainActivity.ma.RefreshList();
               finish();
           }
       });
       ton2.setOnClickListener(new View.OnClickListener() {

           @Override
           public void onClick(View arg0) {
               // TODO Auto-generated method stub
               finish();
           }
       });
   }

}

2)LihatBiodata.java

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class LihatBiodata extends AppCompatActivity {
   protected Cursor cursor;
   DataHelper dbHelper;
   Button ton2;
   TextView text1, text2, text3, text4, text5;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_lihat_biodata);

       dbHelper = new DataHelper(this);
       text1 = (TextView) findViewById(R.id.textView1);
       text2 = (TextView) findViewById(R.id.textView2);
       text3 = (TextView) findViewById(R.id.textView3);
       text4 = (TextView) findViewById(R.id.textView4);
       text5 = (TextView) findViewById(R.id.textView5);
       SQLiteDatabase db = dbHelper.getReadableDatabase();
       cursor = db.rawQuery("SELECT * FROM biodata WHERE nama = '" +
               getIntent().getStringExtra("nama") + "'",null);
       cursor.moveToFirst();
       if (cursor.getCount()>0)
       {
           cursor.moveToPosition(0);
           text1.setText(cursor.getString(0).toString());
           text2.setText(cursor.getString(1).toString());
           text3.setText(cursor.getString(2).toString());
           text4.setText(cursor.getString(3).toString());
           text5.setText(cursor.getString(4).toString());
       }
       ton2 = (Button) findViewById(R.id.button1);
       ton2.setOnClickListener(new View.OnClickListener() {

           @Override
           public void onClick(View arg0) {
               // TODO Auto-generated method stub
               finish();
           }
       });
   }

}

3) UpdateBiodata.java
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class UpdateBiodata extends AppCompatActivity {
   protected Cursor cursor;
   DataHelper dbHelper;
   Button ton1, ton2;
   EditText text1, text2, text3, text4, text5;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_update_biodata);

       dbHelper = new DataHelper(this);
       text1 = (EditText) findViewById(R.id.editText1);
       text2 = (EditText) findViewById(R.id.editText2);
       text3 = (EditText) findViewById(R.id.editText3);
       text4 = (EditText) findViewById(R.id.editText4);
       text5 = (EditText) findViewById(R.id.editText5);
       SQLiteDatabase db = dbHelper.getReadableDatabase();
       cursor = db.rawQuery("SELECT * FROM biodata WHERE nama = '" +
               getIntent().getStringExtra("nama") + "'",null);
       cursor.moveToFirst();
       if (cursor.getCount()>0)
       {
           cursor.moveToPosition(0);
           text1.setText(cursor.getString(0).toString());
           text2.setText(cursor.getString(1).toString());
           text3.setText(cursor.getString(2).toString());
           text4.setText(cursor.getString(3).toString());
           text5.setText(cursor.getString(4).toString());
       }
       ton1 = (Button) findViewById(R.id.button1);
       ton2 = (Button) findViewById(R.id.button2);
       // daftarkan even onClick pada btnSimpan
       ton1.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View arg0) {
               // TODO Auto-generated method stub
               SQLiteDatabase db = dbHelper.getWritableDatabase();
               db.execSQL("update biodata set nama='"+
                       text2.getText().toString() +"', tgl='" +
                       text3.getText().toString()+"', jk='"+
                       text4.getText().toString() +"', alamat='" +
                       text5.getText().toString() + "' where no='" +
                       text1.getText().toString()+"'");
               Toast.makeText(getApplicationContext(), "Berhasil", Toast.LENGTH_LONG).show();
               MainActivity.ma.RefreshList();
               finish();
           }
       });
       ton2.setOnClickListener(new View.OnClickListener() {

           @Override
           public void onClick(View arg0) {
               // TODO Auto-generated method stub
               finish();
           }
       });
   }

}

13) Jalankan Aplikasinya ....
E:\Hendra Agus\SEMESTER IV\Pemrograman Mobile 1\Laporan\Blog\2.PNGE:\Hendra Agus\SEMESTER IV\Pemrograman Mobile 1\Laporan\Blog\3.PNG

Terima Kasih ..