Kamis, 31 Oktober 2019

UTS Mobile Programming


Assalamuallaikum, di sini saya akan memberikan tutorial membuat aplikasi sepatu menggunakan aplikasi Andriod Studio, dan berikut langkah-langkahnya :
Deskripsi : Aplikasi mobile yang berguna untuk pengetahuan mendalam mengenai berbagai macam game yang ada di dunia. Di dalam aplikasi tersebut di sematkan macam-macam jenis game, sejarah game tersebut.
Berikut tampilan awal ketika memasuki aplikasi :



Source Code :
<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:layout_width="match_parent"
   
android:layout_height="match_parent"
   
android:background="#87CEFA       "
   
tools:context=".MainActivity">


    <
RelativeLayout
       
android:layout_width="match_parent"
       
android:layout_height="match_parent"
       
tools:layout_editor_absoluteX="0dp"
       
tools:layout_editor_absoluteY="0dp">



        <
EditText
           
android:id="@+id/etusername"
           
android:layout_width="wrap_content"
           
android:layout_height="wrap_content"
           
android:layout_centerHorizontal="true"
           
android:layout_marginTop="340dp"
           
android:ems="10"
           
android:hint="username"
           
android:inputType="textPersonName" />

        <
Button
           
android:id="@+id/btnlogin"
           
android:layout_width="wrap_content"
           
android:layout_height="wrap_content"
           
android:layout_centerHorizontal="true"
           
android:layout_marginTop="420dp"
           
android:text="Masuk" />

        <
EditText
           
android:id="@+id/etpassword"
           
android:layout_width="wrap_content"
           
android:layout_height="wrap_content"
           
android:layout_centerHorizontal="true"
           
android:layout_marginTop="380dp"
           
android:ems="10"
           
android:hint="password"
           
android:inputType="textPassword" />


    </
RelativeLayout>
</
RelativeLayout>

Listview :

package com.example.game2;



import androidx.appcompat.app.AppCompatActivity;



import android.content.Intent;

import android.os.Bundle;

import android.widget.AdapterView;

import android.widget.ArrayAdapter;

import android.widget.ListView;

import android.view.View;





public class listview extends AppCompatActivity {



    ListView list;

    String game[] = {"pubg", "COD", "MobilLagend", "DOTA", "AOV"};



    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_listview);

        list = (ListView) findViewById(R.id.listview);

        ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_expandable_list_item_1, game);

        list.setAdapter(adapter);





        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {



            @Override

            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {

                int item = arg2;

                String itemText = (String) list.getItemAtPosition(arg2);



                if (itemText.equals("pubg")) {

                    Intent pubgintent = new Intent(arg0.getContext(), pubg.class);

                    startActivityForResult(pubgintent, 0);



                } else if (itemText.equals("COD")) {

                    Intent codintent = new Intent(arg0.getContext(), cod.class);

                    startActivityForResult(codintent, 0);



                } else if (itemText.equals("MobilLagend")) {

                    Intent mobillagendintent = new Intent(arg0.getContext(), mobillagend.class);

                    startActivityForResult(mobillagendintent, 0);



                } else if (itemText.equals("DOTA")) {

                    Intent dotaintent = new Intent(arg0.getContext(), dota.class);

                    startActivityForResult(dotaintent, 0);



                } else if (itemText.equals("AOV")) {

                    Intent aovintent = new Intent(arg0.getContext(), aov.class);

                    startActivityForResult(aovintent, 0);







                }

    }

    });

}

Deskripsi Game :
Source Code :
<?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:layout_width="match_parent"

    android:layout_height="match_parent"

    tools:context=".mobillagend">



    <TextView

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_centerHorizontal="true"

        android:layout_marginTop="150dp"

        android:text="Deskripsi"

        android:textSize="18sp"

        android:textStyle="bold"

        app:fontFamily="@font/poppins_bold" />



    <ImageView

        android:id="@+id/imageView2"

        android:layout_width="320px"

        android:layout_height="320px"

        android:layout_centerHorizontal="true"

        android:layout_marginTop="20dp"

        app:srcCompat="@drawable/cod" />



    <TextView

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_marginLeft="20dp"

        android:layout_marginTop="200dp"

        android:layout_marginRight="20dp"

        android:textSize="12sp"

        android:text="\n  Call of Duty (permainan pertama dirilis pada tanggal 29 Oktober 2003) adalah seri permainan tembak-menembak orang-pertama (First-person Shooter) dengan engine berdasarkan permainan Quake III: Team Arena. Permainan perang ini awalnya mensimulasikan tentara dan persenjataan dalam Perang Dunia Kedua. Dipublikasikan oleh Activision dan dikembangkan oleh Infinity Ward, Treyarch dan Sledgehammer Games.



Versi Mac OS X untuk Call of Duty dikembangkan oleh Aspyr Media. Pada akhir 2004, versi N-Gage dikembangkan oleh Nokia dan dipublikasikan oleh Activision. Versi lainnya dirilis untuk PC, termasuk Collector's Edition (dengan soundtrack dan strategy guide), Game of the Year Edition (termasuk game updates), dan Deluxe Edition (dengan isi United Offensive di Amerika Serikat. Di Eropa soundtrack tidak termasuk.)"

        app:fontFamily="@font/poppins" />



</RelativeLayou


sekian tutotial dari saya,kurang lebihnya mohon maaf

Tidak ada komentar:

Posting Komentar