[Android Themes] upndwn4par:
This thread was created by [MENTION=5266287]EnricoD[/MENTION], and everything except post #6 is his work. I took over this thread when he decided to discontinue support. All credit goes to him. :)

View attachment 2985652

*****************************************

*****************************************

Build Your First CM11 Theme (or APP!!!)

- SETTING UP THE BUILD ENVIRONMENT -

WINDOWS INSTRUCTIONS

​

1) Download, Install and set up the Java JDK

- Download and install the JDK (32 or 64bit)

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

- Navigate to

System Properties --> Advanced system settings --> Evironmental variables

and create a new variable called "JAVA_HOME" where we'll add the JDK path:

2) Eclipse Setup

- Download Eclipse ADT and Extract to C:\

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

LINUX INSTRUCTIONS

​

1) We need the JDK!

- Open the terminal! roftl

- Install the OpenJDK running:

sudo apt-get install openjdk-7-jre

Let's make sure the correct version of Java is running on our PC. To do this just run

java -version

2) SDK setup

- Download the Standalone SDK Package from here:

DOWNLOAD: http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz

- Install the SDK Package

Let's create a folder in your Home called "development" (You can also call it pincopallino, gino, pippo, Giovanni, Lemonpie, Material, Mathias Duarte... if You want lol)

mkdir ~/development

Navigate to (your) downloads folder (cd Scaricati for example if You're Italian like Me xD or a custom one... you know!)

cd ~/Downloads

Extract the SDK package

tar -zxvf android-sdk_r23.0.2-linux.tgz

move the folder inside development's one. We are already inside the downloads folder! so just run:

mv android-sdk-linux ~/development/

LINUX & WINDOWS INSTRUCTIONS

​

3) Setup ADB/FASTBOOT in Linux and Update Developers Tools in Linux&Windows

- Linux [You can do this step after Eclipse installation also (like in Windows), it's the same]

cd to the Android SDK tools folder by running this command:

cd ~/development/android-sdk-linux/tools

Run the SDK Manager:

./android

- Windows

Open Eclipse ADT and Navigate to/Open

Window --> Android SDK Manager

At this point the SDK should come up

and .. and... you will need to download all the tools and all the extras files already selected by default.

1. Be sure to select at least Android 4.4.2 (API 19)!!!!!!!, so select them and install'em all \m/ \m/.

2. !!!! Avoid Android L (API 20, L preview) & Android 4.4W (API 20) installation. You don't need it for now! (but, if You want to start developing apps for Android L then install them .. your choice! :P)

Accept all licenses and click OK to all the prompts during installation ;)

- Setting up ADB&FASTBOOT in Linux

When it finishes downloading everything you have to run this commands in terminal to return to Your Home folder:

cd

so let's edit the .bashrc!:

(You can also use gedit if in Ubuntu, leafpad for Lubuntu, etc etc)

nano .bashrc

and add your SDK paths at the end of it:

#Android PATHS
export PATH=$PATH:~/development/android-sdk-linux/tools
export PATH=$PATH:~/development/android-sdk-linux/platform-tools

Once done Save or press ctrl+x to exit, S and enter if You're using nano

Then Run:

source ./.bashrc

If you followed everything carefully adb and fastboot should work! To check this reopen a terminal and simply type:

fastboot

The output will look like this:

if this method is not working, then install android-tools from ppa:

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo apt-get update

sudo apt-get install android-tools-adb android-tools-fastboot

Fixing ???????? No permissions errors (click to show)

To fix this error we need to create a file called android.rules:

cd /tmp/

and create android.rules by running:

sudo touch android.rules

Edit the file

sudo nano android.rules

and copy&paste the following lines:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"

Save when finished.

Now we have to copy that file inside /etc/udev/rules.d/ and rename it to 51-android.rules. To do this just run:

sudo cp /tmp/android.rules /etc/udev/rules.d/51-android.rules

Now you have to set the right permissions to this file, just type:

sudo chmod 644 /etc/udev/rules.d/51-android.rules

sudo chown root. /etc/udev/rules.d/51-android.rules

and we restart udev and kill adb:

sudo service udev restart

sudo killall adb

4) Set up Eclipse IDE in Linux

- Dowload latest Eclipse IDE (I prefer the classical one instead of Google's one)

http://www.eclipse.org/downloads/?osType=linux&release=undefined

- Install Eclipse

cd to downloads folder

cd ~/Downloads

Extract Eclipse folder by running:

tar -zxvf eclipse-standard-luna-R-linux-gtk.tar.gz

Move this folder inside /opt folder

sudo mv eclipse /opt

Run the following command to make eclipse available for all users:

sudo ln -s /opt/eclipse/eclipse /usr/bin/eclipse

Now, we are going to add a Menu's shortcut, just create this file:

sudo nano /usr/share/applications/eclipse.desktop

and add the following content:

ctrl+x then Y to save.

- Now We can run Eclipse and choose the location of our workspace (we can leave the default one and tickmark «use this as the default and do not ask again»)

NOTE: You can also use directly Eclipse ADT + sdk instead of classical Eclipse IDE.

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

5) ADT Plugin setup

FOLLOW THIS:

http://developer.android.com/sdk/installing/installing-adt.html

6) Android Studio

http://developer.android.com/sdk/installing/studio.html

- Linux

cd ~/Downloads

tar -zxvf android-studio-bundle-135.1245622-linux.tgz
mv android-studio ~/development/

To run it you just need to navigate to its bin folder and type

./studio.sh

also, check [MENTION=4790327]blinqipa[/MENTION] 's thread because I don't use Android Studio xd

http://xdaforums.com/showthread.php?t=2780923

7) APKTOOL (in case You need it)

WINDOWS INSTRUCTIONS

- Download Apktool from here and extract where You want:

http://xdaforums.com/showpost.php?p=50205159&postcount=90

LINUX INSTRUCTIONS

- Download it running this in a terminal:

wget https://www.dropbox.com/s/6s9bxszxjl7wclz/apktool.tar.gz

- Extract

tar -zxvf apktool.tar.gz

- cd to apktool folder

cd apktool

- Root permissions

sudo chown -R [COLOR="red"][B]yourusername[/B][/COLOR] aapt apktool apktool.jar

enricod[/COLOR [MENTION=5266287]EnricoD[/MENTION]-Aspire-5920G:~/Scrivania/apktool$

- Make them exec

sudo chmod +x aapt apktool apktool.jar

- Move to usr/local/bin

sudo cp aapt apktool apktool.jar /usr/local/bin

To see if it works just run

apktool

in a terminal. The output will look like this:

- You can now delete the package and the extracted folder

- Little guide on how to use apktool

http://xdaforums.com/showpost.php?p=50181967&postcount=57