Search code examples
androidandroid-studioandroid-source

How to download Source code from Android Google Source With Gradle files


How to download the android project from android.googlesourece.com with the Gradle file!! I want to download the DeskClock app

https://android.googlesource.com/platform/packages/apps/DeskClock/+/refs/tags/android-r-preview-2

but the project does not contain the Gradle file, also I did go through the official documentation but I don't really understand well. is there a tutorial guys, can you guys guide me how to get the files with Gradle


Solution

  • These apps are part of AOSP build tree. There are no Gradle files for them. The information on how it is build, what its dependencies are is inside Android.mk (or Android.bp for newer versions) .

    To build a such app, you'll have to download the whole AOSP tree, setup the environment, and then you can build a single module using mmm packages/apps/DeskClock.

    You could always try to import it in Android Studio, and see if that works.
    Apps in the AOSP tree often use non standard SDKs ( methods and classes that aren't part of official SDK that you get when developing Android apps).

    It's generally difficult to build them out-of-tree like this. This might be of help for some references https://github.com/anggrayudi/android-hidden-api.