How to Set Up an Android Development Environment On Ubuntu and Mac


This article is a detailed guide for setting up of Android Development Set up on Mac or Ubuntu. See the steps you need to follow along with the images to verify if you are progressing correctly and get started with Android development on your own computer.

Mobile apps have a lot of pull in the modern market and for good reason. They work well to draw new customers in, keep established customers coming back, build brand loyalty, encourage impulse spending, and more. This is why according to Statista, there were more than 2.9 million apps available on the Google Play Store by the end of 2019.

This has made mobile app design and development services incredibly popular over the last few years. After all, these services can help companies create one-of-a-kind apps that their customers will not only use but appreciate and enjoy using as well.

When it comes to native Android app development, these services - as well as independent developers - require the right tools to get the job done. If you use Mac or Ubuntu software, these tools will help you set up an Android Development Environment to help you get set up and ready to go.

A Guide to Setting Up Android Development Environments On Mac

Installing the Java Development Kit


Java Development Kit is a popular choice when it comes to developing a variety of software types. To check and see if you already have this software on your Mac and it just needs to be set up, you can type in "java - version" into the OS command prompt.

If you do have Java, you'll need to make sure that you have at least Java version 1.8x or an even more modern version. A "command not found" prompt will appear if you don't have Java installed on your Mac.
JAVA SE download from Oracle website
It's important to ensure that you're using the latest version of Java for two reasons. For one, updates often include new features and functions that can help you in your app development. Secondly, much of the other software you'll need is only compatible with certain recent versions of the Java Development Kit.

If you're completely new to Java Development Kit, start by visiting oracle.com/java. From here, you can get a trial version by clicking the "Try for Free" button or purchase the full software with the "Get Java SE Support" prompt.

You can find these commands on the home page of the website that link leads you to. You don't have to worry about navigating the site once you're there.
Java Application development
The next steps are rather simple and don't really need a step-by-step tutorial here. Instead, you'll have your own real-time guide as you install it.

That's because the software will guide you through an installer. All you need to do is give it the proper permissions to install and run on your computer. You'll want to make sure to stay current on any updates to ensure you have the full functionality that Java offers for your Android app development.

If you already have Java or need to check in the future, there's an easy way to see what version of Java your Mac is running as well. Simply open up the OS command prompt and type in the following command code:
java - version

If you have version 1.8x or newer, you're ready to go! If it isn't, it's a good idea to update or download the latest version of Java to make sure you have the most current and compatible option available to you.

If you type this command in and get a "command not found" output error, likely, you don't have the software installed. In this case, just jump back to the beginning of this section and follow the steps to download it to your Mac.

Installing Android Studio


Android Studio is a tool that's specifically dedicated to helping users create Android apps, as the name suggests. This tool has gained popularity for its convenience, ease of use, and dedication to the development of native Android apps.

The first step to install this development tool on your Mac is to visit developer.android.com/studio to download the software. All you have to do is click on the box labeled "Download Android Studio" to start.
Download Android studio
Next, launch the file. You can do this by clicking the Android Studio DMG file and then dragging the file over to the applications folder. From here, you can launch the Android Studio.
Mac Android Studio installation
Like the previous software installations, the next steps are already laid out for you. All you have to do is follow the prompts the installation wizard gives you.

Then, the installer will ask you some basic questions such as if you would like to import previous settings. Here, click "Ok." Some versions may also ask you if you want to give permissions to access the computer's calendar, photos, or contacts. They ask this for your security and you'll want to give the software permission to access these to unlock its full functionality. However, you can also choose not to allow these permissions and still use the program just fine.

Setting Up an Android Emulator


Once you've finished building an app, the development process isn't quite over yet. Without properly testing an app, you risk sending it out to consumers full of bugs and glitches. It's important to test the app in an Android format as well to ensure there aren't any problems with the app on the device it's going to run on.

Developers don't necessarily need an Android phone handy to do this either. With the right steps, users can create an Android emulator on their desktop so that they can develop and test in a single location.

To do this, you're going to want to rely on an AVD Manager which is possible through Android Studio which we covered installing earlier. To start this process, open the "Tools" tab in the top right corner of the Android Studio window. Then click "Android" and then "AVD Manager."
Setting up Android emulator Mac
(Source: https://hdorgeval.gitbooks.io/setup-your-mac-to-develop-nativescript-apps/content/assets/Screen%20Shot%202016-12-27%20at%2016.47.56.png)
A new screen will appear prompting you to create a virtual device. Click the prompt and follow the next series of prompts, clicking "Next" as you complete each step. These steps aim to help you narrow down and create the type of Android device you want to test your app on.
Select hardware for running Android app
(Source: https://hdorgeval.gitbooks.io/setup-your-mac-to-develop-nativescript-apps/content/assets/Screen%20Shot%202016-12-27%20at%2016.52.58.png)

Once you've set this up completely, you can click "Finish" and the AVD Manager will show you your new emulation in the options menu when you follow the first few steps again.

A Guide to Setting Up Android Development Environments On Ubuntu


Now that we've covered how to set up an Android development environment on Mac, its time to move onto Ubuntu. This is a popular choice for cloud computing.

Installing the Java Development Kit


If you have version 16.04, 18.04, 18.10 or any LTS release of Ubuntu, you can use the following steps to install Java onto your computer. For these instructions, you'll also need a root user and to make sure you are SSH enabled and don't have Java installed yet.

To start, you're going to want to make sure Ubuntu is up to date. Run the following command to do so:
apt-get update && apt-get upgrade

This command is useful because it installs at least Java 11 or a newer version. After this, you have to configure Java so that it's ready for use. You need to know which version you have which you can do with another simple command:
Java-version

Once you enter this command, you'll receive an output telling you what version you're using. In the following template, <version> represents where that information would go:

Java (TM) SE Runtime Environment (build )
Java HotSpot (TM) 64-Bit Server VM (build )

So, for example, if you're running Java Version 11, your output will look like this:

Java (TM) SE Runtime Environment (build 11.0.1+13-LTS)
Java HotSpot (TM) 64- Bit Server VM (build 11.0.1+13-LTS, mixed mode)

This is important to know for two reasons. For one, many pieces of software that work with Java are only compatible with certain versions, so it's important to keep your version updated. Additionally, up-to-date software offers you the full, current capabilities that the program has to offer.

Installing Android Studio


Much like on Mac, Ubuntu users need to start getting ready to install Android Studio by making sure they have Java installed and visiting the Android Studio webpage. Once here, you can go ahead and click the link to download the Android Studio software.
Ubuntu Android Studio
Next, it's necessary to unpack the file, choose a location, and unpack the folder regarding Android studio. You can use lines of code like these to get the job done:
unzip android-studio-ide-162.4069837-linux.zip
sudo mv /home//Downloads/android-studio /usr/local/

If you're running a 64-bit version of Ubuntu, there's an extra step as you will need to install 32-bit libraries for the software to run and store properly. Once again, this can be solved with a simple command code:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386


From here, the only thing you need to do is follow the installation wizard. Just do what it says and you'll be set up in no time.

Installing the Android SDK Manager


To install Android SDK Manager, you want to start by referring back to earlier steps and making sure you have Java installed. Without Java, this program can't run, so it's essential that it's installed and up-to-date. You will need to download a set of binaries as well, though, which are available on the Android Developers website.

Skipping ahead to assume you already have Java installed and updated as needed. From here, you'll want to start to enter code much like was instructed for previous steps. Enter the following command first:
wget https://developer.android.com/studio/#downloads

Once you've accessed and installed this, you'll need to unzip the file with this line of code:
unzip SDK-tools-Linux-3859397.zip

This step creates a new directory which is named "tools" by default. To finish the installation off before running the software, you'll need to enter one more command to add a path to the PATH environment variable.
export PATH=/home/ubuntu/tools:/home/ubuntu/tools/bin:$PATH

Installing React Native


React Native is a handy tool that doesn't require a full IDE to develop an app. This is useful because, naturally, a larger piece of software can slow down your device and take up a lot of space. Of course, a bigger piece of software may have more features but React Native works well for most Android apps.

Again, you'll need to start by installing and updating Java Development Kit. Next, you'll need to install NodeJS and NPM. Both of which can also be installed via code. Start with this code to access the most up-to-date version of LST:
curl -sL https://deb.nodesource.com/setup_6.x | Sudo -E bash -

Then, you can update and install NodeJS and NPM with the two following lines:
sudo apt-get update
sudo apt-get install nodejs npm

Then, you'll want to make sure you have Android SDK installed to ensure that React Native runs properly. Since that's already been discussed, you can jump ahead to commanding the installation of React Native with the following line:
sudo npm install -g react-native-cli

Setting Up an Android Virtual Device


Android Virtual Device is another tool that will help you test your Android apps before you consider them finished by allowing you to create a virtual Android system on your computer to test the app out before moving it to a new device.

You'll need to have Java Development Kit installed already as well as Android Studio to get started. This is because you'll be setting up your virtual device through Android Studio. To use this method with Ubuntu, you'll want to start with the following code after moving to android-studio/SDK/tools.
./android avd

From this point, you only have to follow the prompts to start to set up your virtual device. This will ask you basic questions such as the type of device you want to create, memory options, and similar traits for the tool. You'll also have the chance to name your Android Virtual Device.
Edit Android virtual device
Alternatively, you can also use the "Android Virtual Device Manager" if you prefer to use Eclipse ADT. In this case, you can find the icon in the upper toolbar.
Android Virtual Device manager
(Source: https://www.codeproject.com/KB/android/802813/adt-avd-manager.png)

Conclusion


Setting up the right Android app development environment on your Mac or Ubuntu system doesn't have to equal a long or confusing struggle. These tools will help you start to create, and test your company's new app before its full release. By following these steps, you can depend on setting up your Android Development Environment in no time at all.


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: