pengembangan aplikasi perangkat bergerak (mobile · mobile app (n.) a software program that runs on...
TRANSCRIPT
PENGEMBANGAN APLIKASIPERANGKAT BERGERAK
(MOBILE)
K Candra Brata
Mobille App Lab 2015-2016
“Android Platform
“It isn't just about choosing native apps or choosing the mobile web , it's alsoabout looking at who your customers are and what devices they use.“
Delivering Mobile Content
MOBILE APP
mobile app (n.) a software program that runs on asmartphone, tablet or similar mobile device.
Definition
Native App: dibuat, dikompilasi dan diinstalasikhusus untuk platform tertentu.
Web based App: dibangun dengan teknologipembuatan Responsive Web: HTML, CSS,Javascript. Bersifat CROSS PLATFORM.
Hybrid: gabungan Native + Web app.
Jenis Mobile App
Jenis Mobile App
GOOGLE ANDROID
Android adalah sebuah sistem operasi untuk perangkatmobile berbasis linux yang mencakup sistem operasi,middleware dan aplikasi.
Menggunakan Linux kernel untuk menyediakan coresystem services.–Security–Memory management– Process management
–Power management–Hardware drivers
Android Version
Development Tools
Dalvik Virtual Machine (DVM).Android berjalan di dalam Dalvik Virtual Machine (DVM) bukan diJava Virtual Machine (JVM).
Android SDK (Software Development Kit)Android SDK merupakan tools API (Application ProgrammingInterface) yang diperlukan sebagai alat bantu pengembangan aplikasiAndroid (create, compile dan package), menggunakan bahasapemrograman Java.
Android debug bridge (ADB)Android debug bridge (ADB) merupakan tool untuk terhubung keperangkat Android (virtual atau real), untuk tujuan mengelolaperangkat atau debugging aplikasi.
ANDROID ACTIVITY
Definition
Activity is a single, focusedthing that the user can do.
Interact with the user, Creating a window to place
UI State :
• New Activity• Running• Pause• Stopped• Destroyed
How to Create?Setiap activity harus extend ke class Activity yang ada di package
android.app.Activity
Intent
Intent adalah sebuah object yang merupakan Kunciuntuk berkomunikasi dengan activity lainnya.
Intent dibagi 2 yaitu:
Implicit intent adalah intent yang memanggil fungsiactivity yang sudah ada di fungsi internal android sepertiDial Number, Open Browser dan lainya.
Explicit Intent yang memanggil Activity lain yang masihdalam 1 project atupun beda project.
Intent
Untuk membuat Intent, import package android.content.Intent
Kemudian instansiasi di class activity yang dibuat.
Intent abc = new Intent (this, gallery.class);startActivity(abc);
IDE for Android application development
Android Studio
GradleAndroid tools menggunakan Gradle sebagai build automation system. Androidmenyediakan Gradle plug-in untuk build Android application dalam filebuild.gradle.
Android Manifest
The components and settings of an Android application are described in theAndroidManifest.xml file. This file is known as the manifest file or themanifest.
The manifest also specifies additional metadata for the application, e.g.,icons and the version number of the application.
This file is read by the Android system during installation of the application.The Android system evaluates this configuration file and determines thecapabilities of the application.
Android Manifest
Android XML Layout Android user interface dapat dibuat via XML layout resource yang diletakkan
pada folder /res/layout atau via progamatically Java code.
Definition: Untuk Mengakses XML Layout yang dibuat maka digunakan identifier dalam
method setContentView (id) pada Class activity.
Resources Android allows you to create static resources like images and XML
configuration files. This allows you to keep these resourcesseparate from the source code of your Android application.
Resource files must be placed in the /res directory of yourapplication in a predefined sub-folder.
The specific sub-folder depends on type of resource which isstored.
Resources
Layout Resource Files
Layout Resource Files
Android Fragment
Fragment:
Fragment memiliki fungsi sama dengan Activity yang bisamenghandle sebuah layout, namun Fragment tidak dapat berjalanindividual, fragment selalu membutuhkan sebuah Activity atau bisajuga disebut fragment selalu berjalan di atas Activity.
Kelebihan fragments
Fragments memudahkan reuse components dalam layoutyang berbeda.Contoh : membuat single-pane layout untuk handset(phones) dan multi-pane layout untuk tablet.
Fragments juga dapat digunakan untuk layout berbedasecara orientasi landscape maupun portrait padasmartphone.
“ The usage of fragments allows to design very flexibleuser interfaces”.
handset (phones)
Tablet.
Fragment Life Cycle
Sama halnya dengan activity, fragment juga bisa berada pada tigakeadaan (state), yaitu:
Resume, Fragment terlihat pada activity yang sedang berjalan.
Paused, Activity lain sedang berada di foreground danmendapatkan fokus, tapi activity host fragment masih terlihat(activity yang berada di foreground tidak sepenuhnyamenggunakan layar, atau transparan).
Stopped, Fragment tidak terlihat, karena activity yang menjadihost distop atau fragment dihapus dari activity namunditambahkan ke back stack.Sebuah fragment yang distop masih hidup, semua info danstatenya tetap dijaga oleh sistem, tetapi fragment itu tidak terlihatuser dan akan dimatikan jika activity dimatikan.
Untuk membuat fragment , harus extend android.app.Fragment class atau salah satu sub classnya, antara lain ListFragment, DialogFragment, PreferenceFragment atau WebViewFragment.
Method getFragmentManager() dapat digunakan untuk add, remove danreplace fragments pada layout activity.
https://groups.google.com/d/forum/papb_si_A
JOIN !!
QUESTIONS?
terimakasih.
...semoga bermanfaat