Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

jon brookes
jon brookes
3,341 Points

Ubuntu 14.04.1 LTS (Trusty Tahr) Android Development

A few people have asked about a 'treehouse linux bundle' for the above, which is not apparently available

I thought I'd share how I got mine working as it took a few hours to figure out, having reverted to eclipse from android-studio and then going back to android studio to finally get it working.

The main issue for me was getting the emulator to work. Setup of this was not obvious to me at all.

Ubuntu does not come with any of the pre-requisites to run any of the above so first thing was to download a JDK from Oracle. You can use the openjdk one but I opted for the Oracle SDK as the IDE warned about not using the Oracle version of Java. I may have to revert but so far, so good.

All there is to installing Java from Oracle is to download it from the Oracle Java JDK download site, uncompress the tar.gz file to your home directory and then to include it in your 'PATH' and in 'JAVA_HOME' variables so I have the following in .bashrc to achieve this:

export PATH=~/jdk1.8.0_20/bin:$PATH
export JAVA_HOME=~/jdk1.8.0_20

Having also downloaded android studio to your home directory, the following is also needed in .bashrc to locate the 'lib' path of the android studio modules :

export LD_LIBRARY_PATH=~/android-studio/sdk/tools/lib

to apply these changes, either log out and in again or run :

source ~/.bashrc

There were further operating system packages that needed to be installed :

sudo apt-get install libgles1-mesa-dev libgles2-mesa-dev libgles1-mesa libgles2-mesa libqt4-opengl glmark2 glmark2-es2 libgles1-mesa-dbg libgles2-mesa-dbg freeglut3  libhugs-opengl-bundled

the following I added also but am not entirely certain if this is necessary but include it anyway :

into a new file called :

  • /etc/apt/sources.list.d/ia32-libs-raring.list

text for a repo is added :

deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse

then

run apt-get update 

followed by

apt-get install ia32-libs

( this was because I read that the emulator relies on 32bit binaries and my system is 64bit )

I followed the instructions in the latest teamtreehouse course material to set up a hello world project and to create an emulator but this did not at all fire up in my Linux environment, even with the above configuration

Finally the emulator started to work when clicking the 'download' link for the 'SDK manager' and downloading some 'system images' :

Under 'Android 4.4.2 (API 19 ) :

'system images' for:

  • ARM
  • ARM EABI
  • SDK Platform & x86

I also configured the AVD under tools / android / AVD manager to :

  • Use Host GPU

I hope this is of use / interest to someone trying to set up Android development under ( 64 Bit ) Linux

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Thanks so much for posting. I am going to add a video showing the installation on Ubuntu within a week or two. In the mean time I have added some notes in the Teacher's Notes below each installation video that should help. I found a convenient way to install Java that makes this significantly easier: http://teamtreehouse.com/library/build-an-android-app/getting-started-with-android/setting-up-an-android-development-environment-for-mac

jon brookes
jon brookes
3,341 Points

Ben, thanks for that. I am following along on the course quite easily now being over the first hurdle.

Setting up the emulator was the challenge for me here, Ubuntu just isn't ready out of the box and requires extra libraries to be added.

I look forward to the video for Linux installation - top stuff !