JDK and Android SDK Installation on Ubuntu


I’ve been developing Android application on Windows. But recently, I tried to create an environment in Linux (Ubuntu/Xubuntu). In this article, I will describe the installation of JDK and Android SDK that is required before installing IDE. (It is assumed that without the use of ADT Bundle, we install separately JDK/SDK and IDE.)

Installation of JDK

JDK is updated frequently. So I looked for package management. Then I found that Oracle Java (JDK) 6 / 7 / 8 Installer PPA : “WebUpd8” team provides PPA. This PPA downloads and run the Oracle installer.

Install as follows. Along the way, you are prompted to agree to Oracle license. Then agree.

In the last line, you are sure the installation was successful.
At the result, in my environment, the JDK is installed in /usr/lib/jvm/java-7-oracle.

Installation of Android SDK

Following Android SDK | Android Developers, I have installed the Android SDK.

  1. First, there is the following entry in SYSTEM REQUIREMENTS – Linux.

    64-bit distributions must be capable of running 32-bit applications.

    My Environment is 64bit-Xubuntu. So I installed ia32-libs. (It is not necessary for 32bit OS.)

  2. Next, from DOWNLOAD FOR OTHER PLATFORMS, download Linux 32 & 64-bit package. (Suppose /home/hoge/Downloads/android-sdk_r21.1-linux.tgz)
    * Currently, there is a package called ADT Bundle environment, including Eclipse. However, in this article, it is assumed that you install IDE separately.
  3. In the home directory, make appropriate directory (here, suppose “Development”), and extract files there.

  4. It is useful to make a path to “tools” directory. So add the following line in ~/.bashrc.

    In order to apply the path, do the following.

  5. Update the SDK. (Because SDK for all platform will be downloaded, it will take a lot of time.)

  6. Start the SDK Manager to check the results. (In my environment, the sources has not been downloaded. So I downloaded them.)

  7. For other commands for android, check with –help option.

After this, you can set up favorite IDE, such as IntelliJ or Eclipse, and start development.

[Reference Sites]

[Relative articles]


Large number of warning in SDK Tools r21


In the display screen of the LogCat, I’m getting a lot of warning such as following.

Unexpected value from nativeGetEnabledTags: 0

At first, I thought if there is a problem in my code. However, the same message has been output from other processes. I do not know well nativeGetEnabledTags, too.

According to this site, this behavior has been found to be a bug in the previous update of SDK (SDK Tools, Revision 21). A solution for now is to cut the log by setting the filter. So there seems to be good.

  1. From the list of Saved Fileters, double-click the Session Filter or the filter that you have defined. (otherwize, you may define a new filter by clicking on the “+”)
  2. Input the string “^(?!.*(nativeGetEnabledTags)).*$” in “by Log Message”

In above work, we will be easy to see the log by being cut unnecessary logs.

[Reference Site]
Stackoverlow:Unexpected value from nativeGetEnabledTags: 0

 


When the Android SDK / AVD Manager does not appear in the “Window” Menu of Eclipse


The other day, I set up to re-install the Eclipse. Then, I noticed that there is no “Android SDK Manager” or “Android Virtual Device Manager” menu in the “Window” menu.

It is usually displayed at the next of the “Navigation” menu as shown below.

Eclipse Window Menu1

However, below is my “Window” menu at this time. Of course, ADT had been installed.

Eclipse Window Menu2

SDK/AVD Manager itself can be launched directly from the folder where you installed the SDK. Therefore, it is not a fatal problem. But It is inconvenient. (By default, Android SDK is located in the %USERPROFILE%android-sdks.)

Though there is no problem in the PC which I have been using, the above problem occurs in the newly installed PC.

I’ve just updated Android SDK to 4.2 and ADT to 21.0.0. So I’m guessing the default setting of ADT is changed.

If you update the existing ADT, there is no problem because of inheriting the settings. However, I think, if you clean install, settings become new and the problem occurs. (I don’t know why google changed the default setting.)

This problem can be overcome by modifying the settings as below.

  1. Open “Window” > “Customize Perspective”
    Eclipse Window Menu3
  2. Open “Command Groups Availavility” tab, then check “Android SDK and AVD Manager”
    Eclipse Command Groups Availavility

At least, SDK / AVD Manager will appear in the Windows menu.