Create a new blank Android app that includes a Fragment.
In order to turn the software that we write into something that can be run on a computer, we must build it. This includes compiling it (turning it into byte code) and linking it (combining different pieces of software, e.g. using a library with your new code). Build scripts can also be used to run tests.
Gradle is not the only way to build Android projects. Ant and Maven are other build systems available for Java and are commonly used for Android projects (especially Maven). Gradle is the default for Android Studio and is built on top of Groovy, which is a Ruby-like language built on the JVM.
gradlew is the Gradle Wrapper, which is its own script that determines how Gradle is run on the system.
Use Gradle to do the following with your app:
- Override the package name.
- Change the midSdkVersion and targetSdkVersion. What's a reasonable minSdkVersion given that Fragments are used? What is the targetSdkVersion and what does that mean?
- Change the compileSdkVersion to Jellybean.
- Change the versionCode and versionName. Figure out an appropriate version number.
- Bonus: Select an app you'll release to the Play Store and fix the Gradle files as above. Proguard your app.
Amy will lead this piece.
These are the steps for launching to the Google Play Store:
- Login to Google Console.
- Register the app.
- Upload the required images/descriptions and the optional images/video.
- Manage the versioning, uploading the apk and submit the updates/release notes.
Exercise: Set up your Play account, choose an app that you've created, an begin the process of uploading the app to the Play store. If you choose an app from group project, coordinate with your team members so only one person uploads the app.
An important part of gradle is manging the different artifacts that need to be compiled and run with your apps.
Exercise: Create an app using the Picasso library.