Search code examples
javaandroidandroid-sourcelauncherviewgroup

Secret Android build process


The Android (Open Source Project) native launcher source code seems to be missing the following required XML layout parameters in some of its published resource files: layout_height and layout_width

Missing attributes

Compile-time exceptions

This breaks launcher compilation, at least independent compilation, throwing errors such as:

  • 'layout-width' attribute should be defined
  • 'layout-height' attribute should be defined

Note: there are many other issues that need to be resolved in order compile Android launcher2, this question is about these specific missing attributes and how come they are missing?

How does Google compile its launcher and what are the LayoutParams values?

So how is Google able to compile the code when these required attributes are missing?

Furthermore, what are the values that should be used, should they be:

android:layout_width="fill_parent"
android:layout_height="fill_parent"

or wrap_content, or specific pixel values - in other words, where can I get this kind of information / what is the secret build process?


Solution

  • We do not compile Android with Eclipse+ADT but with make. The compilers do not check for layout_width and layout_height at build time. When these attributes are missing a runtime error is generated. But Launcher2 is built so that these attributes are not needed (using code to generate layout params for instance.) There is nothing secret about it :)