Cara Buat Pemesanan Hotel Online
Cara Buat Pemesanan Hotel Online
Buatkan Class CustomHtppClient.java
package com.wilis;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.ArrayList;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
public class CustomHttpClient {
/** The time it takes for our client to timeout */
public static final int HTTP_TIMEOUT = 30 * 1000; // milliseconds
/** Single instance of our HttpClient */
private static HttpClient mHttpClient;
/**
* Get our single instance of our HttpClient object.
*
* @return an HttpClient object with connection parameters set
*/
private static HttpClient getHttpClient() {
if (mHttpClient == null) {
mHttpClient = new DefaultHttpClient();
final HttpParams params = mHttpClient.getParams();
HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT);
HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT);
ConnManagerParams.setTimeout(params, HTTP_TIMEOUT);
}
return mHttpClient;
}
/**
* Performs an HTTP Post request to the specified url with the
* specified parameters.
*
* @param url The web address to post the request to
* @param postParameters The parameters to send via the request
* @return The result of the request
* @throws Exception
*/
public static String executeHttpPost(String url, ArrayList<NameValuePair>
postParameters) throws Exception {
BufferedReader in = null;
try {
HttpClient client = getHttpClient();
HttpPost request = new HttpPost(url);
UrlEncodedFormEntity formEntity = new
UrlEncodedFormEntity(postParameters);
request.setEntity(formEntity);
HttpResponse response = client.execute(request);
in = new BufferedReader(new
InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
String result = sb.toString();
return result;
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* Performs an HTTP GET request to the specified url.
*
* @param url The web address to post the request to
* @return The result of the request
* @throws Exception
*/
public static String executeHttpGet(String url) throws Exception {
BufferedReader in = null;
try {
HttpClient client = getHttpClient();
HttpGet request = new HttpGet();
request.setURI(new URI(url));
HttpResponse response = client.execute(request);
in = new BufferedReader(new
InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
String result = sb.toString();
return result;
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
daftar_user.java
package com.wilis;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
public class daftar_user extends Activity {
EditText nomor_ktp,nama,ttl,alamat,agama,pekerjaan,username,password;
RadioGroup jk;
TextView status;
Button simpan;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.daftar_user);
nomor_ktp=(EditText)findViewById(R.id.txtnomorktp);
nama=(EditText)findViewById(R.id.txtnama);
ttl=(EditText)findViewById(R.id.txtttl);
jk=(RadioGroup) findViewById(R.id.jekel);
alamat=(EditText)findViewById(R.id.txtalamat);
agama=(EditText)findViewById(R.id.txtagama);
pekerjaan=(EditText)findViewById(R.id.txtpekerjaan);
username=(EditText)findViewById(R.id.txtusername);
password=(EditText)findViewById(R.id.txtpassword);
simpan=(Button)findViewById(R.id.btnsimpan);
// keluar=(Button)findViewById(R.id.btnexit);
status=(TextView)findViewById(R.id.txtstatus);
simpan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//atur variabel utk menampung pilihan jenis kelamin
String type=null;
switch (jk.getCheckedRadioButtonId()) {
case R.id.pria:
type="Pria";
break;
case R.id.perempuan:
type="Perempuan";
break;
}
ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("nomor_ktp",
nomor_ktp.getText().toString()));
postParameters.add(new BasicNameValuePair("nama",
nama.getText().toString()));
postParameters.add(new
BasicNameValuePair("ttl",ttl.getText().toString()));
postParameters.add(new BasicNameValuePair("alamat",
alamat.getText().toString()));
postParameters.add(new BasicNameValuePair("jekel", type));
postParameters.add(new BasicNameValuePair("agama",
agama.getText().toString()));
postParameters.add(new BasicNameValuePair("pekerjaan",
pekerjaan.getText().toString()));
postParameters.add(new BasicNameValuePair("username",
username.getText().toString()));
postParameters.add(new BasicNameValuePair("password",
password.getText().toString()));
/* String valid = "1";*/
String response = null;
try {
response =
CustomHttpClient.executeHttpPost("http://10.0.2.2/hotel/daftar_user.php",
postParameters);
String res = response.toString();
res = res.trim();
res = res.replaceAll("\\s+","");
status.setText(res);
if (res.equals("1")) status.setText("Data tidak Tersimpan Ke server");
else status.setText("Data berhasil disimpan ke server");
}
catch (Exception e) {
username.setText(e.toString());
}
}
});
}
public void keluar (View theButton)
{
Intent a = new Intent (this,login.class);
startActivity(a);
}
}
Kamar.java
package com.wilis;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
public class Kamar extends Activity {
EditText kode_kamar,jenis_kamar,tarif;
TextView status;
Button simpan,keluar;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.kamar);
kode_kamar = (EditText)findViewById(R.id.txtkode_kamar);
jenis_kamar=(EditText)findViewById(R.id.txtjenis_kamar);
tarif=(EditText)findViewById(R.id.txttarif);
simpan=(Button)findViewById(R.id.btnsimpan);
keluar=(Button)findViewById(R.id.btnexit);
status=(TextView)findViewById(R.id.txtstatus);
simpan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("kode_kamar",
kode_kamar.getText().toString()));
postParameters.add(new BasicNameValuePair("jenis_kamar",
jenis_kamar.getText().toString()));
postParameters.add(new
BasicNameValuePair("tarif",tarif.getText().toString()));
/* String valid = "1";*/
String response = null;
try {
response =
CustomHttpClient.executeHttpPost("http://10.0.2.2/hotel/kamar.php", postParameters);
String res = response.toString();
res = res.trim();
res = res.replaceAll("\\s+","");
status.setText(res);
if (res.equals("1")) status.setText("Data tidak Tersimpan Ke server");
else status.setText("Data berhasil disimpan ke server");
}
catch (Exception e) {
kode_kamar.setText(e.toString());
}
}
});
}
public void keluar (View theButton)
{
Intent a = new Intent (this,Layanan.class);
startActivity(a);
}
}
Layanan.java
package com.wilis;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class Layanan extends Activity implements OnClickListener {
Button Tamu_Hotel;
Button Registrasi;
Button Kamar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layanan);
Tamu_Hotel = (Button)findViewById(R.id.button3);
Registrasi = (Button)findViewById(R.id.button4);
Kamar = (Button)findViewById(R.id.button5);
Tamu_Hotel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent pindah = new Intent(Layanan.this,Tamu.class);
startActivity(pindah);
}
});
Registrasi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent pindah = new Intent(Layanan.this,Transaksi.class);
startActivity(pindah);
}
});
Kamar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent pindah = new Intent(Layanan.this,Kamar.class);
startActivity(pindah);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.layanan, menu);
return true;
}
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
}
}
Tamu.java
package com.wilis;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
public class Tamu extends Activity {
EditText id_penghuni,nama,alamat;
RadioGroup jk;
TextView status;
Button simpan,keluar;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tamu);
id_penghuni = (EditText)findViewById(R.id.txtid_penghuni);
nama=(EditText)findViewById(R.id.txtnama);
alamat=(EditText)findViewById(R.id.txtalamat);
jk=(RadioGroup) findViewById(R.id.jekel);
simpan=(Button)findViewById(R.id.btnsimpan);
keluar=(Button)findViewById(R.id.btnexit);
status=(TextView)findViewById(R.id.txtstatus);
simpan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//atur variabel utk menampung pilihan jenis kelamin
String type=null;
switch (jk.getCheckedRadioButtonId()) {
case R.id.pria:
type="Pria";
break;
case R.id.perempuan:
type="Perempuan";
break;
}
ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("id_penghuni",
id_penghuni.getText().toString()));
postParameters.add(new BasicNameValuePair("nama",
nama.getText().toString()));
postParameters.add(new
BasicNameValuePair("alamat",alamat.getText().toString()));
postParameters.add(new BasicNameValuePair("jekel", type));
/* String valid = "1";*/
String response = null;
try {
response =
CustomHttpClient.executeHttpPost("http://10.0.2.2/hotel/daftar_akta.php",
postParameters);
String res = response.toString();
res = res.trim();
res = res.replaceAll("\\s+","");
status.setText(res);
if (res.equals("1")) status.setText("Data tidak Tersimpan Ke server");
else status.setText("Data berhasil disimpan ke server");
}
catch (Exception e) {
id_penghuni.setText(e.toString());
}
}
});
}
public void keluar (View theButton)
{
Intent a = new Intent (this,Layanan.class);
startActivity(a);
}
}
login.java
package com.wilis;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class login extends Activity {
/** Called when the activity is first created. */
EditText username,password;
TextView status;
Button login,daftar;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
username=(EditText) findViewById(R.id.txtusername);
password=(EditText) findViewById(R.id.txtpassword);
status=(TextView) findViewById (R.id.txtstatus);
login=(Button) findViewById (R.id.btnlogin);
daftar=(Button) findViewById (R.id.btndaftar);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
ArrayList<NameValuePair> postParameters = new
ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("username",
username.getText().toString()));
postParameters.add(new BasicNameValuePair("password",
password.getText().toString()));
/* String valid = "1";*/
String response = null;
try {
response =
CustomHttpClient.executeHttpPost("http://10.0.2.2/hotel/check.php", postParameters);
String res = response.toString();
res = res.trim();
res = res.replaceAll("\\s+","");
status.setText(res);
if (res.equals("1"))
{
status.setText("Correct Username or Password");
berhasil(v);
}
else {
status.setText("Sorry!! Wrong Username or Password Entered");
}
}
catch (Exception e) {
status.setText(e.toString());
}
}
});
// penutup buka dari public void onCreate
}
public void daftar (View theButton)
{
Intent d = new Intent (this,daftar_user.class);
startActivity(d);
}
// apabila user berhasil login.
public void berhasil (View theButton)
{
Intent s = new Intent (this, Layanan.class);
startActivity(s);
}
}
Transaksi.java
package com.wilis;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
public class Transaksi extends Activity {
EditText
id_transaksi,tanggal_daftar,lama_menginap,total_tarif,kode_kamar,id_penghuni;
TextView status;
Button simpan,keluar;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.transaksi);
id_transaksi = (EditText)findViewById(R.id.txtid_transaksi);
tanggal_daftar=(EditText)findViewById(R.id.txttanggal_daftar);
lama_menginap=(EditText)findViewById(R.id.txtlama_menginap);
total_tarif=(EditText)findViewById(R.id.txttotal_tarif);
kode_kamar=(EditText)findViewById(R.id.txtkode_kamar);
id_penghuni=(EditText)findViewById(R.id.txtid_penghuni);
simpan=(Button)findViewById(R.id.btnsimpan);
keluar=(Button)findViewById(R.id.btnexit);
status=(TextView)findViewById(R.id.txtstatus);
simpan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("id_transaksi",
id_transaksi.getText().toString()));
postParameters.add(new BasicNameValuePair("tanggal_daftar",
tanggal_daftar.getText().toString()));
postParameters.add(new
BasicNameValuePair("lama_menginap",lama_menginap.getText().toString()));
postParameters.add(new
BasicNameValuePair("total_tarif",total_tarif.getText().toString()));
postParameters.add(new
BasicNameValuePair("kode_kamar",kode_kamar.getText().toString()));
postParameters.add(new
BasicNameValuePair("id_penghuni",id_penghuni.getText().toString()));
/* String valid = "1";*/
String response = null;
try {
response =
CustomHttpClient.executeHttpPost("http://10.0.2.2/hotel/transaksi.php",
postParameters);
String res = response.toString();
res = res.trim();
res = res.replaceAll("\\s+","");
status.setText(res);
if (res.equals("1")) status.setText("Data tidak Tersimpan Ke server");
else status.setText("Data berhasil disimpan ke server");
}
catch (Exception e) {
id_transaksi.setText(e.toString());
}
}
});
}
public void keluar (View theButton)
{
Intent a = new Intent (this,Layanan.class);
startActivity(a);
}
}
Lalu Buatkan File Xmlnya Seperti di bawah ini
Activity_layanan.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="@drawable/ombentor"
tools:context=".Layanan" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="29dp"
android:text="E-Booking Bentor"
android:textColor="#FF000000"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/button3"
android:layout_below="@+id/button3"
android:text="Transaksi" />
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="52dp"
android:text="Pemesan" />
</RelativeLayout>
daftar_user.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/ombentor"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget126"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget127"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Nomor KTP" />
<EditText
android:id="@+id/txtnomorktp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget129"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget130"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Nama" />
<EditText
android:id="@+id/txtnama"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget132"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget133"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Tempat Lahir" />
<EditText
android:id="@+id/txtttl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget135"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget136"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Alamat" />
<EditText
android:id="@+id/txtalamat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget138"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget139"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Jenis Kelamin " />
<RadioGroup
android:id="@+id/jekel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/pria"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Pria" />
<RadioButton
android:id="@+id/perempuan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Perempuan" />
</RadioGroup>
</TableRow>
<TableRow
android:id="@+id/widget143"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget144"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Agama" />
<EditText
android:id="@+id/txtagama"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget147"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Pekerjaan" />
<EditText
android:id="@+id/txtpekerjaan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget149"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget150"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Username" />
<EditText
android:id="@+id/txtusername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget152"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget153"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Password" />
<EditText
android:id="@+id/txtpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:password="True"
android:textSize="18sp" />
</TableRow>
</TableLayout>
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget155"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btnsimpan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SIMPAN" />
<Button
android:id="@+id/btnexit"
android:onClick="keluar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="E X I T" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/txtstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
</ScrollView>
kamar.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/login"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget126"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget127"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Kode Kamar" />
<EditText
android:id="@+id/txtkode_kamar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget129"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget130"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Jenis Kamar" />
<EditText
android:id="@+id/txtjenis_kamar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget132"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget135"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget136"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Tarif" />
<EditText
android:id="@+id/txttarif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget143"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wiet146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wit146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget149"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget152"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget343"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget943"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wit146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget139"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget1352"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget11343"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget13943"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
</TableLayout>
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget155"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btnsimpan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SIMPAN" />
<Button
android:id="@+id/btnexit"
android:onClick="keluar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="E X I T" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/txtstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
</ScrollView>
login.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/widg37"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/ombentor"
xmlns:android="http://schemas.android.com/apk/res/android">
<TableLayout
android:id="@+id/widget37"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget45"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget47"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Username :" />
<EditText
android:id="@+id/txtusername"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget46"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget55"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Password :" />
<EditText
android:id="@+id/txtpassword"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text=""
android:password="True"
android:textSize="18sp" />
</TableRow>
</TableLayout>
<TableLayout
android:id="@+id/w7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget65"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btnlogin"
android:onClick="login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="L O G I N" />
<Button
android:id="@+id/btndaftar"
android:onClick="daftar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DAFTAR" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/txtstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
tamu.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/ombentor"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget126"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget127"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="ID_Penumpang" />
<EditText
android:id="@+id/txtid_penumpang"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget129"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget130"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Nama Penumpang" />
<EditText
android:id="@+id/txtnama"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget132"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget135"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget136"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Alamat" />
<EditText
android:id="@+id/txtalamat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget138"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget139"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Jenis Kelamin " />
<RadioGroup
android:id="@+id/jekel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/pria"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Pria" />
<RadioButton
android:id="@+id/perempuan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Perempuan" />
</RadioGroup>
</TableRow>
<TableRow
android:id="@+id/widget143"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wiet146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wit146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget149"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget152"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget343"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget943"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wit146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget139"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget1352"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget11343"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget13943"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
</TableLayout>
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget155"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btnsimpan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SIMPAN" />
<Button
android:id="@+id/btnexit"
android:onClick="keluar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="E X I T" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/txtstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
</ScrollView>
transaksi.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/ombentor"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/widget124"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget126"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget127"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="ID_Transaksi" />
<EditText
android:id="@+id/txtid_transaksi"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget126"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget127"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Tanggal Daftar" />
<EditText
android:id="@+id/txttanggal_daftar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget135"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget136"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Lama Menginap" />
<EditText
android:id="@+id/txtlama_menginap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget132"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget135"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget136"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Total Tarif" />
<EditText
android:id="@+id/txttotal_tarif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget132"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget135"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget136"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Kode Kamar" />
<EditText
android:id="@+id/txtkode_kamar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget132"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget135"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/widget136"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF000000"
android:text="Id Penghuni" />
<EditText
android:id="@+id/txtid_penghuni"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/widget143"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wiet146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wit146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget149"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget152"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget343"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget943"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/wit146"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget139"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget1352"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget11343"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
<TableRow
android:id="@+id/widget13943"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</TableRow>
</TableLayout>
<TableLayout
android:id="@+id/widget125"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/widget155"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btnsimpan"
android:layout_width="wrap_content"
android:text="SIMPAN" />
<Button
android:id="@+id/btnexit"
android:onClick="keluar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="E X I T" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/txtstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
</ScrollView>
Dan Hasil Output web nya Seperti Di bawah ini
Hasil Output Login Andorid
Hasil Output Menu Android
boleh minta file project nya gk mas?
BalasHapusemail: efit.pany@gmail.com