During this course, we will develop an Android application that will display photos taken by the rovers on Mars using Android Studio.
This app will use all the latest Jetpack technologies:
Compose (no more XML)
Hilt (Dagger Dependency Injection Framework)
Room (Jetpack component to create a lite database)
Retrofit (REST client)
Coroutines and Flow (To create asynchronous tasks and request our database)
You also use ViewModels with Jetpack to use an MVVM Repository architecture.
During this course, we will develop an Android application that will display photos taken by the rovers on Mars using Android Studio.
This app will use all the latest Jetpack technologies:
Compose (no more XML)
Hilt (Dagger Dependency Injection Framework)
Room (Jetpack component to create a lite database)
Retrofit (REST client)
Coroutines and Flow (To create asynchronous tasks and request our database)
You also use ViewModels with Jetpack to use an MVVM Repository architecture.
With this example, you should be able to create an Android App to the industry standard.
Navigation with Jetpack Compose could be challenging, so we will create a simple example with 4 screens and a BottomNav to understand it. A Scaffold will be use to create the BottomNav.
Your productivity will be improve as Jetpack Compose is easier to write and reuse.
You will improve your knowledge of Kotlin. If you still use Java, this course is an opportunity to learn.
Compose is a new way to create a UI on Android. It is more concise and reusable. Therefore, it helps to develop faster Android applications.
In this app we will use Jetpack Compose Components from Materal3:
Card
LazyColumn
Column
Row
AsyncIamge (from the Coil lib to display an image from a server)
Text
Image
NavHost (to use navigation)
NavigationBar
NavigationBarItem
Box
Scaffold
We will also see how we can use a modifier to define padding.
In this first part, we will explore the Android App that we will building during this course. We will also look at the NASA API used to get the data and image to be displayed.
We will see how we can create a NASA API key on the api.nasa.gov website. This step is optional, using the DEMO_KEY is possible for this course.
Thought a simple basketball example we will describe the observable pattern with Flow.
Discover how the code will be organized into 4 layers:
Activity/Compose elements
ViewModels
Repositories
Data layers (Retrofit for API network requests and Room for local database)
We will describe the observation pattern to illustrate how the data are updated on the screen.
This lecture will feature some code examples to explain the relationship between layers.
Let's verify if you have understand concept of the project layer.
Test your knowledge about Jetpack compose.
During this lecture, we will add a bottom bar to choose between all the rovers photos and the saved photos.
In the resource, find the Android Studio project with the result expected at the end of the video. Also find the rover icon in the resources.
Reading of the Room documentation to understand how we will use it inside the Android application.
We will create the sqlite marsRover.db using Room. We will define one table for this database by creating the MarsRoverSavedLocalModel. In addition, we will create the DAO to access the data.
Then we will use Flow Combine to mix network data with local data. In order to display the rover photo with the status save/not save. We will also make the photo card clickable to change this status.
Create the saved screen accessible from the bottom bar with the saved photo that came from the database. In the downloadable material, you will find the Android project at the end of this stage.
In this video, we will use Android Studio to explore what data is written in our local database.
This article describes how to create light and dark theme for our app. The next video is a live coding of it.
Define a light and dark theme with personalized colors to create the unique Mars Rover Explorer Android application.
Learn how to change to font of the app using Material3 theme.
In this lecture, we will animate the save/unsave icon when the user saves or unsaves the photo. The animation will be a scale-in/scale-out type. We will also play with duration.
In this lecture, we will create a MarsRoverManifestViewModelTest to test the MarsRoverManifestViewModel.
Mockk dependency will be added to mock a MarsRoverManifestRepo and control answers for this repo.
We will also add a MainCoroutineRule to use coroutines in our test.
In addition, we will refactor MarsRoverManifestViewModel to use the IoDispatcher in our coroutine.
We will write tests for the MarsRoverManifestRepo and use mockk to predefine answers for the MarsRoverManifestService (success and error).
We will use test with coverage to verify that we test all the lines in the MarsRoverPhotoViewModel.
In this video, we will write unit tests on the function that combines data from the Retrofit interface (network request) and the Dao interface (room database) into a single model.
We will create a composeTestRule to manipulate composable functions automatically. We will also update the version numbers for the BOM and Junit4 UI tests.
In this lecture, we will have a UI test that will start the Manifest compose function. For this, we will create a fake list of RoverManifestUiModel, then use composeTestRule to start the screen and run text assertions.
We will create on automated test that display a predefined list of photo and verify that some texts are display and id our screen contains item with the content description "save icon".
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.