MOBILE PROGRAMMING
- NAMA : JIKRI FIRDAUS
- NIM : 161021450160
- KELAS : 06TPLP001 / RUANG 513
- KAMPUS: STMIK ERESHA
Tugas UAS Project kali ini saya akan Membuat Program Aplikasi Mobile Programming "DATABASE CRUD SQLite". (MENGGUNAKAN ANDROID STUDIO)
Dimana aplikasi tersebut menampilkan form pengisian data diri atau biodata, lalu ketika disimpan data tersebut masuk ke dalam Database, dan dari hasil semua pengisian data diri, akan terlihat di form list view untuk nama-namanya. Jika kita klik pada nama data diri, maka akan muncul popup Pilih Menu (View, Edit, Delete).
Saya membuat 6 form di dalamnya ada Menu LogIn, Tambah Data, Form Input Data Diri, Form ListView data diri, popup Pilih Menu, dan Form View Data hasil dari Pilih Menu.
Lembar Jawaban UAS |
Lembar Jawaban UAS |
Berikut adalah Screenshot Hasil Projectnya :
Form Menu Login |
Tampilan pada saat berhasil Login & menampilkan button Tambah Data |
Tampilan pada saat pengisian Form Data Diri |
Tampilan ketika selesai menyimpan pengisian form data diri & muncul nama-nama yang telah di input |
Tampilan Pilih Menu ketika kita mengklik pada nama data diri di listview |
Tampilan View Data pada popup Pilih Menu |
Berikut adalah Source Code dari Projectnya :
File .java Terdiri dari :
- BuatBiodataActivity.java
- DataHelper.java
- LihatBiodataActivity.java
- MainActivity.java
- UpdateBiodataActivity.java
File .xml Terdiri dari :
- activity_buat_biodata.xml
- activity_lihat_biodata.xml
- activity_main.xml
- activity_update_biodata.xml
- content_main.xml
===============================================================
Berikut adalah file .java nya :
========================================================================
BuatBiodataActivity.java
package com.example.crudsqlite;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class BuatBiodataActivity 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();
}
});
}
}
========================================================================
DataHelper.java
package com.example.crudsqlite;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
/**
* Created by JIKRI FIRDAUS on 27/12/2019.
*/
public class DataHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "biodatadiri.db";
private static final int DATABASE_VERTSION = 1;
public DataHelper(Context context){
super(context, DATABASE_NAME,null,DATABASE_VERTSION);
}
@Override
public void onCreate(SQLiteDatabase db){
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);
}
@Override
public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2){
}
}
========================================================================
LihatBiodataActivity.java
package com.example.crudsqlite;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class LihatBiodataActivity 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();
}
});
}
}
========================================================================
MainActivity.java
package com.example.crudsqlite;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
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);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, BuatBiodataActivity.class);
startActivity(intent);
}
});
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 AdapterView.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(), LihatBiodataActivity.class);
i.putExtra("nama", selection);
startActivity(i);
break;
case 1:
Intent in = new Intent(getApplicationContext(), UpdateBiodataActivity.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();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
========================================================================
UpdateBiodataActivity.java
package com.example.crudsqlite;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class UpdateBiodataActivity 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();
}
});
}
}
========================================================================
========================================================================
Berikut adalah file .xml nya :
========================================================================
activity_buat_biodata.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_buat_biodata"
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="com.example.crudsqlite.BuatBiodataActivity">
<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: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:layout_alignParentBottom="true"
android:layout_alignRight="@+id/editText5"
android:layout_alignEnd="@+id/editText5" />
</RelativeLayout>
========================================================================
activity_lihat_biodata.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_lihat_biodata"
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="com.example.crudsqlite.BuatBiodataActivity">
<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" />
</RelativeLayout>
========================================================================
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.example.crudsqlite.BuatBiodataActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_input_add" />
</android.support.design.widget.CoordinatorLayout>
========================================================================
activity_update_biodata.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_update_biodata"
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="com.example.crudsqlite.BuatBiodataActivity">
<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: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:layout_alignParentBottom="true"
android:layout_alignRight="@+id/editText5"
android:layout_alignEnd="@+id/editText5"
/>
</RelativeLayout>
========================================================================
content_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_main"
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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.crudsqlite.MainActivity"
tools:showIn="@layout/activity_main">
<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" >
</ListView>
</RelativeLayout>
Tampilan pembuatan program pada Android Studio |
========================================================================
Demikian Hasil Project yang telah saya buat.
Thanks & Regards,
JIKRI FIRDAUS