Search code examples
javaandroidandroid-sourcedalvikandroid-sdk-tools

What is the output when building android framework from the source tree


I am planning to modify the Android framework within the source tree. I have few questions,

  1. If i build only the framework directory what will be the output? Will it be a jar file or the whole system image?
  2. How can I use the built framework to develop apps that use this custom framework? (will there be any android.jar or something similar?

Thank you.


Solution

    1. Building only the framework (mmm frameworks/base) is not enough. If you do in this way you will only obtain a bunch of jar files containing built framework. To use the modifications, you need to build the full image against which you will test your changes. Do not forget to do make update-api

    2. To use the modified framework, you need to build sdk. To do this, you need to do the following steps after you've updated the api (see more https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt):

      source build/evnsetup.sh
      lunch sdk-eng
      make sdk
      

      After you've built the SDK, you need to point Android Studio project to the new location of the SDK. To do this, create a new project in Android Studio, select the root folder in the Project panel, and make a right click on it selecting the "Open Module Settings" item (or simply pressing F4). Point the location of the SDK to the folder with newly created SDK (it should be somewhere under the out/host/linux-x86/ directory if you use Linux-based host operating system).