=^.^=

Installing Cordova (formerly PhoneGap) with Android SDK on Gentoo

Apache Cordova is an open source framework for rapidly generating mobile apps from HTML5, CSS and JavaScript. At present, Cordova supports 7 mobile platforms with plans to expand. Since it uses core web design languages Cordova allows web developers to become mobile phone app developers without having to learn Java, C++ or the proprietary APIs of each platform.

This write-up covers the installation steps listed but not expanded on at the top of Apache Cordova API Documentation: Getting Started with Android.

To get started using Cordova on Gentoo we must first install Eclipse:

# emerge eclipse-sdk --ask

 * IMPORTANT: 9 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy "eclipse-sdk" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-util/eclipse-sdk-3.5.1-r1::gentoo (masked by: package.mask)
/usr/portage/profiles/package.mask:
# Ralph Sennhauser <[email protected]> (18 Jul 2012)
# Unmaintained, multiple vulnarabilities. #351626
# A more recent source build maintained by the community is available in the
# seden overlay. A more recent binary is available in the java-overlay.
Which is not going to be as easy as I had hoped. Emerge layman:
# emerge layman --ask

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] app-portage/layman-1.4.2-r3  USE="-bazaar -cvs -darcs -git -mercurial -subversion -test"

Once layman has been installed add the following to your make.conf:

source "/var/lib/layman/make.conf"

Java-overlay uses subversion and seden uses git; you may also want to enable the mercurial USE flag if you plan on using other overlays. We're going to use the java-overlay since when it comes to java binary and source-compiled doesn't really make a difference (other than a lot of time).

# layman -a java-overlay
...

You may need to add eclipse-sdk-bin to package.keywords before it can be emerged:

# echo "dev-util/eclipse-sdk-bin" >> /etc/portage/package.keywords

Now install the package:

# emerge eclipse-sdk-bin

Now we need to install the :

$ wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
$ tar xvf android-sdk_r20.0.3-linux.tgz
$ android-sdk-linux/tools/android

Running "android" from the command line in the tools directory will bring up the Android SDK Manager in X windows. Select any additional packages you would like to install and hit the Install button.

Now we'll download the latest version of the Android Development Tools plugin for eclipse at http://developer.android.com/tools/sdk/eclipse-adt.html. Start eclipse:

$ eclipse-bin-4.2

Now follow the installation guide at http://developer.android.com/sdk/installing/installing-adt.html:

  1. Start Eclipse, then select Help > Install New Software.
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:

    https://dl-ssl.google.com/android/eclipse/

  4. Click OK.

    If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).

  5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
  7. Read and accept the license agreements, then click Finish.

    If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.

  8. When the installation completes, restart Eclipse.

After restarting Eclipse you will be presented with the Welcome to Android Development dialogue, install the new SDK, and optionally 2.2. You are now ready to proceed with the rest of the Getting Started guide.

Comments

karma

@McTimon
I'm not sure what you're talking about. Cordova is a platform independent set of libraries. The software that you run to build Android applications is Eclipse, with the android SDK. These also happen to be platform independent.

• McTimon

Hey, the cordova download does not contain any linux scripts! i thought the tutorial covered that part instead... what use is the whole tutorial if no one can use the software after installing it? pls help with the "setting up a new path" and "setting up a new project" please..