1. Download our Official Android App: Forums for Android!

Apps how to build and complile the android 4.2 (jelly bean)source code

Discussion in 'Android Development' started by samual_D, Jan 26, 2014.

  1. samual_D

    samual_D Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    2
    Joined:
    Jan 26, 2014

    Jan 26, 2014
    2
    0
    25
    I am new to android development, I am developing a play back feature on Google nexus 10 tablet , which plays specific video format , we have video Decoder.

    For that i have downloaded android 4.2 jelly bean source code but , I don't know the steps to Build , compile or how to proceed further with android media framework (for play back feature ).

    I searched in Google but i did't got the proper answer there..


    Kindly educate me on procedure to follow /or any data/ link which specify in detail about the same.

    Thanks in advance ... ! Regards , samual
     

    Advertisement

  2. JVene

    JVene Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    83
    Joined:
    Jan 2, 2014

    Jan 2, 2014
    83
    91
    63
    What you've briefly described sounds like an application development project, but you're asking about how to build the operating system source code.

    These two concepts don't generally go together, but if you have important reasons to have the source code to the OS, it's because you intend to package something for the OS, like a custom ROM or fabrication of a version for new hardware.

    Application level development needs only the SDK and likely the NDK - nothing else.

    That said, building the source code has been documented many times, so repeating the entire thing here is just not reasonable to do.

    However, let's start with the most basic pre-requisite.

    Do you have a 64 bit installation of Ubuntu? Linux at all?

    If not, start there. You can't build from source without that (not any recent version anyway), and since you didn't mention anything beyond downloading the source, I have to point that out as THE first step.

    You can build from source in virtual machine of Linux, and SOME have had success building in a MAC, but for the Mac's own sake I'd advise against that. The things you end up doing to your compiler if you follow the instructions are not really great ideas on a Mac. Do it in a VM.

    The free Virtual Box is a good selection for Windows.

    The next thing I advise you regarding the Android website instructions - there's one (only one) serious error in them.

    Start from here:

    The Android Source Code | Android Developers

    Most of the instructions there are correct, except one step. When they get to the "initializing the build the environment" page, they tell you to "install required packages" (Ubuntu 12.04).

    It's on this page, and Do NOT issue the command you see that look like this

    Initializing a Build Environment | Android Developers

    Code (Text):
    1.  
    2. $ sudo apt-get install git gnupg flex bison gperf build-essential \
    3.   zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
    4.   libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
    5.   libgl1-mesa-dev g++-multilib mingw32 tofrodos \
    6.   python-markdown libxml2-utils xsltproc zlib1g-dev:i386
    7. $ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
    8.  
    Everything else they're telling you to do is fine, but this one is downright insulting to a 64 bit Linux installation. It can actually disable the video drivers, or at least OpenGL.

    Substitute this instead:

    Code (Text):
    1.  
    2.  
    3. sudo [B][COLOR=red]apt-get install git-core gnupg flex bison gperf  build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev  ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev  libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown  libxml2-utils[/COLOR][/B]
    4.  
    5.  
    Which I've posted from this page on the subject:

    [TUTORIAL] Setting up and Compiling JB and ICS | Galaxy Nexus > XDA

    You may need to research - A LOT - to find solutions to the various, minor problems. Frankly, it is beyond anyone without significant skills and experience in Unix/Linux and C. This is not something you can manage by following a step by step guide without some knowledge of building C libraries or other code from source.

    That's because there are many "versions" of instructions, from various blogs and articles, written at various times when THE INSTRUCTIONS WERE DIFFERENT.

    You have to be able to adapt as you go along.

    I got "hit" with the aforementioned install error in my setup. Fortunately I put Lubuntu (Well Ubuntu with the LXDE destop installed) in a virtual machine, had snapshots, and easily backed out of it).

    For me, a few minute's research and I found the solution, and the origin of the problem.

    That hit me because I was simply following step by step what Android's documentation said. I figured I should trust them.

    That was an error, but not a huge one for an experienced developer. It would have been significant if Linux were my host OS, but I really don't think in the modern era you should be building such things unless it's inside a VM.

    That said, you don't need the claimed 16 Gbytes RAM/Swap space to build the source. They make it sound like "AT LEAST" 16 Gbytes is required or the build will fail.

    That's rubbish. The VM I used to build 4.4.2, 4.1.2, 4.0.3 and 2.3.3. is configured with 4Gbytes of RAM and 4 GBytes of swap space, and it never needed the swap space to complete the build.

    What they tell you is that "-j" should be the same as the number of CPU cores you own to perhaps twice the cores you own.

    They also claim this is "typical" to do.

    I'm a developer of 30+ years experience. I can tell you it's not typical. It may even be foolish. If you have a 4 core machine and told the compiler to build on 8 thread, you may well need 16 GBytes of RAM, but it's a USELESS waste.

    Timing proves my point correct. They claim on high performance machines it takes 3 hours to build 4.4.2. Fine, that's not bad. On my Quad AMD, a typical machine of 3.5Ghz, with 3 cores configured for the VM, I issued -j 2, so I could continue with other work.

    The build of 4.4.2 completed in 2 hours.

    Don't overstuff -j. It's nonsensical.










    They give you an instruction to install required packages which can disable the video drivers on a Linux computer.

    It appears to me that they left instructions intact from a MUCH older set of build instructions on this one step.



    [TUTORIAL] Setting up and Compiling JB and ICS | Galaxy Nexus > XDA
     

Share This Page

Loading...