Open Source Android Development Tools

Are there any open source options for developing android apps? Google’s Android Studio build seems to be proprietary, other app development frameworks use Android Studio to build the final app for android. I can’t seem to find an open source build of it anywhere similar to VSCodium which exists for VSCode either.

What do F-Droid developers use to build the client app?

Most Android programs can be assembled with the Android SDK alone, no IDE required.

Is there a source to download an open source build of the Android SDK without having to agree to Google’s EULA? Trying to download the Command Line Tools from the bottom of https://developer.android.com/studio prompts me to accept Google’s restrictions.

Google’s EULA features a disclaimer releasing you from its obligations in relation to all software provided under free software licenses, or words to that effect, when last I read it.

1 Like

Question:

Is the issue that your development environment is proprietary, or that Android SDK is proprietary?

If you are looking for an IDE, like Android Studio, as a program to help you compile Android apps, you can always use the open source eclipse IDE:

Which still will need the Android SDK to work, but will not be Android Studio, which is proprietary.

The Android SDK tools were originally open source and that source can be downloaded and compiled directly from here:

https://android.googlesource.com/platform/sdk/+/master/

However, since API level 15, all Android SDK downloads have included this license statement:

"SDK License from Google

3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.

3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. “Intellectual Property Rights” means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.

3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK."

Which looks a lot like being not open source. However, several people have made ‘open source’ alternatives, like here:

  • Disclaimer, I have not tried these alternative builds.

Author’s note: I’m the dumbest person I know, so take it with a grain of salt. :smiley:

2 Likes

Android SDK, I see. It looks like there isn’t a well maintained source for builds of the SDK without a license agreement, but the source code is open source and it’s possible to have custom builds.

1 Like

I mostly use Emacs and command line Gradle for Android development. It has some nice advantages, but for certain tasks, Android Studio is drastically better since it is the only place that Google puts effort into supporting.

This thread points out an important issue: Android could be a nice free software ecosystem with some work since everything is built upon large open source projects like AOSP, IntelliJ, Java, Gradle, etc. But key pieces are proprietary, namely Google’s SDK binaries and Android Studio. Gradle has started slipping even, now requiring a proprietary build plugin by default. So we need more contributions to free this ecosystem. The key efforts are:

  • Free rebuilds of the Android SDK like android-rebuilds / auto · GitLab, mostly what is missing there is someone to run the builds and host the binaries.
  • Free builds of Gradle. There is an effort in Debian right now. It is a lot of work, so more contributions would ensure its success.
  • Work around freeing as much of Android Studio as possible and getting it into IntelliJ or free software plugins.
3 Likes

Isn’t Android Studio free software?

See here: Android Developer Tools - Checkout and build the source code

BTW, it might interest you to know that the Android port of Emacs was, unsurprisingly, developed with Emacs and does not require Gradle. If only other Android programs would adopt simpler build systems…

IF it’s not built by Debian… I’d say “not really”

1 Like

Hmm. Also I’m curious, how is Gradle encumbered?

I haven’t seen any evidence that Google publishes the complete source code. I
believe IntelliJ is, and Android Studio is a custom version of that.

1 Like

I did some research on this last night. Here is what I found:

Android Studio, completely* open source files:
https://android.googlesource.com/platform/manifest/+/refs/heads/mirror-goog-studio-main-without-vendor

Android Studio, with closed source files:
https://android.googlesource.com/platform/manifest/+/refs/heads/mirror-goog-studio-master-dev

The principle difference is in the closed source files version, they add:

  <!-- BEGIN closed-source projects -->
  <project path="tools/vendor/galvsoft" name="platform/tools/vendor/galvsoft" />
  <project path="tools/vendor/google" name="platform/tools/vendor/google" />
  <project path="tools/vendor/google3/blaze" name="platform/tools/vendor/google3/blaze" />
  <project path="tools/vendor/intel" name="platform/tools/vendor/intel" revision="main" />
  <project path="tools/vendor/intellij/cidr" name="platform/tools/vendor/intellij/cidr" />
  <project path="tools/vendor/adt_infra_internal" name="platform/tools/adt_infra_internal" groups="adt-infra" />
  <project path="prebuilts/studio/buildbenchmarks" name="platform/tools/vendor/google_prebuilt/buildbenchmarks" clone-depth="1" />
  <project path="prebuilts/android-emulator" name="platform/prebuilts/android-emulator" clone-depth="1" />
  <project path="prebuilts/studio/sdk/remote" name="platform/tools/google_prebuilts/studio/sdk/remote" clone-depth="1" />
  <project path="prebuilts/studio/intellij-sdk" name="platform/tools/vendor/google_prebuilts/studio/intellij-sdk" clone-depth="1" />
  <project path="prebuilts/studio/sdk/darwin" name="platform/tools/vendor/google_prebuilts/studio/sdk/darwin" clone-depth="1" groups="notdefault,platform-darwin" />
  <project path="prebuilts/studio/sdk/linux" name="platform/tools/vendor/google_prebuilts/studio/sdk/linux" clone-depth="1" groups="notdefault,platform-linux" />
  <project path="prebuilts/studio/sdk/windows" name="platform/tools/vendor/google_prebuilts/studio/sdk/windows" clone-depth="1" groups="notdefault,platform-windows" />
  <!-- END closed-source projects -->

These added closed source files are present in any version of Android studio you can download. So, I agree with @hans , we Android freedom/open source folks would need someone to build these from source and make that available for the average user.

To build it is not easy, in that it requires a lot of downloading and a fairly good computer, as well as some skill, making this difficult for the average user.

It may actually be simpler to provide unencumbered builds of the Android-sdk that can be used with Eclips, rather than to build Android Studio each time. Also, I am not 100% certain that the open source version of Android Studio(AS) will work, and for sure it will lack some of the functions that are in the closed source AS.

Also, I am not sure that if AS was built with the open source variant, if you could still sign and submit it to Google Play, not really a topic for here, but just a side note.

  • Earlier I said that the “without vendor” variant is completely open source, but I am also not entirely sure that is true, because it downloads several pre-built binaries from Google. Such as:
<project path="prebuilts/clang/host/darwin-x86" name="platform/prebuilts/clang/host/darwin-x86" clone-depth="1" groups="notdefault,platform-darwin" />
  <project path="prebuilts/clang/host/linux-x86" name="platform/prebuilts/clang/host/linux-x86" clone-depth="1" groups="notdefault,platform-linux" />
  <project path="prebuilts/clang/host/windows-x86" name="platform/prebuilts/clang/host/windows-x86" clone-depth="1" groups="notdefault,platform-windows" />
  <project path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8" clone-depth="1" revision="main" groups="notdefault,platform-linux" />
  <project path="prebuilts/python/darwin-x86" name="platform/prebuilts/python/darwin-x86" clone-depth="1" />
  <project path="prebuilts/python/linux-x86" name="platform/prebuilts/python/linux-x86" clone-depth="1" />
  <project path="prebuilts/python/windows-x86" name="platform/prebuilts/python/windows-x86" clone-depth="1" />
  <project path="prebuilts/r8" name="platform/prebuilts/r8" clone-depth="1" />
  <project path="prebuilts/studio/jdk" name="platform/prebuilts/studio/jdk" clone-depth="1" />
  <project path="prebuilts/studio/layoutlib" name="platform/prebuilts/studio/layoutlib" clone-depth="1" />
  <project path="prebuilts/tools" name="platform/prebuilts/tools" clone-depth="1" />

One would have to check if these pre-built binaries are in fact open source and built authentically as well, since we already proved that we can’t trust Google.

Author’s note: I am the dumbest person I know, please take this with a grain of salt. :smiley:

The hard work of automating rebuilds of the Android SDK has already been done by
the @beuc. It looks like GitHub - ethanc8/SDK-Rebuilds: Free rebuilds of the Android SDK is continuing
with @beuc’s effort.

An overview of the resources needed is here:
https://blog.beuc.net/posts/Android_Rebuilds_updates/

Some of the history of this is available:

The only missing piece is someone to host a trusted build server to run the
builds, and a webserver to host the binaries for people to use. If someone is
ready to take that on, I can help them get setup.

I don’t want to claim to be able to do something long term, but I think I would like to personally try doing this once and see how it goes.

I’ve built Android AOSP/LineageOS/AOKP/Slimroms/etc., for years, so I am familiar with the building process and repo. I also host my own websites, and could probably host the binaries, though a more reliable method of hosting them would work better.

My biggest concern is internet. Living in Alaska, sometimes the internet doesn’t work, is slow, gets limited or capped. Granted, once the source is downloaded, I simply have to fetch the latest, so not requiring 100GB downloads every time.

My current plan would be to use Aqemu, make a Ubuntu 22 virtual machine, allocate the space (I have 32TB available) and ram (my main server has 128GB of ram, so allocating 32GB should be a non issue), and give the auto build scripts a try. At least to build releases for what he has already created scripts for.

By the way, do you mean something specific by “trusted build server”? Brings up the point that people would just have to trust my build as well. Do you have a recommended setup for doing this long term?

A trusted build server would be a buildserver that is run with a high degree of
security. If someone can mess with the server, they can transparently mess with
any of the builds. If there are reproducible builds, then that’s not such a
concern. But I’m not sure that is possible yet with Android SDK rebuilds. If
so, then we don’t really need a trusted build server, just some rebuilds to
confirm the binaries match.

1 Like

That looks like just a fork of Starfish/SDK-Rebuilds - Codeberg.org which I,ve built, but yet to test-use

Also, that downloads a huge repo from Google

Maybe this is a layers thing, like “can be rebuilt”, “can be rebuilt from only FOSS tooling” etc

Not sure we’re on the best level yet, iirc it’s “rebuiding whatever Google put there” for now, at least that repo

1 Like

I wonder if we can use the TWRP minimal manifest instead? That would cut down on the download size significantly…

I can provide my webserver for binaries, up to approx 75-80 GB space and 1-1.25 TB (afair) bandwidth.
I will be glad to collaborate on this. I am not sure my root server has that capacity to build or not.
Netcup root server < this is my server.
Or, I can even provide for 1 extra root server, but can bear cost max of 5-6 months every year, and someone will have to pitch in.

1 Like

Google’s source code repos claim that the source is free. So I think just
rebuilding them and putting out our own binaries would cover the legal part of
question. They would have a free license. The DFSG level means rebuilding
everything from source, which would be a lot more work. Google uses lots of
“prebuilt” binaries of tools in their builds.

1 Like

So if I build them, you could host them? :smiley:

2 Likes