For the Android portion of this course, the viable options for a development environment are somewhat limited, vs. those for Java development in general. With some ingenuity, many different alternatives are available; however, there is just one IDE officially supported by Google: Android Studio. Actually, that isn’t quite true: Android Studio is essentially a subset of IntelliJ IDEA Ultimate; the latter includes not only the Android development tools in Android Studio, but also a wide variety of additional tools and features for general and enterprise-level Java development.

Given the above, our primary IDE in this bootcamp is IntelliJ IDEA Ultimate. This is a commercial product (IntelliJ IDEA Community is open source), but you can obtain a 12-month free license with your cnm.edu email address. Important: For this bootcamp, you must install and use IntelliJ IDEA Ultimate (not the Community edition), whether you do so with an educational license or purchase the product.

Videos

JetBrains education license

Earlier in the pre-work, you applied for and obtained a JetBrains education license. This is the license that will allow you to use IntelliJ IDEA Ultimate for a 1 year, free of charge. (This license can be renewed, as long as you maintain a .edu email address.)

Download

You have 2 options for downloading and installing: The first (and highly recommended) option is that you download and install the JetBrains Toolbox, and use that to install IntelliJ IDEA; the second is by downloading and running the IntelliJ IDEA installer.

After you have created your JetBrains account, browse to either Toolbox App (recommended) or Download IntelliJ IDEA, and download the selected package.

Installation

Installing via the Jetbrains Toolbox

Installing the Toolbox

  1. From your downloads directory, launch the JetBrains toolbox installer.

  2. After the Toolbox is installed, launch it.

  3. In the main Toolbox window, click on the settings icon (displayed as a sprocket, gear, or hardware nut) in the upper-right.

  4. In the Toolbox App Settings window, click on the Log in link.

  5. In the web page that appears, log in with your JetBrains credentials.

  6. When you are asked to approve the sharing of credentials with the Toolbox app, click Approve.

  7. If the browser displays it, select the option to re-launch the Toolbox with the credentials.

  8. Open the Toolbox again; if the Toolbox App Settings window appears, click the left arrow to return to the main window.

Installing IntelliJ IDEA from the Toolbox

  1. In the main Toolbox window, find and click IntelliJ IDEA Ultimate in the list of available products.

  2. Click the Versions tab to display the versions of IntelliJ IDEA Ultimate that are available for installation.

  3. Click the Install button for the 2021.3.1 version.

  4. The installation is now in progress. When it completes, IntelliJ IDEA Ultimate will appear in the list of installed products.

  5. Proceed to “Initial configuration”.

Installing with the IntelliJ IDEA installer

Windows

  1. Double-click the downloaded ideaIU-2021.3.1.exe file to launch the installer.

  2. Follow the steps in the installation wizard, accepting the default installation location and options.

  3. Keep the ideaIU-2021.3.1.exe file handy, in case you need to reinstall it. However, once installed, you should not attempt to launch IntelliJ IDEA through the installer; instead, access it through the Windows Start menu.

OS X

  1. In the Finder, double-click the downloaded ideaIU-2021.3.1.dmg file to mount it as a disk image and display its contents.

  2. Drag the IntelliJ IDEA item from the disk image to your Applications folder.

  3. Unmount the disk image (e.g. by dragging it to the trash). Note that while you should keep the idealU-2021.3.1.dmg file handy, in case you need to re-install, you shouldn’t use it to launch the IntelliJ IDEA application itself; instead, launch it from the Applications folder, or drag it from Applications to the Dock, and launch it from there.

Ubuntu

  1. Unpack the downloaded ideaIU-2021.3.1.tar.gz file using the command:

     tar -xzf ideaIU-2021.3.1.tar.gz
    
  2. To launch IntelliJ IDEA, execute the idea.sh file in the bin directory created by the tar extraction.

Initial configuration

Unfortunately, while IntelliJ IDEA Ultimate is a more comprehensive and broadly applicable IDE than Android Studio, that also means there’s more work involved in configuring it. You’ll do some of this configuration later in the pre-work, but we’ll get started with it now.

See Run IntelliJ IDEA for the first time for a walk-through of the initial configuration. Use this as a guide for steps 1–3, below. Also, a video walkthrough for steps 4–9 is available at the bottom of the page.

  1. Launch the installed IntelliJ IDEA (do not re-run the installer). If you installed the JetBrains Toolbox, you can launch from the Toolbox window; otherwise (and additionally), you can launch it from the Start menu (Windows) or the Applications folder (OS X).

  2. If presented with a list of default plugins, do not disable any of the default plugins!

  3. Continue to the IntelliJ IDEA welcome screen. (Along the way, you may be asked to provide license information; you can do this with your JetBrains login name & password.)

  4. Use the Ctrl+Alt+Shift+S (on Windows and Ubuntu) or Ctrl+; (on OS X) key combination to open the Project Structure for New Projects dialog.

  5. Select Platform Settings/SDKs from the navigation pane on the left-hand side.

  6. Configure IntelliJ IDEA to use JDK 11 & JDK 17 that you installed previously by following steps 1–2 of Configure Global SDKs in Define an SDK. Note: One or both of these JDKs may already appear in the list of configured JDKs; if so, there is no need to configure that JDK again.

    Even if JDK 11 or JDK 17 doesn’t appear on the list of installed SDKs, it might appear at the bottom the menu that appears when you click the plus sign; this is because IntelliJ detects Java installations in certain common locations. If it does appear there, simply select it.

  7. Once you have IntelliJ IDEA configured to use the installed JDK 11 & JDK 17, you can now configure it to use the installed Android SDK. To do this, begin by adding another SDK, but selecting Add Android SDK from the pull-down list of new SDK types.

  8. In the Select Home Directory for Android SDK dialog, navigate to the directory where you previously installed the Android SDK (C:\android\sdk or /opt/android/sdk), click on that directory, then click the OK button.

  9. In the Create New Android SDK dialog, make sure that the Java SDK selector shows “11”, then select “Android API 26” as the Build target value, and click the OK button.

  10. Finally click the OK button in the Project Structure for New Projects dialog to save your SDK settings.

  11. Now, click Customize in the navigation pane on the left-hand side.

  12. Near the bottom of the main panel, click the All settings link. This will open the Settings window.

  13. In the navigation pane on the left of the Settings window, click on the Version Control/Git option.

  14. In the Protected branches field, near the bottom of the main panel, add a space after “master”, then type “main”—if it’s not already there. (Don’t include the quotes.)

  15. Click the Apply button (but not OK) in the lower-right.

  16. In the search bar in the upper-left corner of the window, now type “github” (without the quotation marks) as a single word.

  17. Click the Version Control/GitHub option in the navigation pane.

  18. Near the bottom of the main panel, select the Clone git repositories using ssh checkbox.

  19. If no GitHub accounts appear in the list above the checkbox, click the Add account link that appears in the center of the empty list area. This will open a browser tab with an Authorize in GitHub button.

  20. Click the Authorize in GitHub button, and follow the subsequent steps to give IntelliJ IDEA access to your GitHub account; this will allow you to create and manage GitHub repositories while in IntelliJ.

  21. Once again, click the Apply button.

  22. In the search bar in the upper-left corner, type “constant conditions” (without the quotes), replacing whatever was already there.

  23. From the navigation panel on the left side, click on the Editor/Inspections option.

  24. You should now see a vertically scrolling list of inspections, near the center of the Settings window. From this list, select the Java/Probable bugs/Constant conditions & exceptions option (you’ll probably have to scroll down a bit). Don’t uncheck the check box for this item; simply click on the text itself.

  25. Near the lower-right of the window (but above the OK/Cancel/Apply buttons), you should see an Options section, with a button labeled Configure Annotations; click that button.

  26. A new window, titled Nullable/NotNull Configuration appears. In the upper list of this window (Nullable Annotations), find and select the item named androidx.annotation.Nullable. Then, click the check mark in the icons at the top of that list.

  27. In the lower list of the window, labeled NonNull Annotations, find and select the item named androidx.annotation.NonNull. Once again, click the check mark at the top of the list.

  28. Click the OK button in the Nullable/NotNull Configuration window.

  29. Click the OK button in the Settings window.