Quantcast
Channel: xda-developers - Android Themes
Viewing all articles
Browse latest Browse all 4090

Dev Your first CM Theme:From environment (linux, win) setup(eclipse) to final product

$
0
0
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/ja...s-1880260.html



- Navigate to

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

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




2) Set up Eclipse

- Download Eclipse ADT and Extract to C:\

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


LINUX INSTRUCTIONS

1) Set up the Java JDK

- Open the terminal

- Install the OpenJDK

Code:

sudo apt-get install openjdk-7-jre
Let's make sure the correct version of Java is activated. Run the terminal command:

Code:

java -version


2) Set up the SDK

- Download the Standalone SDK Package

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

- Install the SDK Package

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

Code:

mkdir ~/development
Navigate to (your) downloads folder (cd Scaricati for example if You're Italian like Me xD or a custom one)

Code:

cd ~/Downloads
Extract the SDK package

Code:

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:

Code:

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]

Open up the Android SDK by running this command:

Code:

cd ~/development/android-sdk-linux/tools
Run the SDK Manager:

Code:

./android
- Windows

Open Eclipse ADT and Navigate to/Open

Window --> Android SDK Manager

At this point the SDK should come up



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 :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:

Code:

cd
so let's edit the .bashrc!:

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

Code:

sudo nano .bashrc
and add your SDK paths at the end of it:

Code:

#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:

Code:

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

Code:

fastboot
The output will look like this:

Quote:

fastboot
usage: fastboot [ <option> ] <command>

commands:
update <filename> reflash device from update.zip
flashall
...
Fixing ???????? No permissions errors (click to show)

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

Code:

cd /tmp/
and create android.rules by running:

Code:

sudo touch android.rules
Edit the file

Code:

sudo nano android.rules
and copy&paste the following lines:

Code:

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:

Code:

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:

Code:

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

sudo chown root. /etc/udev/rules.d/51-android.rules
and we restart udev and kill adb:

Code:

sudo service udev restart
Code:

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/?os...ease=undefined

- Install Eclipse

cd to downloads folder

Code:

cd ~/Downloads
Extract Eclipse folder by running:

Code:

tar -zxvf eclipse-standard-luna-R-linux-gtk.tar.gz
Move this folder inside /opt folder

Code:

sudo mv eclipse /opt
Run the following command to make eclipse available for all users:

Code:

sudo ln -s /opt/eclipse/eclipse /usr/bin/eclipse
Now, we are going to add a Menu's shortcut, just type this in order to download the .desktop file:

Code:

wget https://www.dropbox.com/s/0quwnjekpz3bxh3/eclipse.desktop
Move this file inside /usr/share/applications

Code:

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

- Now You can run Eclipse and choose the location of our workspace (we can leave the default 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) Set up ADT Plugin

FOLLOW THIS:

http://developer.android.com/sdk/ins...lling-adt.html


6) Android Studio

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

- Linux

Code:

cd ~/Downloads
Code:

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

Code:

./studio.sh
also, check @blinqipa 's thread because I don't use Android Studio xd

http://forum.xda-developers.com/show....php?t=2780923


7) APKTOOL (in case You need it)

WINDOWS INSTRUCTIONS

- Download Apktool from here and extract where You want:

http://forum.xda-developers.com/show...9&postcount=90

LINUX INSTRUCTIONS

- Download it running this in a terminal:

Code:

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

Code:

tar -zxvf apktool.tar.gz
- cd to apktool folder

Code:

cd apktool
- Root permissions

Code:

sudo chown -R yourusername aapt apktool apktool.jar
enricod@enricod-Aspire-5920G:~/Scrivania/apktool$

- Make them exec

Code:

sudo chmod +x aapt apktool apktool.jar
- Move to usr/local/bin

Code:

sudo cp aapt apktool apktool.jar /usr/local/bin
To see if it works just run

Code:

apktool
in a terminal. The output will look like this:

Quote:

enricod@enricod-Aspire-5920G:~/Scrivania/apktool$ apktool
Apktool v1.5.2 - a tool for reengineering Android apk files
Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>
with smali v1.4.1, and baksmali v1.4.1
Updated by @iBotPeaches <connor.tumbleson@gmail.com>
Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)


- You can now delete the package and the extracted folder


- Little guide on how to use apktool

http://forum.xda-developers.com/show...7&postcount=57

Viewing all articles
Browse latest Browse all 4090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>