################################################################################
package com.Murni.tugas_murni;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageView;
import android.view.View.OnClickListener;
public class Main extends Activity {
protected ProgressDialog progressDialog;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
progressDialog = ProgressDialog.show(Main.this, "please wait..", "System is loading");
new Thread(){
public void run(){
try{
sleep(2500);
}
catch (Exception e) {
Log.e("tag",e.getMessage());
// TODO: handle exception
}
//dismiss the`progres dialog
progressDialog.dismiss();
}
}.start();
setContentView(R.layout.activity_main);
ImageView exit = (ImageView)findViewById(R.id.exit);
exit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
close();
}
});
}
public void profil (View view){
Intent intent1=new Intent (this,Biodata.class);
startActivity(intent1);
}
public void menu (View view){
Intent intent2= new Intent (this,masadepan.class);
startActivity(intent2);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
public void close(){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Do you want to exit?")
.setCancelable(false)
.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
Main.this.finish();
}
})
.setNegativeButton("Cancel",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialog.cancel();
}
}).show();
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACKSLASH) {
close();
}
return super.onKeyDown(keyCode, event);
}
}
<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:background="@drawable/awan" >
<RelativeLayout
android:id="@+id/rl1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="106dp" >
</RelativeLayout>
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="95dp"
android:gravity="center_horizontal"
android:text="Selamat Datang"
android:textColor="#efb6db"
android:textSize="15pt"
android:textStyle="bold"
/>
<TextView
android:id="@+id/textView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="18dp"
android:layout_below="@+id/textView1"
android:gravity="center_horizontal"
android:text="di Aplikasi Data Diri"
android:textColor="#efb6db"
android:textSize="13pt"
android:textStyle="bold" />
<ImageView
android:id="@+id/toga"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:onClick="menu"
android:src="@drawable/toga" />
<ImageView
android:id="@+id/exit"
android:layout_width="90dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/toga"
android:layout_marginRight="49dp"
android:onClick="exit"
android:src="@drawable/exit" />
<ImageView
android:id="@+id/profil"
android:layout_width="70dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/rl1"
android:onClick="profil"
android:src="@drawable/profil" />
</RelativeLayout>
|
Gambar 1.10: Tampilan Menu Utama |
|
|
|
|
|
Gambar 1.11: Tampilan Exit |
|
Gambar 1.12:Tampilan loading menu utama |
package com.Murni.tugas_murni;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
public class Biodata extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.biodata);
}
public void Home(View view){
Intent intent=new Intent (this,Main.class);
startActivity(intent);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/awan">
<TableLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/imageView1"
android:layout_marginTop="25dp" >
<TextView
android:id = "@+id/nama"
android:layout_width = "fill_parent"
android:layout_height= "wrap_content"
android:text = "Profil"
android:textSize="15pt"
android:textStyle = "bold"
android:gravity = "center"
android:textColor="#115d89"/>
<ImageView
android:id = "@+id/gambarutama"
android:src = "@drawable/murnihanda"
android:layout_width = "250dp"
android:layout_height= "150dp"
android:layout_gravity = "center"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Nama :"
android:textSize="8pt"
android:gravity="center"
android:textColor="#115d89"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_weight="0.98"
android:text= " Murni Handayani"
android:textSize="9pt"
android:textColor="#115d89"/>
</TableRow>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="NPM :"
android:textSize="8pt"
android:gravity="center"
android:textColor="#115d89"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10215410194"
android:textSize="8pt"
android:layout_marginLeft="20dp"
android:textColor="#115d89"/>
</TableRow>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Email :"
android:textSize="8pt"
android:gravity="center"
android:textColor="#115d89"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="email"
android:text="murnihanda92@gmail.com"
android:textSize="8pt"
android:layout_marginLeft="20dp"
android:textColor="#115d89"/>
</TableRow>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Alamat :"
android:textSize="8pt"
android:gravity="center"
android:textColor="#115d89"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Kp. cipayung RT 04/ 07 No 22 kel.tengah "
android:textSize="8pt"
android:layout_marginLeft="20dp"
android:textColor="#115d89"/>
</TableRow>
</LinearLayout>
<Button
android:id="@+id/back"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="100dp"
android:background="@drawable/imagebutton"
android:layout_gravity="left"
android:onClick="Home"
android:text="Home"
android:textColor="#10899f"
android:textSize="10pt" />
</TableLayout>
</ScrollView>
|
Gambar 1.13: Tampilan profil |
|
################################################################################
package com.Murni.tugas_murni;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
public class masadepan extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rencana);
}
public void Home(View view){
Intent intent1 = new Intent (this,Main.class);
startActivity(intent1);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}}
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/rmd"
android:orientation="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/imageView1"
android:layout_marginTop="25dp" >
<TextView
android:id="@+id/textView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="135dp"
android:gravity="center"
android:text="@string/Rencana"
android:textColor="#115d89"/>
<Button
android:id="@+id/back1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginTop="150dp"
android:background="@drawable/imagebutton"
android:onClick="Home"
android:text="Home"
android:textColor="#10899f"
android:textSize="10pt" />
</TableLayout>
</ScrollView>
|
Gambar 1.14:Tampilan rencana masa depan |
##################################################################################
Manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Murni.tugas_murni"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".AnimasiActivity"
android:label="@string/ani">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Main"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Biodata"
android:label="@string/title_activity_biodata">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".masadepan"
android:label="@string/title_activity_Rencana">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>