Saturday, August 26, 2017

Membuat App Android Menampilkan Info - info wisata no Database

Hii Kuy, Aplikasi ini menggunakan ViewPager, Recyclerview dan CardView

Masih dengan belajar membuat aplikasi android sederhana untuk pemula/newbie, untuk belajar proggramming salah satu kunci yaitu "love", cinta itu proggramming. Saran saya yang kita sama-sama newbie belum punya experience yang banyak dalam membuat aplikasi android karena
baca ini ya trik jitu jadi proggramer


kekurangan ilmu pengetahuan mengenai android, sebenarnya salah satu kunci yaitu belajar dengan contoh-contoh sederhana, kenapa sederhana ? karena menurut saya kalau kita langsung belajar pada aplikasi yang komplex semacam aplikasi Crud atau langsung aplikasi Go-jek, waaaaw menurut saya, nanti kalian akan mendapatkan feel bored, bosan-bosan-bosan karena tidak mengerti dengan alur proses pembuatan aplikasinya, jadi belajar dari hal-hal sederhana itu wajib, wajib bagi pemula. Setelah belajar dari hal yang sederhana, nanti kumpulkan aplikasi tersebut menjadi komplex, ini salah satu trik, dan jangan lupa untuk tidak CP "Copy - > Paste ", itu hal yang tidak disarankan bagi pemula. pada kesempatan kali ini saya akan membagi salah satu aplikasi latihan yang saya buat, sebenarnya hasil copy tapi tidak paste ya dari tutorial orang lain.


ingin hijarah ke kotlin? baca ini.

Aplikasi ini dibuat karena permintaan dari tutor saya, membuat aplikasi dulu cari tutorial di Google, setelah aplikasi selesai nanti akan ditanya dibagian mana yang tidak di mengerti, nanti tutor saya akan menjelaskannya. Metode ini yang salah satu tips berhasil buat pemula, karena kita di ajarkan untuk mandiri.
Aplikasi ini menampilkan daftar infor-info wisata di daerah saya, aplikasi tidak menggunakan library, aplikasi ini menggunakan recyclerview untuk menampilkan list data array, dan menggunakan card view untuk mempercantik tampilan list dan detail, oh iya apliasi ini menggunakan material design.
sebenarnya aplikasi ini sangat sederhana untuk dibuat.
lansung saja kita mulai membuat aplikasinya :
1. buat project baru pada android studio
2. sebelumnya sediakan gambar di folder assets ya, seperti gambar dibawah ini, foto yang disimpan.
3. setelah itu tambahkan dependecies pada gradele, seperti gambar dibawah ini :
4. susunan file yang dibutuhkan seperti pada gambar dibawah ini :
5. untuk layoutnya seperti dibawah ini :

activity_main.xml

<android.support.v4.widget.DrawerLayout
   
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:id="@+id/drawer"
android:background="@color/cardview_light_background"
   
android:layout_width="match_parent"
   
android:layout_height="match_parent"
   
android:fitsSystemWindows="true"
   
tools:context=".MainActivity">

    <
LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="match_parent"
       
android:measureWithLargestChild="false"
       
android:orientation="vertical">

        <
include
           
android:id="@+id/toolbar"
           
layout="@layout/layout_toolbar" />
        <
TextView
           
android:layout_marginRight="1dp"
           
android:layout_marginLeft="1dp"
           
android:text="Aplikasi GORONTALO E-Wisata yaitu aplikasi yang menampilkan 8 daftar wisata favorit yang ada di provinsi Gorontalo."
           
android:textSize="20dp"
           
android:textStyle="bold"
           
android:gravity="center_horizontal"
           
android:background="#90CAF9"
           
android:textColor="@color/cardview_dark_background"
           
android:layout_width="match_parent"
           
android:layout_height="100dp" />
        <
include
           
layout="@layout/slide_foto" />



    </
LinearLayout>

    <
android.support.design.widget.NavigationView
       
android:id="@+id/navigation_view"
       
android:layout_width="wrap_content"
       
android:layout_height="match_parent"
       
android:layout_gravity="start"
       
app:headerLayout="@layout/layout_header"
       
app:menu="@menu/item_navigasi" />
</
android.support.v4.widget.DrawerLayout>

activity_profil.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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="@color/cardview_light_background"
   
tools:context="id.co.imastudio.santri.hulanthalotourisemplace.Profil">

    <
LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="match_parent"
       
android:orientation="vertical"
       
>
        <
include
           
android:id="@+id/toolbar"
           
layout="@layout/layout_toolbar" />
        <
include
           
layout="@layout/fragment_profil"
           
android:layout_width="match_parent"
           
android:layout_height="wrap_content"/>
        <
RelativeLayout
           
android:layout_width="match_parent"
           
android:layout_height="match_parent"
           
android:gravity="center"
           
>
            <
ImageButton

               
android:src="@drawable/fb"
               
android:id="@+id/fb"
               
android:text="fb"
               
android:background="@color/cardview_light_background"
               
android:layout_width="100dp"
               
android:layout_height="100dp" />
            <
ImageButton
               
android:layout_marginLeft="30dp"
               
android:text="ig"
               
android:background="@color/cardview_light_background"
               
android:src="@drawable/ig"
               
android:id="@+id/ig"
               
android:layout_toRightOf="@+id/fb"
               
android:layout_width="100dp"
               
android:layout_height="100dp" />
        </
RelativeLayout>
    </
LinearLayout>
</
android.support.constraint.ConstraintLayout>


activity_recyclerview.xml

 <?xml version="1.0" encoding="utf-8"?>



<android.support.v4.widget.DrawerLayout

    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:id="@+id/drawer"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:fitsSystemWindows="true"

    tools:context=".MainActivity">

<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=".MainActivity"

    >



    <include

        android:id="@+id/toolbar"



        layout="@layout/layout_toolbar" />





    <android.support.v7.widget.RecyclerView



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



        android:id="@+id/recycler_view"

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:clipToPadding="false"

        android:paddingBottom="16dp"

        android:paddingTop="16dp"

        android:scrollbars="vertical"

        android:background="#ECEFF1"

        android:layout_alignParentTop="true" />



</LinearLayout>

    <android.support.design.widget.NavigationView

        android:id="@+id/navigation_view"

        android:layout_width="wrap_content"

        android:layout_height="match_parent"

        android:layout_gravity="start"

        app:headerLayout="@layout/layout_header"

        app:menu="@menu/item_navigasi" />

</android.support.v4.widget.DrawerLayout>


Detail_activiy.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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="DetailWisata"
   
android:background="@color/cardview_light_background">
    <
LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="match_parent"
       
android:orientation="vertical">
        <
android.support.v7.widget.Toolbar
           
android:id="@+id/toolbar"
           
android:layout_width="match_parent"
           
android:layout_height="?attr/actionBarSize"
           
android:background="?attr/colorPrimary"
           
/>
        <
ImageView
           
android:src="@drawable/olele"
           
android:id="@+id/img"
           
android:layout_width="match_parent"
           
android:layout_height="200dp"
           
/>
        <
TextView
           
android:text=""

           
android:layout_width="match_parent"
           
android:layout_height="10dp"
           
android:background="@color/windowBackground"></TextView>
        <
TextView
           
android:text="judul"
           
android:id="@+id/jdl"
           
android:layout_width="match_parent"
           
android:layout_height="30dp"
           
android:textStyle="bold"
           
android:textSize="20dp"
           
android:background="@color/colorPrimary"

          
/>
        <
TextView
           
android:text="Desk"
           
android:id="@+id/desk"
           
android:layout_width="match_parent"
           
android:layout_height="match_parent"
           
android:background="@color/colorPrimary"/>

    </
LinearLayout>

</
android.support.design.widget.CoordinatorLayout>

fragment_foto.xml

<LinearLayout android:orientation="vertical"
   
android:layout_width="match_parent"
   
android:layout_height="200dp"
   
xmlns:android="http://schemas.android.com/apk/res/android">
<
TextView
   
android:id="@+id/judul"
   
android:textColor="#E65100"
   
android:textSize="13dp"
   
android:textStyle="bold"
   
android:background="#FFD740"
   
android:layout_width="match_parent"
   
android:layout_height="wrap_content"
   
android:text="judul"
   
android:gravity="center_horizontal"/>
    <
ImageView
       
android:id="@+id/imma"
       
android:layout_width="match_parent"
       
android:layout_height="wrap_content"
       
android:adjustViewBounds="true"
       
android:cropToPadding="true"
       
android:scrollbarFadeDuration="10" />
    <
TextView
       
android:id="@+id/no"
       
android:textColor="@color/cardview_dark_background"
       
android:textSize="13dp"
       
android:textStyle="bold"
       
android:layout_width="match_parent"
       
android:layout_height="wrap_content"
       
android:text="judul"
       
android:gravity="center_horizontal"/>
</
LinearLayout>

karena begitu banyak filenya, terlalu membuat bosan untuk dibaca nanti akan saya lampirkan file download projectnya.
untuk tampilan jadi programnya seperti di bawah ini :












link project download disini
don't forget share and if you have mistake when you make same this app coment ya.


NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post

iklan

 

Delivered by FeedBurner