You are on page 1of 9

8/2/13

[TUTORIAL ] Beginning development-the easy way - xda-developers

User Name

Remember Me?

Forgot your password?


Search All Forums

PORTAL

FORUM

WIKI

XDA TV

QUICK LINKS

Type To Find Your Device...

> Android Development and Hacking > Android Software Development > [TUTORIAL ] Beginning development-the easy way
Print Email

POST REPLY

Page 1 of 4

>

>>

[TUTORIAL ] Beginning development-the easy way


nerotNS

Like

Tw eet

+1

Tip us?

22nd May 2012, 05:18 PM (Last edited by nerotNS; 22nd May 2013 at 02:36 PM.) Reason: Partial rewrite and added files for Ubuntu 12.04

Search this thread

#1

[TUTORIAL ] Beginning development-the easy way

Most Thanked In This Th


ALL-TIMEAll-time Top thanked Posts

Recognized Contributor OP Thanks Meter 315

Ok so this is a guide that me and my friend made for compiling ROMs for our LG-P350 Now, this is pretty much universal and can be used for general development This is the stuff you will need :

Posts: 874 Join Date: Nov 2011 Location: Novi Sad MORE INFO

>

Ubuntu-can be found on the Ubuntu website http://www.ubuntu.com/start-download...64&release=lts (this is a direct link to the Ubuntu 12.04 64-bit version) Python (included) GNU Make Java Development Kit (JDK) 6 Git Before you can do anything you need to install Ubuntu. You can go with newer versions but i still think that 10.10 is best and this guide is adapted to it. You can install it like dual boot or use Wubi (Windows Ubuntu Installer). However if you choose Wubi there is a good chance that you won't have enough storage, so that's not recommended.Those who want to dual-boot check out this post http://forum.xdadevelopers.com/show...8&postcount=26 NOTE: You can do this in a virtual machine (for example VM Ware and Virtual box) but it will be a lot slower unless you have a VERY strong CPU and a LOT of RAM. Generally Python is not needed since it's already in Ubuntu. However if you want to install it separately here's how: First of all open the terminal. Now copy/paste these codes (one by one) and execute them:

3Dual-Boot Ubuntu Ok I will als nerotNS OP2012-Nov-26 15:16 Ok I will also add this here. Fo want to dual boot Ubuntu with want to keep all their 2 (quote) Thanks we tried our b nerotNS OP2012-May-22 11:5 (quote) Thanks we tried our be supposed to boost our dev bas 1 UPDATE: Rewritten parts of nerotNS OP2012-Nov-26 10:38 UPDATE: Rewritten parts of th files for Ubuntu 12.04 and also tutorial on how to dual boot 1 (quote) You can get them sin nerotNS OP2012-Jun-15 12:26 (quote) You can get them sinc change.My phone also suppor now have fully functional 2.3.7 1 Good Beginners Guide. Than TheBadFish2012-Jun-01 11:13 Good Beginners Guide. Thank can also be found here: build android for

Code:

s u d oa p t g e ti n s t a l lb u i l d e s s e n t i a lg c c c dD o w n l o a d s w g e th t t p : / / w w w . p y t h o n . o r g / f t p / p y t h o n / 2 . 5 . 6 / P y t h o n 2 . 5 . 6 . t g z t a rx v z fP y t h o n 2 . 5 . 6 . t g z c dP y t h o n 2 . 5 . 6 . / c o n f i g u r ep r e f i x = / u s r / l o c a l / p y t h o n 2 . 5 m a k e m a k et e s t s u d om a k ei n s t a l l( N O T E :Y o uw i l lb ea s k e df o ry o u rp a s s w o r d ,e n t e ri ta n dp r e s se n t e r ) s u d ol ns/ u s r / l o c a l / p y t h o n 2 . 5 / b i n / p y t h o n/ u s r / b i n / p y t h o n 2 . 5

Now you need Sun JDK 6. Same procedure as with Python:


Code:

s u d oa d d a p t r e p o s i t o r y" d e bh t t p : / / a r c h i v e . c a n o n i c a l . c o m /l u c i dp a r t n e r " s u d oa p t g e tu p d a t e s u d oa p t g e ti n s t a l ls u n j a v a 6 j d k

forum.xda-developers.com/showthread.php?t=1667551

For those who get package error try these:

1/9

8/2/13

[TUTORIAL ] Beginning development-the easy way - xda-developers


For those who get package error try these:
Code:

s u d oa d d a p t r e p o s i t o r yp p a : s u n j a v a c o m m u n i t y t e a m / s u n j a v a 6 s u d oa p t g e tu p d a t e s u d oa p t g e ti n s t a l ls u n j a v a 6 j d k s u d ou p d a t e j a v a a l t e r n a t i v e ssj a v a 6 j d k

Now that JDK is installed it's time for GNU Make: First of all download GNU Make from link given. Download version 3.82 Now extract the downloaded file to your Home directory. Go to Home directory and change the name of GNU Make To make Now open the Terminal and type the following codes Link: http://ftp.gnu.org/gnu/make/
Code:

c dm a k e . / c o n f i g u r e s u d om a k ei n s t a l l

Now make is installed. Next, we are going to install the dependencies: FOR UBUNTU 10.10 Codes to type in terminal :
Code:

s u d oa p t g e ti n s t a l lg i t c o r eg n u p gf l e xb i s o ng p e r fb u i l d e s s e n t i a l\z i pc u r lz l i b 1 g d e vl i b c 6 d e vl i b 3 2 n c u r s e s 5 e x p o r tU S E _ C C A C H E = 1

If that method didn't work then try this: You use the same commands BUT the first one is: sudo apt-get install git-core gnupg flex bison gperf build-essential Now it should download some stuff. When its done you need to do the same for the rest in the right order. NOTE: Since I don't remember the right order i will just put the commands how they should be written if you get error read what's missing and put that in first. Here are the rest of the lines:
Code:

s u d oa p t g e ti n s t a l lz i pc u r l s u d oa p t g e ti n s t a l lz l i b 1 g d e v s u d oa p t g e ti n s t a l ll i b c 6 d e v s u d oa p t g e ti n s t a l ll i b 3 2 n c u r s e s 5 d e v s u d oa p t g e ti n s t a l li a 3 2 l i b s s u d oa p t g e ti n s t a l lx 1 1 p r o t o c o r e d e v s u d oa p t g e ti n s t a l ll i b x 1 1 d e v s u d oa p t g e ti n s t a l ll i b 3 2 r e a d l i n e 5 d e v s u d oa p t g e ti n s t a l ll i b 3 2 z d e v s u d oa p t g e ti n s t a l ll i b g l 1 m e s a d e vg + + m u l t i l i b s u d oa p t g e ti n s t a l lm i n g w 3 2 s u d oa p t g e ti n s t a l lt o f r o d o sp y t h o n m a r k d o w n s u d oa p t g e ti n s t a l ll i b x m l 2 u t i l s s u d oa p t g e ti n s t a l lx s l t p r o c

FOR UBUNTU 12.04


Code:

s u d oa p t g e ti n s t a l lg i t c o r eg n u p gf l e xb i s o ng p e r fb u i l d e s s e n t i a l\ z i pc u r ll i b c 6 d e vl i b n c u r s e s 5 d e v : i 3 8 6x 1 1 p r o t o c o r e d e v\ l i b x 1 1 d e v : i 3 8 6l i b r e a d l i n e 6 d e v : i 3 8 6l i b g l 1 m e s a g l x : i 3 8 6\ l i b g l 1 m e s a d e vg + + m u l t i l i bm i n g w 3 2o p e n j d k 6 j d kt o f r o d o s\ p y t h o n m a r k d o w nl i b x m l 2 u t i l sx s l t p r o cz l i b 1 g d e v : i 3 8 6 s u d ol ns/ u s r / l i b / i 3 8 6 l i n u x g n u / m e s a / l i b G L . s o . 1/ u s r / l i b / i 3 8 6 l i n u x g n u / l i b G L . s o

Now for the Android SDK, ADB and ADB path:

forum.xda-developers.com/showthread.php?t=1667551

2/9

8/2/13

Now for the Android SDK, ADB and ADB path: 1. SDK (Software-Development-Kit) :

[TUTORIAL ] Beginning development-the easy way - xda-developers

Go to this link and download the Android SDK for Linux: http://developer.android.com/sdk/index.html

After downloading it, extract it to the Home folder. You can probably extract where you want and change all the steps below to to fit your set up, but I like putting it in Home folder. When you have extracted it in the Home folder change the name of the folder of android-sdk-linux to sdk. Then open the Terminal and run these codes:
Code:

c d~ / s d k / t o o l s / . / a n d r o i ds d k

When you run this, a window will pop up. For this you only need "Android SDK Tools" and "Android SDK Platform-tools". Just check these two and install them. 2. ADB (Android-Debug-Bridge): Run this command to see if your ADB works. You have to have your android device connected in debugging mode. Run these codes in the Terminal :
Code:

c d~ / s d k / p l a t f o r m t o o l s. / a d bd e v i c e s

When you entered the codes above, you should see something similar to this: List of devices attached 0123456789ABCDEF device

NOTE: If you see output like given bellow we need to give the device permissions. Don't worry I had this too when I set my computer up for the first time. List of devices attached ???????????? no permissions Here is how we fix it:

Open the Terminal and type this:


Code:

g k s u d og e d i t/ e t c / u d e v / r u l e s . d / 5 1 a n d r o i d . r u l e s

After you've entered it, a window will pop up that will be blank. Now add the following commands and save it.
Code:

S U B S Y S T E M = = " u s b " ,A T T R S { i d V e n d o r } = = " 1 0 0 4 " ,M O D E = " 0 6 6 6 "

Now save this File And follow the given codes After you've entered those codes type these codes in too.
Code:

s u d os e r v i c eu d e vr e s t a r t s u d oa d bk i l l s e r v e r s u d oa d bs t a r t s e r v e r

After you've entered those codes, restart Ubuntu. Now to see if the problem is solved type these codes in:
Code:

c d~ / s d k / p l a t f o r m t o o l s. / a d bd e v i c e s

If everything is ok a output similar to this will be shown: List of devices attached 0123456789ABCDEF device Now to add the ADB path to system, so you don't have to cd to the SDK folder every time you want to use ADB: So, first open up .bashrc with these codes:
Code:

forum.xda-developers.com/showthread.php?t=1667551

3/9

8/2/13

[TUTORIAL ] Beginning development-the easy way - xda-developers


s u d og e d i t~ / . b a s h r c

A window will pop up and there will be some text there. Scroll down to the bottom and add these lines:
Code:

e x p o r tP A T H = $ { P A T H } : ~ / s d k / t o o l s e x p o r tP A T H = $ { P A T H } : ~ / s d k / p l a t f o r m t o o l s

After you've done that, save it and reboot Ubuntu. If everything is ok, you will get some output when you type the following codes in the terminal.
Code:

. / a d bd e v i c e s

OR
Code:

a d bs h e l l

If you see: [CODE]adb not found[CODE] Then it means you've done something wrong and ADB is not configured. Next is GIT: Open the browser and download git from given link http://git-core.googlecode.com/files/git-1.7.9.6.tar.gz

Extract GIT-1.7.9.6.tar.gz to your home directory Rename the folder you extracted to from GIT-1.7.9.6.tar.gz to git After you've done that, enter the following codes in the Terminal
Code:

s u d oa p t i t u d eb u i l d d e pg i t c o r e s u d oa p t g e ti n s t a l lz l i b 1 g d e v c dg i t . / c o n f i g u r e m a k e s u d om a k ei n s t a l l

NOTE: If it doesn't work then install from this link : http://kibyegon.wordpress.com/2010/0...u-lucid-10-04/ If the commands from above are not working then try this:
Code:

s u d oa p t g e ti n s t a l lg i t c o r e s u d oa p t g e ti n s t a l lg i t g i t

If it worked it should show this:


Code:

u s a g e :g i t[ v e r s i o n ][ e x e c p a t h [ = G I T _ E X E C _ P A T H ] ][ h t m l p a t h ] [ p | p a g i n a t e | n o p a g e r ][ n o r e p l a c e o b j e c t s ] [ b a r e ][ g i t d i r = G I T _ D I R ][ w o r k t r e e = G I T _ W O R K _ T R E E ] [ h e l p ]C O M M A N D[ A R G S ]

The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bug branch List, create, or delete branches check out Check out a branch or paths to the work ing tree clone Clone a repository into a new directory commit Record changes to the repository diff Show changes between commits, commit and work ing tree, etc fetch Download objects and refs from another repository grep Print lines matching a pattern init Create an empty git repository or reinitialize an existing one log Show commit logs merge Join two or more development histories together

forum.xda-developers.com/showthread.php?t=1667551

4/9

8/2/13

merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink pull Fetch from and merge with another repository or a local branch push Update remote refs along with associated objects rebase Forward-port local commits to the updated upstream head reset Reset current HEAD to the specified state rm Remove files from the work ing tree and from the index show Show various types of objects status Show the work ing tree status tag Create, list, delete or verify a tag object signed with GPG

[TUTORIAL ] Beginning development-the easy way - xda-developers

See 'git help COMMAND' for more information on a specific command.

Now we will download the Repo and get the source code: Codes to type in the Terminal :

Code:

m k d i r~ / b i n P A T H = ~ / b i n : $ P A T H s u d oa p t g e ti n s t a l lc u r l c u r lh t t p s : / / d l s s l . g o o g l e . c o m / d l / g o o g l e s o u r c e / g i t r e p o / r e p o>~ / b i n / r e p o c h m o da + x~ / b i n / r e p o m k d i rs o u r c e c ds o u r c e

Ok so up to this part its mostly universal. However after this you need to sync up sources for your device. This will probably take a long time depending on your internet speed since the source is very big (also it will take up a lot of drive space: 1430GB). After that you should build. How to build First you will need to get proprietary drivers from your device. Connect your device via USB and enter the following commands (from the root of your source repository):

XDA PORTAL POSTS

Fine Tune Your H Level with Volum OK, lets face it. right volume with your

Code:

c dd e v i c e / x x x / x x xw h e r exi st h ep a t ht oy o u rd e v i c e . / e x t r a c t f i l e s . s h c d. . / . . / . .

Forum Added fo Huawei Ascend Just exactly how Well, thats a qu is trying to

NOTE: Some developers can include these files in the source itself or can mak e them available for download from their Github page. Check that out with your developer for more info. And start the build:
Code:

Chromecast: W Know XDA De Googles press e Internet great ex the New Nexus 7

.b u i l d / e n v s e t u p . s hx x x

Massive Update Replacement Lo Four-and-a-half took a quick look C Locker. As one

NOTE:Here x also varies since its unique for every device model Now Android is building. You may need to wait a long time (depending on your hardware-mainly CPU and RAM for example I have a quad core 2.92Ghz CPU and 6GB of HyperX DDR3 ram and it took me about 10min for CM7 and about 20-30 min for CM9).Once it's done you should get this message:
Code:

P a c k a g ec o m p l e t e : x x x . z i p

That is your flashable .zip file you install from recovery. Credits: Many thanks go to Keyur Maru who helped me learn how to develop and for making the base of this guide. Reference: http://source.android.com/source/downloading.html My devices:

forum.xda-developers.com/showthread.php?t=1667551

5/9

8/2/13

[TUTORIAL ] Beginning development-the easy way - xda-developers

REPLY
The Follow ing 60 Users Say Thank You to nerotNS For This Useful Post: [ Click to Expand ]

sangosnip69

22nd May 2012, 05:56 PM

#2

Very good tutorial for beginner

Developer of SaNgO Vizion


Senior Member Thanks Meter 349 Posts: 564 Join Date: Dec 2010 Location: Lyon MORE INFO DONATE TO ME

>

If I've helped you, please press the thanks button! This encourage me to continue my work!
REPLY

The Follow ing User Says Thank You to sangosnip69 For This Useful Post: [ Click to Expand ]

nerotNS

22nd May 2012, 05:59 PM Quote:

#3

Originally Posted by sangosnip69 Very good tutorial for beginner


Recognized Contributor OP Thanks Meter 315 Posts: 874 Join Date: Nov 2011 Location: Novi Sad MORE INFO

Thanks we tried our best since this is supposed to boost our dev base for our LG My devices:

>

REPLY
The Follow ing 2 Users Say Thank You to nerotNS For This Useful Post: [ Click to Expand ]

Nasty_z
Senior Member Thanks Meter 213 Posts: 676 Join Date: Feb 2012 Location: Manama,

22nd May 2012, 07:00 PM

#4

Definitely one to try at home! Sent from my GT-I9100 using xda premium

forum.xda-developers.com/showthread.php?t=1667551

6/9

8/2/13
Location: Manama, Bahrain MORE INFO

[TUTORIAL ] Beginning development-the easy way - xda-developers

>
REPLY

pranks1989
Senior Member Thanks Meter 124 Posts: 374 Join Date: Nov 2011 Location: Pune MORE INFO DONATE TO ME

25th May 2012, 05:13 AM

#5

Wow 10min is real fast!! I recently tried CM9 directly from one of the Dev's forked repo and after about 4hours of build I got some build error! I need to get a better computer soon if I plan to get my hands real dirty! And if I may I have few suggestions please mention that it will take a while to download the full repo from google sources else beginners may end up thinking something is wrong(which I did since it took me one full day to sync everything) and that it needs atleast 20-30GB disk space too..(Coz not everyone has Ubuntu as the only OS, I have three in my lapi!!)

>

A very good guide on the whole for a beginner!!! My devices: Motorola Defy+ MB526 Current: CM7(Kank) Motorola DefyMB525 Current: Latest build CM10(Quarx) Samsung Galaxy SII(I9100) Current: Stock JB. Spice MI 280 - Backup phone. Stock GB. Galaxy Fit (GF) - CM7.2 Stable Beats_ALSA_eq and ACID Audio Engine V1.0 rocks my phone!! Android Users India (Group in FB)
REPLY

The Follow ing User Says Thank You to pranks1989 For This Useful Post: [ Click to Expand ]

Kayant

1st June 2012, 12:41 AM Quote:

#6

Originally Posted by pranks1989


Recognized Contributor Thanks Meter 2421 Posts: 1,413 Join Date: Jul 2011 Location: London MORE INFO

Wow 10min is real fast!! I recently tried CM9 directly from one of the Dev's fork ed repo and after about 4hours of build I got some build error! I need to get a better computer soon if I plan to get my hands real dirty! And if I may I have few suggestions - please mention that it will tak e a while to download the full repo from google sources else beginners may end up think ing something is wrong(which I did since it took me one full day to sync everything) and that it needs atleast 20-30GB disk space too..(Coz not everyone has Ubuntu as the only OS, I have three in my lapi!!) A very good guide on the whole for a beginner!!!

>

Very true a great in depth and very informative tutorial for noobs like i was

this would have helped me a lot.... Great work

btw pranks1989 i can help you with compiling for defy.... I used to compile roms from eppy's and quarx2k github and never got a error once it else onece eppy pinted out the mistake i was doing.... just send me a pm of your errors and i will try help http://d-h.st/users/Kayant http://goo.im/devs/Kayant What XDA really means

My Work
CLICK TO SHOW CONTENT

REPLY

serendipityguy

1st June 2012, 05:55 AM

#7

Great start for me!

You have been thanked! Great start for me!


Senior Member Thanks Meter 412 Posts: 969 Join Date: Oct 2010 Location: Pasadena, CA MORE INFO

What would the procedure be if you want to create a rom that you can flash via Odin or Heimdall on a Mac client? If you have Used a Mod or know of a Hack that you want to pass on Post it over at the " The Official Galaxy S 4 Kernel ible Thread ". If you have Used a Kernel worth a shout out, dont hold back. If you are looking for the " The Official Vibrant Kernel ible Thread "

>
REPLY

forum.xda-developers.com/showthread.php?t=1667551

7/9

8/2/13
dbarrera
1st June 2012, 06:13 AM

[TUTORIAL ] Beginning development-the easy way - xda-developers


#8

The guide I've been looking for ever since I had my first Android device (actually, my Optimus Me is my first Android device)...

Senior Member Thanks Meter 88 Posts: 497 Join Date: Jan 2012 Location: Guayaquil MORE INFO

>
REPLY

goan0900

1st June 2012, 07:06 AM

#9

Thanks for this great guide. I will try it today. I already compiled a Rom, it took me 40 min. AMD 8 Core 3,1 MHz and 16 GB DDR3
Senior Member Thanks Meter 130 Posts: 244 Join Date: Mar 2011 Location: Kaltensundheim MORE INFO DONATE TO ME

But when i try a different device i always get errors, i hope your Guide will get me in to it. Basteldroid - eigene Android App programmieren, einfach und nachvollziehbar if i helped you, you could hit the THANKS button or if you can/like, help me to BUY me a Beer to get PARANOID

>

REPLY

nerotNS

1st June 2012, 08:00 AM (Last edited by nerotNS; 1st June 2012 at 08:03 AM.) Quote:

#10

Originally Posted by serendipityguy


Recognized Contributor OP Thanks Meter 315 Posts: 874 Join Date: Nov 2011 Location: Novi Sad MORE INFO

You have been thank ed! Great start for me! What would the procedure be if you want to create a rom that you can flash via Odin or Heimdall on a Mac client? I don't know but it's surely different for odin(I'm not sure that you can).And I don't know on mac either since I use ubuntu and windows. You can look up info on this on the official Android dev website. Sent from my Optimus Me using xda premium My devices:

>

REPLY

The Follow ing User Says Thank You to nerotNS For This Useful Post: [ Click to Expand ]

TAGS compile, development, easy, source

>

>>

Page 1 of 4

POST REPLY

SUBSCRIBE

Search this thread

forum.xda-developers.com/showthread.php?t=1667551

8/9

8/2/13

[TUTORIAL ] Beginning development-the easy way - xda-developers


> Android Development and Hacking > Android Software Development > [TUTORIAL ] Beginning development-the easy way

Previous Thread | Next Thread

XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?

-- XDA 2013 Beta

More Info: Contact Us | Suggest Content | Privacy Policy | XDA App


Copyright xda-developers. Pow ered by Searchlight 2013 Axivo Inc.

forum.xda-developers.com/showthread.php?t=1667551

9/9

You might also like