SlideShare ist ein Scribd-Unternehmen logo
1 von 96
The Best Way to Become an Android Developer
Expert
with Android Jetpack
Ahmad Arif Faizin
Academy Content Writer at Dicoding
Do You Know?
Let’s Listen
Their Story
dicoding.id/junia
dicoding.id/junia
dicoding.id/junia
dicoding.id/junia
dicoding.id/rosy
dicoding.id/rosy
dicoding.id/hastu
dicoding.id/hastu
dicoding.id/hastu
What
about us?
How to be
Developers?
Jetpack?
Kiri, Kanan, L1, L2, R1, R2, Atas,
Bawah, Kiri, Kanan
Android Jetpack
Jetpack is a collection of Android software
components to make it easier for you to develop
great Android apps.
Advantages
Accelerate development
Eliminate boilerplate code
Build high quality, robust apps
Layouting
LinearLayout ConstraintLayout RelativeLayout GridLayout ScrollView
Constraint Layout VS Other Layout
Passing Data
between Activity
Activity vs Fragment
Navigation
Using Library to Load Image
GlidePicasso
Pro Tips!
Android Debugging
First Step...
+
=
Android Networking - get data from API
Fast Android
Networking
Retrofit
Volley AQuery
Behavior - NotificationsReply & Deep Link action, Bubble, Interruptive & Gentle Notification
Status bar and notification drawer Heads-up notification
Notification
Channel
On and above Android 8.0 (Oreo)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(
CHANNEL_ID,
CHANNEL_NAME,
NotificationManager.IMPORTANCE_DEFAULT)
mBuilder.setChannelId(CHANNEL_ID)
mNotificationManager.createNotificationChannel(channel)
}
Behavior - PermissionsCompatibility APIs for checking and requesting app permissions
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.snazzyapp">
<uses-permission android:name="android.permission.SEND_SMS"/>
<application ...>
...
</application>
</manifest>
if (ContextCompat.checkSelfPermission(thisActivity,
Manifest.permission.READ_CONTACTS)
!= PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity,
Manifest.permission.READ_CONTACTS)) {
} else {
ActivityCompat.requestPermissions(thisActivity,
new String[]{Manifest.permission.READ_CONTACTS},
MY_PERMISSIONS_REQUEST_READ_CONTACTS);
}
} else {
// Permission has already been granted
}
Request Permission Flow
Permissions.check(this/*context*/, Manifest.permission.CALL_PHONE, null, new PermissionHandler() {
@Override
public void onGranted() {
// do your task.
}
});
Pro Tips!
Permission using Library
Android Permissions
https://github.com/nabinbhandari/Android-Permissions
Behavior - PreferencesCreate interactive settings screens
<androidx.preference.PreferenceScreen
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreferenceCompat
app:key="notifications"
app:title="Enable message notifications"/>
<Preference
app:key="feedback"
app:title="Send feedback"
app:summary="Report technical issues or suggest new features"/>
</androidx.preference.PreferenceScreen>
Data Persistence
Foundation - TestingAn Android testing framework for unit and runtime UI tests
Foundation - TestingAn Android testing framework for unit and runtime UI tests
Foundation - Unit Test
Getting Started
dependencies {
// Required -- JUnit 4 framework
testImplementation 'junit:junit:4.12'
// Optional -- Robolectric environment
testImplementation 'androidx.test:core:1.0.0'
// Optional -- Mockito framework
testImplementation 'org.mockito:mockito-core:1.10.19'
}
Foundation - Instrumental Testing
Getting Started
dependencies {
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
// Optional -- Hamcrest library
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with Espresso
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
// Optional -- UI testing with UI Automator
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}
Pro Tips!
Architecture Pattern
Architecture Pattern
● Maintainability
● Testability
● Extensibility
Architecture Component
Lifecycle - ViewModel - LiveData -Room
Repository
Benefit
Architecture - ViewModelManage UI-related data in a lifecycle-conscious way
Architecture - LiveData
Ensures your UI matches your data state
No memory leaks
No crashes due to stopped activities
No more manual lifecycle handling
Always up to date data
Proper configuration changes
Sharing resources
Notify views when underlying database changes
Architecture - LiveData
public class NameViewModel extends ViewModel {
// Create a LiveData with a String
private MutableLiveData<String> currentName;
public MutableLiveData<String> getCurrentName() {
if (currentName == null) {
currentName = new MutableLiveData<String>();
}
return currentName;
}
// Rest of the ViewModel...
}
Notify views when underlying database changes
public class NameActivity extends AppCompatActivity {
private NameViewModel model;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Other code to setup the activity...
// Get the ViewModel.
model = ViewModelProviders.of(this).get(NameViewModel.class);
// Create the observer which updates the UI.
final Observer<String> nameObserver = new Observer<String>() {
@Override
public void onChanged(@Nullable final String newName) {
// Update the UI, in this case, a TextView.
nameTextView.setText(newName);
}
};
// Observe the LiveData, passing in this activity as the LifecycleOwner and the observer.
model.getCurrentName().observe(this, nameObserver);
}
}
Architecture - RoomFluent SQLite database access
SQLite Vs Room
Create database table
@Entity
public class User {
@PrimaryKey
public int uid;
@ColumnInfo(name = "first_name")
public String firstName;
@ColumnInfo(name = "last_name")
public String lastName;
}
private static final String
WORD_LIST_TABLE_CREATE =
"CREATE TABLE " +WORD_LIST_TABLE + "
(" + UID + " INTEGER PRIMARY KEY, " +
FIRST_NAME + " TEXT, ” + LAST_NAME + "
TEXT );";
Architecture - RoomEntity
@Entity
public class User {
@PrimaryKey
public int uid;
@ColumnInfo(name = "first_name")
public String firstName;
@ColumnInfo(name = "last_name")
public String lastName;
}
Architecture - RoomDao
@Dao
public interface UserDao {
@Query("SELECT * FROM user")
List<User> getAll();
@Query("SELECT * FROM user WHERE uid IN (:userIds)")
List<User> loadAllByIds(int[] userIds);
@Query("SELECT * FROM user WHERE first_name LIKE :first AND " + "last_name LIKE :last LIMIT 1")
User findByName(String first, String last);
@Insert
void insertAll(User... users);
@Delete
void delete(User user);
}
Architecture - RoomDatabase
@Database(entities = {User.class}, version = 1)
public abstract class AppDatabase extends RoomDatabase {
public abstract UserDao userDao();
}
Create Database
AppDatabase db = Room.databaseBuilder(getApplicationContext(),
AppDatabase.class, "database-name").build();
Architecture - PagingGradually load information on demand from your data source
Architecture - PagingGradually load information on demand from your data source
DataSource
@Dao
public interface ConcertDao {
// The Integer type parameter tells Room to use a
// PositionalDataSource object.
@Query("SELECT * FROM concerts ORDER BY date DESC")
DataSource.Factory<Integer, Concert> concertsByDate();
}
Architecture - PagingGradually load information on demand from your data source
PagedList
public class ConcertViewModel extends ViewModel {
private ConcertDao concertDao;
public final LiveData<PagedList<Concert>> concertList;
// Creates a PagedList object with 50 items per page.
public ConcertViewModel(ConcertDao concertDao) {
this.concertDao = concertDao;
concertList = new LivePagedListBuilder<>(
concertDao.concertsByDate(), 50).build();
}
}
Architecture - PagingGradually load information on demand from your data source
UI
public class BookmarkPagedAdapter extends PagedListAdapter<DataModel, ViewHolder> {
...
}
Architecture - WorkManagerBest practice to handling background process
Architecture - WorkManager
public class UploadWorker extends Worker {
public UploadWorker(@NonNull Context context, @NonNull WorkerParameters params) {
super(context, params);
}
@Override
public Result doWork() {
// Do the work here--in this case, upload the images.
uploadImages()
// Indicate whether the task finished successfully with the Result
return Result.success()
}
}
Manage your Android background jobs
Architecture - WorkManager
OneTimeWorkRequest
OneTimeWorkRequest uploadWorkRequest = new OneTimeWorkRequest.Builder(UploadWorker.class).build()
PeriodicWorkRequest
Constraints constraints = new Constraints.Builder().setRequiresCharging(true).build();
PeriodicWorkRequest saveRequest = new PeriodicWorkRequest.Builder(SaveImageFileWorker.class, 1,
TimeUnit.HOURS).setConstraints(constraints).build();
WorkManager.getInstance().enqueue(saveRequest);
Manage your Android background jobs
Architecture - WorkManagerManage your Android background jobs
WorkContinuation chain1 = WorkManager.getInstance()
.beginWith(workA)
.then(workB);
WorkContinuation chain2 = WorkManager.getInstance()
.beginWith(workC)
.then(workD);
WorkContinuation chain3 = WorkContinuation
.combine(Arrays.asList(chain1, chain2))
.then(workE);
chain3.enqueue();
Documentation
g.co/jetpack
Try Sample App
https://github.com/googlesamples/
android-sunflower
What’s next?
Bimbingan
Project
Sertifikat / Sertifikasi
Kebutuhan
Industri IT
Talenta
Digital
Lulusan universitas
Lulusan SMK
Otodidak
Kursus
Profesional
dll (re-skilling)
Training /
Matrikulasi
Sertifikasi
https://idcamp.indosatooredoo.com/
VS
—IMAM SYAFI’I
Jika kamu tidak sanggup
menahan lelahnya belajar
maka kamu harus sanggup
menahan perihnya kebodohan
Thank You...
97
Ahmad Arif Faizin
0857 4048 2440
@arif_faizin
arif@dicoding.com

Weitere Àhnliche Inhalte

Was ist angesagt?

Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018Hassan Abid
 
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...Dicoding
 
Get Hip with JHipster - Colorado Springs Open Source User Group 2021
Get Hip with JHipster - Colorado Springs Open Source User Group 2021Get Hip with JHipster - Colorado Springs Open Source User Group 2021
Get Hip with JHipster - Colorado Springs Open Source User Group 2021Matt Raible
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache UsergridDavid M. Johnson
 
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Matt Raible
 
React Native AndroidはăȘぜ拕くぼか
React Native AndroidはăȘぜ拕くぼかReact Native AndroidはăȘぜ拕くぼか
React Native AndroidはăȘぜ拕くぼかYukiya Nakagawa
 
Opensocial Haifa Seminar - 2008.04.08
Opensocial Haifa Seminar - 2008.04.08Opensocial Haifa Seminar - 2008.04.08
Opensocial Haifa Seminar - 2008.04.08Ari Leichtberg
 
I/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew KurniadiI/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew KurniadiDicoding
 
Android App Development using HTML5 Technology
Android App Development using HTML5 TechnologyAndroid App Development using HTML5 Technology
Android App Development using HTML5 TechnologyOon Arfiandwi
 
Ajaxworld Opensocial Presentation
Ajaxworld Opensocial PresentationAjaxworld Opensocial Presentation
Ajaxworld Opensocial PresentationChris Schalk
 
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019Matt Raible
 
Google App Engine for Python - Unit01: Basic
Google App Engine for Python - Unit01: BasicGoogle App Engine for Python - Unit01: Basic
Google App Engine for Python - Unit01: BasicWei-Tsung Su
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play frameworkAlexander Reelsen
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹
Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹
Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹Yukiya Nakagawa
 
Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18Tabăra de Testare
 
ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRA»
ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRAÂ»ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRA»
ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRA»DataArt
 
ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave"
ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave" ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave"
ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave" IT Event
 

Was ist angesagt? (20)

Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018
 
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
 
Get Hip with JHipster - Colorado Springs Open Source User Group 2021
Get Hip with JHipster - Colorado Springs Open Source User Group 2021Get Hip with JHipster - Colorado Springs Open Source User Group 2021
Get Hip with JHipster - Colorado Springs Open Source User Group 2021
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
 
React Native AndroidはăȘぜ拕くぼか
React Native AndroidはăȘぜ拕くぼかReact Native AndroidはăȘぜ拕くぼか
React Native AndroidはăȘぜ拕くぼか
 
Opensocial Haifa Seminar - 2008.04.08
Opensocial Haifa Seminar - 2008.04.08Opensocial Haifa Seminar - 2008.04.08
Opensocial Haifa Seminar - 2008.04.08
 
I/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew KurniadiI/O Extended (GDG Bogor) - Andrew Kurniadi
I/O Extended (GDG Bogor) - Andrew Kurniadi
 
Android App Development using HTML5 Technology
Android App Development using HTML5 TechnologyAndroid App Development using HTML5 Technology
Android App Development using HTML5 Technology
 
Ajaxworld Opensocial Presentation
Ajaxworld Opensocial PresentationAjaxworld Opensocial Presentation
Ajaxworld Opensocial Presentation
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
 
Google App Engine for Python - Unit01: Basic
Google App Engine for Python - Unit01: BasicGoogle App Engine for Python - Unit01: Basic
Google App Engine for Python - Unit01: Basic
 
Introduction in the play framework
Introduction in the play frameworkIntroduction in the play framework
Introduction in the play framework
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹
Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹
Atomic DesignăŻă€Œăƒžăƒ«ăƒă€ă§çœŸäŸĄă‚’ç™șæźă™ă‚‹
 
Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18Webdriver with Thucydides - TdT@Cluj #18
Webdriver with Thucydides - TdT@Cluj #18
 
React Native
React NativeReact Native
React Native
 
ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRA»
ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRAÂ»ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRA»
ĐĐœĐŽŃ€Đ”Đč ĐĄĐ°ĐșŃĐŸĐœĐŸĐČ Â«Đ Đ°Đ·Ń€Đ°Đ±ĐŸŃ‚ĐșĐ° ĐżĐ»Đ°ĐłĐžĐœĐŸĐČ ĐŽĐ»Ń Atlassian JIRA»
 
ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave"
ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave" ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave"
ЗĐČОаЎ КарЮаĐČĐ° "Android Things + Google Weave"
 

Ähnlich wie The Best Way to Become an Android Developer Expert with Android Jetpack

Android Jetpack - Google IO Extended Singapore 2018
Android Jetpack - Google IO Extended Singapore 2018Android Jetpack - Google IO Extended Singapore 2018
Android Jetpack - Google IO Extended Singapore 2018Hassan Abid
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsHassan Abid
 
Android Architecture Components - Guy Bar on, Vonage
Android Architecture Components - Guy Bar on, VonageAndroid Architecture Components - Guy Bar on, Vonage
Android Architecture Components - Guy Bar on, VonageDroidConTLV
 
Java Technology
Java TechnologyJava Technology
Java Technologyifnu bima
 
Data access
Data accessData access
Data accessJoshua Yoon
 
Architecture components - IT Talk
Architecture components - IT TalkArchitecture components - IT Talk
Architecture components - IT TalkConstantine Mars
 
Architecture Components
Architecture Components Architecture Components
Architecture Components DataArt
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHPPaulo Victor Gomes
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)Jose Manuel Pereira Garcia
 
Cross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with EclipseCross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with EclipsePeter Friese
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Murat Yener
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web DevelopmentRobert J. Stein
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsAndreas Schreiber
 
DataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementDataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementAndreas Schreiber
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WAREFermin Galan
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
My way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca editionMy way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca editionChristian Panadero
 

Ähnlich wie The Best Way to Become an Android Developer Expert with Android Jetpack (20)

Android Jetpack - Google IO Extended Singapore 2018
Android Jetpack - Google IO Extended Singapore 2018Android Jetpack - Google IO Extended Singapore 2018
Android Jetpack - Google IO Extended Singapore 2018
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
Android Architecture Components - Guy Bar on, Vonage
Android Architecture Components - Guy Bar on, VonageAndroid Architecture Components - Guy Bar on, Vonage
Android Architecture Components - Guy Bar on, Vonage
 
Java Technology
Java TechnologyJava Technology
Java Technology
 
Data access
Data accessData access
Data access
 
Architecture components - IT Talk
Architecture components - IT TalkArchitecture components - IT Talk
Architecture components - IT Talk
 
Architecture Components
Architecture Components Architecture Components
Architecture Components
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 
Cross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with EclipseCross-Platform Native Mobile Development with Eclipse
Cross-Platform Native Mobile Development with Eclipse
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of Scientists
 
DataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementDataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data Management
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
My way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca editionMy way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca edition
 

Mehr von Ahmad Arif Faizin

Proker Departemen Dakwah dan Syiar 2013.pptx
Proker Departemen Dakwah dan Syiar 2013.pptxProker Departemen Dakwah dan Syiar 2013.pptx
Proker Departemen Dakwah dan Syiar 2013.pptxAhmad Arif Faizin
 
DKM_2013_BISMILLAH.pptx
DKM_2013_BISMILLAH.pptxDKM_2013_BISMILLAH.pptx
DKM_2013_BISMILLAH.pptxAhmad Arif Faizin
 
Proker bendahara al muhandis 2013.ppt
Proker bendahara al muhandis 2013.pptProker bendahara al muhandis 2013.ppt
Proker bendahara al muhandis 2013.pptAhmad Arif Faizin
 
PPT raker EKONOMI 2013.pptx
PPT raker EKONOMI 2013.pptxPPT raker EKONOMI 2013.pptx
PPT raker EKONOMI 2013.pptxAhmad Arif Faizin
 
Program Kerja Kaderisasi Al Muhandis 2013
Program Kerja Kaderisasi Al Muhandis 2013Program Kerja Kaderisasi Al Muhandis 2013
Program Kerja Kaderisasi Al Muhandis 2013Ahmad Arif Faizin
 
Departemen Mentoring.pptx
Departemen Mentoring.pptxDepartemen Mentoring.pptx
Departemen Mentoring.pptxAhmad Arif Faizin
 
PPT KKN PEDURUNGAN 2016.pptx
PPT KKN PEDURUNGAN 2016.pptxPPT KKN PEDURUNGAN 2016.pptx
PPT KKN PEDURUNGAN 2016.pptxAhmad Arif Faizin
 
Dts x dicoding #5 memulai pemrograman kotlin
Dts x dicoding #5 memulai pemrograman kotlinDts x dicoding #5 memulai pemrograman kotlin
Dts x dicoding #5 memulai pemrograman kotlinAhmad Arif Faizin
 
Dts x dicoding #4 memulai pemrograman kotlin
Dts x dicoding #4 memulai pemrograman kotlinDts x dicoding #4 memulai pemrograman kotlin
Dts x dicoding #4 memulai pemrograman kotlinAhmad Arif Faizin
 
Dts x dicoding #3 memulai pemrograman kotlin
Dts x dicoding #3 memulai pemrograman kotlinDts x dicoding #3 memulai pemrograman kotlin
Dts x dicoding #3 memulai pemrograman kotlinAhmad Arif Faizin
 
Dts x dicoding #2 memulai pemrograman kotlin
Dts x dicoding #2 memulai pemrograman kotlinDts x dicoding #2 memulai pemrograman kotlin
Dts x dicoding #2 memulai pemrograman kotlinAhmad Arif Faizin
 
Dts x dicoding #1 memulai pemrograman kotlin
Dts x dicoding #1 memulai pemrograman kotlinDts x dicoding #1 memulai pemrograman kotlin
Dts x dicoding #1 memulai pemrograman kotlinAhmad Arif Faizin
 
Dsc how google programs make great developer
Dsc how google programs make great developerDsc how google programs make great developer
Dsc how google programs make great developerAhmad Arif Faizin
 
First Gathering Sandec
First Gathering SandecFirst Gathering Sandec
First Gathering SandecAhmad Arif Faizin
 
Mockup Android Application Template Library
Mockup Android Application Template LibraryMockup Android Application Template Library
Mockup Android Application Template LibraryAhmad Arif Faizin
 
Mockup Android Application : Go bon
Mockup Android Application : Go bonMockup Android Application : Go bon
Mockup Android Application : Go bonAhmad Arif Faizin
 
Template Video Invitation Walimatul Ursy
Template Video Invitation Walimatul UrsyTemplate Video Invitation Walimatul Ursy
Template Video Invitation Walimatul UrsyAhmad Arif Faizin
 

Mehr von Ahmad Arif Faizin (20)

Proker Departemen Dakwah dan Syiar 2013.pptx
Proker Departemen Dakwah dan Syiar 2013.pptxProker Departemen Dakwah dan Syiar 2013.pptx
Proker Departemen Dakwah dan Syiar 2013.pptx
 
DKM_2013_BISMILLAH.pptx
DKM_2013_BISMILLAH.pptxDKM_2013_BISMILLAH.pptx
DKM_2013_BISMILLAH.pptx
 
Proker bendahara al muhandis 2013.ppt
Proker bendahara al muhandis 2013.pptProker bendahara al muhandis 2013.ppt
Proker bendahara al muhandis 2013.ppt
 
PPT raker EKONOMI 2013.pptx
PPT raker EKONOMI 2013.pptxPPT raker EKONOMI 2013.pptx
PPT raker EKONOMI 2013.pptx
 
Program Kerja Kaderisasi Al Muhandis 2013
Program Kerja Kaderisasi Al Muhandis 2013Program Kerja Kaderisasi Al Muhandis 2013
Program Kerja Kaderisasi Al Muhandis 2013
 
Departemen Mentoring.pptx
Departemen Mentoring.pptxDepartemen Mentoring.pptx
Departemen Mentoring.pptx
 
ANNISAA' 2013.pptx
ANNISAA' 2013.pptxANNISAA' 2013.pptx
ANNISAA' 2013.pptx
 
PPT KKN PEDURUNGAN 2016.pptx
PPT KKN PEDURUNGAN 2016.pptxPPT KKN PEDURUNGAN 2016.pptx
PPT KKN PEDURUNGAN 2016.pptx
 
Absis UNBK.pptx
Absis UNBK.pptxAbsis UNBK.pptx
Absis UNBK.pptx
 
Dts x dicoding #5 memulai pemrograman kotlin
Dts x dicoding #5 memulai pemrograman kotlinDts x dicoding #5 memulai pemrograman kotlin
Dts x dicoding #5 memulai pemrograman kotlin
 
Dts x dicoding #4 memulai pemrograman kotlin
Dts x dicoding #4 memulai pemrograman kotlinDts x dicoding #4 memulai pemrograman kotlin
Dts x dicoding #4 memulai pemrograman kotlin
 
Dts x dicoding #3 memulai pemrograman kotlin
Dts x dicoding #3 memulai pemrograman kotlinDts x dicoding #3 memulai pemrograman kotlin
Dts x dicoding #3 memulai pemrograman kotlin
 
Dts x dicoding #2 memulai pemrograman kotlin
Dts x dicoding #2 memulai pemrograman kotlinDts x dicoding #2 memulai pemrograman kotlin
Dts x dicoding #2 memulai pemrograman kotlin
 
Dts x dicoding #1 memulai pemrograman kotlin
Dts x dicoding #1 memulai pemrograman kotlinDts x dicoding #1 memulai pemrograman kotlin
Dts x dicoding #1 memulai pemrograman kotlin
 
Dsc how google programs make great developer
Dsc how google programs make great developerDsc how google programs make great developer
Dsc how google programs make great developer
 
First Gathering Sandec
First Gathering SandecFirst Gathering Sandec
First Gathering Sandec
 
Mockup Android Application Template Library
Mockup Android Application Template LibraryMockup Android Application Template Library
Mockup Android Application Template Library
 
Mockup Android Application : Go bon
Mockup Android Application : Go bonMockup Android Application : Go bon
Mockup Android Application : Go bon
 
Lomba Sayembara Logo
Lomba Sayembara LogoLomba Sayembara Logo
Lomba Sayembara Logo
 
Template Video Invitation Walimatul Ursy
Template Video Invitation Walimatul UrsyTemplate Video Invitation Walimatul Ursy
Template Video Invitation Walimatul Ursy
 

KĂŒrzlich hochgeladen

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

KĂŒrzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

The Best Way to Become an Android Developer Expert with Android Jetpack

  • 1. The Best Way to Become an Android Developer Expert with Android Jetpack Ahmad Arif Faizin Academy Content Writer at Dicoding
  • 2.
  • 3.
  • 4.
  • 6.
  • 7.
  • 8.
  • 9.
  • 22.
  • 23.
  • 24. Jetpack? Kiri, Kanan, L1, L2, R1, R2, Atas, Bawah, Kiri, Kanan
  • 25.
  • 26. Android Jetpack Jetpack is a collection of Android software components to make it easier for you to develop great Android apps.
  • 27. Advantages Accelerate development Eliminate boilerplate code Build high quality, robust apps
  • 28.
  • 29.
  • 30.
  • 32. Constraint Layout VS Other Layout
  • 36. Using Library to Load Image GlidePicasso Pro Tips!
  • 39.
  • 40.
  • 41. Android Networking - get data from API Fast Android Networking Retrofit Volley AQuery
  • 42.
  • 43. Behavior - NotificationsReply & Deep Link action, Bubble, Interruptive & Gentle Notification Status bar and notification drawer Heads-up notification
  • 44. Notification Channel On and above Android 8.0 (Oreo) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val channel = NotificationChannel( CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT) mBuilder.setChannelId(CHANNEL_ID) mNotificationManager.createNotificationChannel(channel) }
  • 45. Behavior - PermissionsCompatibility APIs for checking and requesting app permissions <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.snazzyapp"> <uses-permission android:name="android.permission.SEND_SMS"/> <application ...> ... </application> </manifest>
  • 46. if (ContextCompat.checkSelfPermission(thisActivity, Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity, Manifest.permission.READ_CONTACTS)) { } else { ActivityCompat.requestPermissions(thisActivity, new String[]{Manifest.permission.READ_CONTACTS}, MY_PERMISSIONS_REQUEST_READ_CONTACTS); } } else { // Permission has already been granted } Request Permission Flow
  • 47. Permissions.check(this/*context*/, Manifest.permission.CALL_PHONE, null, new PermissionHandler() { @Override public void onGranted() { // do your task. } }); Pro Tips! Permission using Library Android Permissions https://github.com/nabinbhandari/Android-Permissions
  • 48. Behavior - PreferencesCreate interactive settings screens <androidx.preference.PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"> <SwitchPreferenceCompat app:key="notifications" app:title="Enable message notifications"/> <Preference app:key="feedback" app:title="Send feedback" app:summary="Report technical issues or suggest new features"/> </androidx.preference.PreferenceScreen>
  • 50. Foundation - TestingAn Android testing framework for unit and runtime UI tests
  • 51. Foundation - TestingAn Android testing framework for unit and runtime UI tests
  • 52. Foundation - Unit Test Getting Started dependencies { // Required -- JUnit 4 framework testImplementation 'junit:junit:4.12' // Optional -- Robolectric environment testImplementation 'androidx.test:core:1.0.0' // Optional -- Mockito framework testImplementation 'org.mockito:mockito-core:1.10.19' }
  • 53. Foundation - Instrumental Testing Getting Started dependencies { androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test:rules:1.1.0' // Optional -- Hamcrest library androidTestImplementation 'org.hamcrest:hamcrest-library:1.3' // Optional -- UI testing with Espresso androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' // Optional -- UI testing with UI Automator androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' }
  • 54.
  • 56.
  • 57.
  • 59. Architecture Pattern ● Maintainability ● Testability ● Extensibility
  • 60.
  • 61. Architecture Component Lifecycle - ViewModel - LiveData -Room
  • 63. Architecture - ViewModelManage UI-related data in a lifecycle-conscious way
  • 64. Architecture - LiveData Ensures your UI matches your data state No memory leaks No crashes due to stopped activities No more manual lifecycle handling Always up to date data Proper configuration changes Sharing resources Notify views when underlying database changes
  • 65.
  • 66. Architecture - LiveData public class NameViewModel extends ViewModel { // Create a LiveData with a String private MutableLiveData<String> currentName; public MutableLiveData<String> getCurrentName() { if (currentName == null) { currentName = new MutableLiveData<String>(); } return currentName; } // Rest of the ViewModel... } Notify views when underlying database changes
  • 67. public class NameActivity extends AppCompatActivity { private NameViewModel model; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Other code to setup the activity... // Get the ViewModel. model = ViewModelProviders.of(this).get(NameViewModel.class); // Create the observer which updates the UI. final Observer<String> nameObserver = new Observer<String>() { @Override public void onChanged(@Nullable final String newName) { // Update the UI, in this case, a TextView. nameTextView.setText(newName); } }; // Observe the LiveData, passing in this activity as the LifecycleOwner and the observer. model.getCurrentName().observe(this, nameObserver); } }
  • 68. Architecture - RoomFluent SQLite database access
  • 69. SQLite Vs Room Create database table @Entity public class User { @PrimaryKey public int uid; @ColumnInfo(name = "first_name") public String firstName; @ColumnInfo(name = "last_name") public String lastName; } private static final String WORD_LIST_TABLE_CREATE = "CREATE TABLE " +WORD_LIST_TABLE + " (" + UID + " INTEGER PRIMARY KEY, " + FIRST_NAME + " TEXT, ” + LAST_NAME + " TEXT );";
  • 70. Architecture - RoomEntity @Entity public class User { @PrimaryKey public int uid; @ColumnInfo(name = "first_name") public String firstName; @ColumnInfo(name = "last_name") public String lastName; }
  • 71. Architecture - RoomDao @Dao public interface UserDao { @Query("SELECT * FROM user") List<User> getAll(); @Query("SELECT * FROM user WHERE uid IN (:userIds)") List<User> loadAllByIds(int[] userIds); @Query("SELECT * FROM user WHERE first_name LIKE :first AND " + "last_name LIKE :last LIMIT 1") User findByName(String first, String last); @Insert void insertAll(User... users); @Delete void delete(User user); }
  • 72. Architecture - RoomDatabase @Database(entities = {User.class}, version = 1) public abstract class AppDatabase extends RoomDatabase { public abstract UserDao userDao(); } Create Database AppDatabase db = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "database-name").build();
  • 73. Architecture - PagingGradually load information on demand from your data source
  • 74.
  • 75. Architecture - PagingGradually load information on demand from your data source DataSource @Dao public interface ConcertDao { // The Integer type parameter tells Room to use a // PositionalDataSource object. @Query("SELECT * FROM concerts ORDER BY date DESC") DataSource.Factory<Integer, Concert> concertsByDate(); }
  • 76. Architecture - PagingGradually load information on demand from your data source PagedList public class ConcertViewModel extends ViewModel { private ConcertDao concertDao; public final LiveData<PagedList<Concert>> concertList; // Creates a PagedList object with 50 items per page. public ConcertViewModel(ConcertDao concertDao) { this.concertDao = concertDao; concertList = new LivePagedListBuilder<>( concertDao.concertsByDate(), 50).build(); } }
  • 77. Architecture - PagingGradually load information on demand from your data source UI public class BookmarkPagedAdapter extends PagedListAdapter<DataModel, ViewHolder> { ... }
  • 78. Architecture - WorkManagerBest practice to handling background process
  • 79.
  • 80. Architecture - WorkManager public class UploadWorker extends Worker { public UploadWorker(@NonNull Context context, @NonNull WorkerParameters params) { super(context, params); } @Override public Result doWork() { // Do the work here--in this case, upload the images. uploadImages() // Indicate whether the task finished successfully with the Result return Result.success() } } Manage your Android background jobs
  • 81. Architecture - WorkManager OneTimeWorkRequest OneTimeWorkRequest uploadWorkRequest = new OneTimeWorkRequest.Builder(UploadWorker.class).build() PeriodicWorkRequest Constraints constraints = new Constraints.Builder().setRequiresCharging(true).build(); PeriodicWorkRequest saveRequest = new PeriodicWorkRequest.Builder(SaveImageFileWorker.class, 1, TimeUnit.HOURS).setConstraints(constraints).build(); WorkManager.getInstance().enqueue(saveRequest); Manage your Android background jobs
  • 82. Architecture - WorkManagerManage your Android background jobs WorkContinuation chain1 = WorkManager.getInstance() .beginWith(workA) .then(workB); WorkContinuation chain2 = WorkManager.getInstance() .beginWith(workC) .then(workD); WorkContinuation chain3 = WorkContinuation .combine(Arrays.asList(chain1, chain2)) .then(workE); chain3.enqueue();
  • 86.
  • 87. Sertifikat / Sertifikasi Kebutuhan Industri IT Talenta Digital Lulusan universitas Lulusan SMK Otodidak Kursus Profesional dll (re-skilling) Training / Matrikulasi Sertifikasi
  • 88.
  • 89.
  • 91.
  • 92.
  • 93. VS
  • 94. —IMAM SYAFI’I Jika kamu tidak sanggup menahan lelahnya belajar maka kamu harus sanggup menahan perihnya kebodohan
  • 96. 97 Ahmad Arif Faizin 0857 4048 2440 @arif_faizin arif@dicoding.com