UAS_SUMARI_161021450383


Nama
: SUMARI
NIM
: 161021450383
TUGAS UAS MOBILE PROGRAMING



Aplikasi yang saya bangun dengan Android Studio saat ini berisikan tentang Biaodata, untuk memenuhi Nilai UAS Mata kuliah Mobile Programing Adapun menu Layout yang ditampilkan yaitu :

·         Login

·         Biodata

·         Pendidikan

·         Pekerjaan

·         Camera

Adapun sourcecode dan tampilannya sebagai berikut :

1.       Login

Activity_main.xml
MainActivity.java
<?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_main"
   
android:layout_width="match_parent"
   
android:layout_height="match_parent"
   
tools:context="com.example.sumar.i_161021450383.MainActivity">

    <
TextView
       
android:text="Login Form"
       
android:layout_width="match_parent"
       
android:layout_height="wrap_content"
       
android:layout_alignParentTop="true"
       
android:layout_centerHorizontal="true"
       
android:id="@+id/textView"
       
android:textAlignment="center"
       
android:textSize="30sp"
       
android:textStyle="normal|bold" />

    <
EditText
       
android:layout_width="match_parent"
       
android:layout_height="wrap_content"
       
android:inputType="textPersonName"
       
android:ems="10"
       
android:id="@+id/username"
       
android:hint="Username"
       
android:layout_below="@+id/textView"
       
android:layout_alignParentLeft="true"
       
android:layout_alignParentStart="true"
       
android:layout_marginTop="37dp" />

    <
EditText
       
android:layout_width="match_parent"
       
android:layout_height="wrap_content"
       
android:inputType="textPassword"
       
android:ems="10"
       
android:layout_below="@+id/username"
       
android:layout_alignParentLeft="true"
       
android:id="@+id/password"
       
android:layout_alignParentRight="true"
       
android:layout_alignParentEnd="true"
       
android:hint="Password" />

    <
Button
       
android:text="Log In"
       
android:layout_width="match_parent"
       
android:layout_height="wrap_content"
       
android:layout_below="@+id/password"
       
android:layout_centerHorizontal="true"
       
android:id="@+id/btnLogin" />

</
RelativeLayout>


2.     Biodata
package com.example.sumar.i_161021450383;

  

  import androidx.appcompat.app.AppCompatActivity;

  

  import android.os.Bundle;

  

  public class MainActivity extends AppCompatActivity {

  

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

    }

}

activity_biodata.xml
biodata.java
<?xml version="1.0" encoding="utf-8"?>

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical">

    <ListView

        android:id="@android:id/list"

        android:layout_width="fill_parent"

        android:layout_height="fill_parent" />

</LinearLayout>

package com.example.sumar.i_161021450383;

  

  import android.os.Bundle;

  import android.view.View;

  import android.widget.Button;

  

  import androidx.appcompat.app.AppCompatActivity;

  

  public class welcome extends AppCompatActivity {

  

    Button btnExit;

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_welcome);

  

        btnExit = (Button) findViewById(R.id.btnExit);

  

        btnExit.setOnClickListener(new View.OnClickListener() {

            @Override

            public void onClick(View v) {

                //perintah untuk mengakhiri aplikasi

                finish();

            }

        });

    }

}



3.  Pendidikan
activity_pendidikan.xml
pendidikan.java
<?xml version="1.0" encoding="utf-8"?>

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical">

    <ListView

        android:id="@android:id/list"

        android:layout_width="fill_parent"

        android:layout_height="fill_parent" />

</LinearLayout>

package com.example.sumari_161021450383;

  

  import android.app.ListActivity;

  import android.os.Bundle;

  import android.widget.ArrayAdapter;

  public class pendidikan extends ListActivity {

    String [] pendidikan={"SDN 3 KALIMANGIS KULON", "SMPN 1 KALIMANGGIS", "SMK MODEL PATRIOT IV KUNINGAN"};

    @Override

    public void onCreate(Bundle savedInstanceState){

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_pendidikan);

        setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, pendidikan));

    }

}
 
 


4. Pekerjaan


activity_pekerjaan.xml
pekerjaan.java
<?xml version="1.0" encoding="utf-8"?>

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical">

    <ListView

        android:id="@android:id/list"

        android:layout_width="fill_parent"

        android:layout_height="fill_parent" />

</LinearLayout>

package com.example.sumari_161021450383;

  

  import android.app.ListActivity;

  import android.os.Bundle;

  import android.widget.ArrayAdapter;

  public class pekerjaan extends ListActivity {

    String [] pekerjaann={"Freelancer"};

    @Override

    public void onCreate(Bundle savedInstanceState){

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_pekerjaan);

        setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, pekerjaann));

    }

}

5. Camera

activity_camera.xml
camera.java
<?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:paddingTop="16dp"

    android:paddingBottom="16dp"

    android:paddingLeft="16dp"

    android:paddingRight="16dp"

    android:orientation="vertical"

    android:weightSum="10"

    tools:context=".MainActivity">

    <ImageView

        android:id="@+id/imageView"

        android:layout_weight="9"

        android:layout_width="match_parent"

        android:layout_height="fill_parent"

        />

    <Button

        android:id="@+id/buttonCamera"

        android:layout_weight="1"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:background="@android:color/black"

        android:textColor="@android:color/white"

        android:text="Kamera"/>

</LinearLayout>

package com.example.sumari_161021450383;

  

  import androidx.annotation.Nullable;

  import androidx.appcompat.app.AppCompatActivity;

  import android.content.Intent;

  import android.graphics.Bitmap;

  import android.os.Bundle;

  import android.provider.MediaStore;

  import android.view.View;

  import android.widget.Button;

  import android.widget.ImageView;

  public class camera extends AppCompatActivity {

    ImageView gambarCamera;

    Button tombolCamera;

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_camera);

        tombolCamera=(Button)findViewById(R.id.buttonCamera);

        gambarCamera  =(ImageView) findViewById(R.id.imageView);

        tombolCamera.setOnClickListener(new View.OnClickListener() {

            @Override

            public void onClick(View view) {

                Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

                startActivityForResult(intent,0);

            }

        });

    }

    @Override

    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {

        super.onActivityResult(requestCode, resultCode, data);

        Bitmap bitmap = (Bitmap)data.getExtras().get("data");

        gambarCamera.setImageBitmap(bitmap);

    }

}

Komentar

Postingan populer dari blog ini

UAS Sumari 161021450383

UTS_SUMARI_161021450383