[Android Builders Collective] letmedanz:
Setup Android Environment in OpenSuse

So, as some of you have seen my struggles with various Linux distros, i happened to jump into OpenSuse, thanks to the recommendation by Ezio.

Well, as with everything in Linux, it was quite an uphill task getting everything together... not

And to add, there is not a single guide that i could find that helps you be a machine & just copy paste the required commands to setup your Android Environment.

So i thought i'll put one together since i was successful in compiling my build on OpenSuse 13.1 last night.

Do note, this is a very quick guide to help anyone set things up relatively easily.

Am sure if you use any OS for a couple of days, you'll get the hang of things & any minor issues that may arise from following this guide can be squashed quite easily.

Or if you are a lazy bum like me & like to be spoon-fed, just post away your questions & you pleas will certainly be heard & responded to by the forces.. :P

Let's go

Step 1- Java Installation

a) Download Oracle JAVA JDK from the official website

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Make sure you install the right package...

x64.rpm would be for 64 bit systems & i586 would be for 32 bit

b) Install it..... Duh

c) Open Terminal & simply copy paste the following:

/usr/sbin/update-alternatives --install "/usr/bin/java" "java" "/usr/java/latest/bin/java" 20000
/usr/sbin/update-alternatives --install "/usr/lib64/browser-plugins/javaplugin.so" "javaplugin" "/usr/java/latest/jre/lib/amd64/libnpjp2.so" 20000

I love doing all this blindly too....

But if you'd like to know, the above allows Oracle Java to be used instead of openJDK

4) Goto Terminal, copy-paste again

zypper rm icedtea-web

5) If you want to check if Java is installed correctly,

java -version

You should see something like this (version numbers WILL change)

java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

That's it with Java

NOTE - "There is no need to uninstall OpenJDK as it is required by other services & apps" - Ezio

Step 2 - Installing Main Build Tools & relevant Packages

You can go about this in 2 ways, either via YaST or through Terminal.

Wouldn't make any difference as the packages would be the same, but i recommend doing this my way.. sorry YaST way ;)

To ensure that you don't miss out any required packages

a)

YaSt method

Open YaST-

ScreenShot

[IMG="YaST"]http://i.imgur.com/Omd0abs.png[/IMG]

On the top left, you see a tab called 'View', to the left of 'Search'.

Click on that & choose 'Package Groups'

Scroll down to 'Development'

ScreenShot

Then tick off all the packages you feel you'll use (in the left pane)

I've added a couple more in the hope that i may use them someday.

But all that you would need to successfully compile your builds are

- Base Development

- RPM build Environment (Not sure, check it in case)

- Perl Development

- Python Development

- Qt4 Development

Click 'Accept' & let everything install.

b)

Terminal (Konsole) Method

This is for those who dislike GUIs or just OCD'd to copy paste

sudo zypper install git gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z1-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libreadline6-dev lib32readline-gplv2-dev libncurses5-dev bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev squashfs-tools pngcrush schedtool dpkg-dev

Not sure if the above installs everything, if any packages pop up as missing, just install them in YaST or search for the package name & zypper here in Konsole.

That's about done with the Packages & stuff

Step 3

More copy-paste

ln -s /usr/sbin/schedtool /usr/bin/schedtool

Note- "This is needed because schedtool is installed in sbin, so would need root to run direct from there" - Marc

Step 4 - Setup AndroidSDK

Download Android SDK Tools from here

http://developer.android.com/sdk/index.html

Choose the right version.

If you are running Ubuntu on a Virtual Machine, you still need the package for Linux & not the host system.

Unzip the package & copy the contents of "sdk" into your 'Downloads' folder.

Rename it as AndroidSDK (or whatever.. this is just to help people understand)

Open terminal & cd to the tools folder in the SDK folder

cd ~/Downloads/AndroidSDK/tools

Then do this to open the SDK

./android sdk

Install latest versions of Tools & Platform Tools for Android (4.4 or L or M as relevant)

Step 5

(Optional)

In case you are doing some twisted builds (no pun intended), you may have some errors relating to 'piggy.lz4'

You'll need to install them via Konsole,

or YaST from here - https://build.opensuse.org/package/show/Archiving/lz4

That should be just about everything you need to get started with building Slim or any other ROM on OpenSuse.

[ Credits - [MENTION=2095315]ezio84[/MENTION] & [MENTION=842211]Grondinm[/MENTION] ]