TO: TUGAS_UAS
MOBILE PROGREMMING
NAMA : DERIEL DEEP
IG : DEEP_DERIEL
ASSALAMUALAIKUM WR WB
"SALAM KENAL SALAM DARI ANAK BETAWIE"
DISINI SAYA AKAN MEMBUAT APLIKASI BENGKEL_VESPA
DIMANA IDE INI SAYA PILIH KARENA ADA DI SAAT SAYA SEDANG TRUBEL DENGAN VESPA
LANGSUNG AJA INI LANGKAH LANGKAHNYA
1. BUKA APLIKASI ECLIPSE
2. LALU PILIH
3. KEMUDIAN
4. SELANJUTNYA
5. SELANJUTNYA TINGGAL DI NEXT DAN NEXT SAJA
6. DAN DISINI ADALAH LANGKAH LANGKAH UNTUK MENGCODING NYA
1. MainActivity
package com.example.bengvespa;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {
Button tombol;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Intent login = new Intent(this, MainActivity2.class);
tombol = (Button) findViewById(R.id.button1);
tombol.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(login);
}
});
}
}
2. MainActivity2
package com.example.bengvespa;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class MainActivity2 extends Activity {
Button tombol;
Button tombol2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
final Intent matic = new Intent(this, maticavtivity.class);
final Intent klasik = new Intent(this, klasikactivity.class);
tombol = (Button) findViewById(R.id.button1);
tombol.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(matic);
}
});
tombol2 = (Button) findViewById(R.id.button2);
tombol2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(klasik);
}
});
}
}
3. maticActivity
package com.example.bengvespa;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class maticavtivity extends Activity {
ListView menu;
String[] matic = {"Ban : Rp.90.000","Rem : 15.000","tali kopling : 15.000","lampu : 12.000",
"pelek : 50.000","blok mesin : 65.000","Lampu send : 10.000", "lampu belakang : 12.000",
"tali keteng : 35.000"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
menu=(ListView)findViewById(R.id.maticlistview);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.textview,matic);
menu.setAdapter(adapter);
}
}
4. klasikActivity
package com.example.bengvespa;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class klasikactivity extends Activity {
ListView menu;
String[] klasik = {"Ban : Rp.90.000","Rem : 15.000","tali kopling : 15.000","lampu : 12.000",
"pelek : 50.000","blok mesin : 65.000","Lampu send : 10.000", "lampu belakang : 12.000","spion : 20.000", "Busi : 10.000"
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listview2);
menu=(ListView)findViewById(R.id.klasiklistview);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.textview,klasik);
menu.setAdapter(adapter);
}
}
5. activitymain
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="top"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="@android:dimen/app_icon_size"
android:layout_marginTop="19dp"
android:text="BENGKEL_VESPA" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView2"
android:layout_marginLeft="20dp"
android:layout_marginTop="14dp"
android:text="USERNAME" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:layout_marginTop="15dp"
android:ems="10"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/editText1"
android:layout_marginTop="41dp"
android:text="NO.PLAT" />
<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView3"
android:layout_marginTop="36dp"
android:ems="10"
android:inputType="textPersonName" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText2"
android:layout_marginTop="37dp"
android:layout_toRightOf="@+id/editText2"
android:onClick="login"
android:text="LOGIN" />
</RelativeLayout>
6. activitymain2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity2">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SERVICES" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="VESPA MATIC" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="VESPA KLASIK" />
</LinearLayout>
7. Listview
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/maticlistview">
</ListView>
8. Listview2
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/klasiklistview">
</ListView>
9. textview
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</TextView>
10. AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bengvespa"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.bengvespa.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".maticavtivity"
android:label="@string/app_name">
</activity>
<activity
android:name=".klasikactivity"
android:label="@string/app_name">
</activity>
<activity
android:name=".MainActivity2"
android:label="@string/app_name">
</activity>
</application>
</manifest>
7. DAN INI ADALAH HASIL YANG SAYA BUAT SEMOGA BERMANFAAT KAWAN
DISINI KITA MASUKAN NAMA PENGGUNA MOTOR LALU MASUKAN PLAT NO NYA
DAN DISINI ADALAH PILIHAN SI PENGENDARA DALAM MEMPERBAIKI MOTORNYA MATIC ATAU KLASIK
DAN CONTOHNYA SEPERTI INI
MUNGKIN DISINI SAJA UNTUK PEMBUATANNYA SEMOGA BERMANFAAT
SALAM KENAL SALAM DARI ANAK BETAWIE
WAASALAMUALAIKUM WR WB
SUKSES CING ???







