You can use the app provided in the exercise files, or you can follow along with your own app. The app is a brochure app for a fictional restaurant named Nadia's Garden Restaurant, and is available for download and installation through Google Play.
- [Instructor] To follow along with this courses demonstrations, you can use the sample app that I've provided with the exercise files or you can use your own application. The focus of the course is on deploying apps, not building them so any app will do. I'm going to open my project from the exercise files. I'll go to my desktop, and then to the exercise files directory. Then to chapter two, to the one sub directory, and I'll open the NadiasRestaurant project. This project was built with a previous version of Android Studio.
I did that intentionally because I wanted to show you that when you open it, no matter which version of Android Studio you use, you'll be prompted to upgrade the Gradle Plugin. Click the update button and that will update the project to match your version of Android Studio. As I described in the video on using the exercise files, you'll also need to make sure that you have all the appropriate components from the Android SDK. If you see any other prompt to update components, download what's requested and then rebuild the project by selecting Build, Rebuild Project.
And when the messages at the bottom of the screen have stopped being displayed, you'll be ready to run the app on a device. You can test this very simple app on either a virtual or a physical device. For these demonstrations, I'll be using a Google Pixel. It's running Android 7.1 and I'm projecting its screen to my computer screen for recording using a product called Reflector 2. I'll go to the Android monitor window in Android Studio and I'll see that my Pixel device is connected.
And I'm seeing the logcat output appear. Then I'll run the app on the device. This is a very simple data oriented application. It presents a list of data, and the user can select an item by touching a row and that displays the details. Then they can go back to the main screen. There's a settings screen with a single option and there's a sign in screen. I'll show you the basic structure of the project in the project window. The main activity class starts off with dummy data that comes from a class named SampleDataProvider.
It's all defined here. But then, as the application starts up, it loads that data into a SQL LIKE database for data persistence. There's code here to work with a drawer layout, and when the user drags the drawer out from the left side of the screen, they're allowed to select a category. And then when they select the category, that limits the items that are displayed on the screen. There are a lot of different Java classes here, but when you build the application, they're all built into a single APK file.
And for debugging purposes, when you run the application on a device, you're actually building an APK in the background and loading it onto the device. If you wanted to build the APK explicitly, you could go to the menu and choose Build, Build APK. You'll see a message at the bottom of the screen indicating Gradle Build running, and then when the process is done, a link in the upper right corner that allows you to jump to the APK file in explorer or finder.
And you'll see that you have an APK file called app-debug.apk. You could take that APK file and share it with the device and install it that way instead. Either way, you're running a debugged version of the application. So that's an introduction to the sample app that I'll be using. And again, you can follow along with this or your own Android app.
- Packaging apps in APK files
- Building a signed APK file
- Distributing through Google Play
- Adding app graphics
- Setting pricing
- Publishing the app
- Submitting an app to Amazon
- Tracking app use in Google Play and Amazon