Set up Android development environment under Ubuntu

  • 2020-06-03 08:20:33
  • OfStack

1. Install JDK

Actually this step 1 I compare lazy, on the Internet under 1 Ubuntu system install JDK method, seems a little trouble, so I try to search in the own software center 1, then found in the software center has a OpenJDK Java 7, try after installation, found that this is a good thing, what environment variables are automatically after 1 key installation with good, eclipse what can automatically identify, very convenient. The difference between Open JDK and sun JDK is roughly that sun's JDK is developed on the basis of Open JDK, which extends 1 thing. After this period of use, there is no difference in the development of Android, it is very easy to use ~ so it is recommended that you install OpenJDK directly in the software center.

2. Download ADTBundle

Now no matter what the system is installed on Android development tools are a very simple thing, because the Android's official website can find three operating system (Windows Mac Linux) development tools, whether it is integrated with Eclipse, Android SDK and ADT ADTBundle, or Google company launched special Android Studio, download can find suitable for their own operating system, is very convenient. The only inconvenient thing is that now Google is separated by the great GFW, so the official website of Android cannot be accessed normally, so... Over the wall. If over the wall is not convenient on Ubuntu, you can download it now on Windows and copy it. As for Android Studio or ADTBundle, I suggest the latter. Try to install Android Studio, but can not open, and then give up, and indeed now in many aspects are not perfect, or use Eclipse honestly.

Go to Android website, find Developer below, then download ADTBundle from Tools to any folder. Unzip the downloaded zip file, and there will be two folders, eclipse and sdk, which are used to hold what I don't need to say more.

3. Update SDK

Although the newly downloaded ADTBundle is integrated with SDK, it is often incomplete. For example, the latest version only contains Android 4.4w (a development kit specially prepared for Android Wear). If you need Android L or the development kit of previous versions, you still need to pass SDK manager.

Open eclipse and open SDK manager from the shortcut bar above eclipse. You will find that it is impossible to get all versions of SDK package. If you have purchased VPN, click ES83en-ES84en in the task bar of SDK manager window, then fill in the IP and port of VPN, and restart SDK manager. All the SDK packages have been loaded. Select the package you want to download.

Of course, if you are as poor as I am and cannot afford hosts, there is another easiest way.

Open the terminal and enter:


sudo gedit /etc/hosts

Then add the following two lines to the end


203.208.46.146 dl-ssl.google.com

203.208.46.146 dl.google.com

This is the latest ip address. It loads very fast, and when downloading SDK, you can almost reach your own bandwidth speed. After adding, save and exit. Restart SDK manager and you will find that SDK is ready to load and download. Select the package you want to download.

4. Install Genymotion emulator

Although AVD, which comes with ADT, can simulate Android devices to debug and test android applications, anyone who has used ADT knows that it is too much for a person with OCD to bear. Although the Android emulator can be accelerated using Intel x86 mirroring under Windows, the Linux system is not currently supported and the acceleration is not as good as expected. The Genymotion emulator I recommend today, however, is fairly smooth, almost as fast as the real thing, and quite smooth to boot and load.

Enter Genymotion's official website, click download, enter your email address, and enter the download page after passing the verification in the email address. Before downloading Oracle VirtualBox, you need to install Oracle VirtualBox. The package you downloaded is deb. Just double-click to install it. After installation, download Genymotion, download the.bin file, need to install through the command line:

Open the terminal, use the cd command to enter the directory where the bin file was stored, and type the following command:

chmod a+x filename

sudo./ File name

Notice the dot before the second command is executed.

Then enter the installation program, installation can be.

Found in the installation directory genymotion after installed, open, and will automatically prompt you to add equipment, after yes, click the connect button below, enter the user name and password (user name is in the mail before that), then you can add android virtual devices, add good point play operation simulator, to feel the fluency of the simulator under 1! ios developers will no longer have to envy ios developers for a great emulator

Now that your Android development environment is set up, create a new Android and start Hello


Related articles: