Maintenance

  • Home
  • Log in
  • « Restarted tomcatdevel
  • ArcGIS server »

Setting up Ubuntu Trusty for Apache Cordova Android development

Posted by mholmes on 17 Jun 2014 in R & D, Activity log

Assuming you're on 64-bit Ubuntu, this may be necessary:

sudo apt-get install libgl1-mesa-dev:i386 libgl1-mesa-dev

The nodejs and node-js legacy in the Ubuntu repos are flaky and not recommended, so remove them if they're installed; then

  • sudo apt-get install ant ant-contrib ant-optional ant-gcj
  • sudo apt-get install npm
  • sudo apt-add-repository ppa:chris-lea/node.js
  • sudo apt-get update && sudo apt-get install nodejs
  • Download the Android ADT Bundle and put it in a likely location such as $HOME/adt-bundle-linux-x86_64.
  • Edit ~/.bashrc and add:
    export PATH=$PATH:/usr/share/npm/bin
    
    export ANDROID_HOME="/home/mholmes/adt-bundle-linux-x86_64/sdk/tools"
    export ANDROID_PLATFORM_TOOLS="/home/mholmes/adt-bundle-linux-x86_64/sdk/platform-tools"
    export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
    
    export ANT_HOME="/usr/share/ant"
    export PATH="$PATH:$ANT_HOME/bin"
    

Run "android" at the command line to start the Android SDK manager, and install any updates. Also install the latest Android version (the highest API number), all components.

Next, start the Eclipse IDE that comes with the Android developer tools and create an AVD emulator (Windows/Android Virtual Device Manager). Use the default settings for a Nexus 4; Nexus 5 emulators fail to start, for some reason. This emulator will be available in Cordova to run your app. Set up the emulation based on the Android version you installed in the step above. Starting it the first time can take several minutes.

Now create a new project in Cordova at the command line:

cordova create test com.mholmes.test TestApp

Add the Android platform to the project:

cd test
cordova platform add android

and finally try building and running the project in the emulator:

cordova emulate android
This entry was posted by Martin and filed under R & D, Activity log.

Maintenance

This blog is the location for all work involving software and hardware maintenance, updates, installs, etc., both routine and urgent.
  • Home
  • Recently
  • Archives
  • Categories

Search

Categories

  • All
  • Announcements
  • Hit by a bus
  • Labs
    • Activity log
    • Documentation
  • Notes
  • R & D
    • Activity log
    • Documentation
  • Servers
    • Activity log
    • Documentation
  • Tasks

All blogs

  • Academic
  • AdaptiveDB
  • Admin
  • Announcements
  • CanMys
  • Cascade
  • CGWP
  • ColDesp
  • Depts
  • DVPP
  • Endings
  • HCMC Blogs
  • Landscapes
  • LEMDO
  • Linguistics
  • Maint
  • LondonMap
  • Mariage
  • MoM
  • Moses
  • Pro-D
  • Projects
  • ScanCan
  • HumsSites
  • Wendat

This collection ©2022 by admin • Help • Open Source CMS