directory-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unapprove F-Droid like Replicant?


From: Denis 'GNUtoo' Carikli
Subject: Re: Unapprove F-Droid like Replicant?
Date: Sun, 24 Sep 2023 23:29:15 +0200

On Sat, 23 Sep 2023 20:34:22 +1000
Yuchen Pei <id@ypei.org> wrote:
> As a related question, if I want to develop an android app, how do I
> do it using free software only? Is there a tutorial somewhere? The top
> search results all point me to android studio which does not look
> free, and the google android sdk mentioned above.

I've documented the SDK that can be used on the Replicant wiki[1].

As for how I did it, I started from hello-world-debian-android, an
application that works with a Makefile[2] and I used PureOS Byzantium[3]
because it didn't work for me under Trisquel.

I then used the API reference from Google[4]. I didn't find the source
code to this website (it was previously in a git that doesn't have
newer versions) so I just looked at the website while online.

It should be possible to download it for offline use for instance (if
someone has code for that I'd be interested) and maybe even package it
as It's available under a free license (Apache 2.0)[5].

With the API, I manage to modify the hello-world-debian-android program
and from that I wrote extremely simplistic programs[6] that enable to
detect the modem and power it on or off on devices running Replicant. I
made sure to use API compatible with Android 6.0 while writing the
code, and I tested the programs under real device with Replicant 6.0.

Limitations and future directions:
----------------------------------
- I still need to find a way to include the programs I wrote in
  Replicant: I tried to write Android.mk files for that but it didn't
  work: the application built fine but it didn't run. Maybe that's
  because they require root, so I need to find a way for that.

- I also didn't make an F-Droid package yet but that looks doable
  because:
  - F-Droid server seems to support any build system (like Makefiles for
    instance) because some package use things like ./configure for
    instance.
  - The F-Droid server is available in PureOS or in Guix (as
    'fdroidserver') and Guix or software packaged with Guix pack can
    also run in PureOS.

- It only works in PureOS (or Debian). But this also shows the
  importance of being able to use the packages of an FSDG distribution
  in another one.

- This is a pure java setup. For compiling C code, or a mix of Java
  and C, maybe starting with the Replicant 4.2 SDK and the emacs source
  code would be a better start. Compiling Emacs with an SDK for Android
  4.2 requires slight modifications that are documented in Emacs README
  or a similar files that are in its source code. 

  It might also be possible to make your own C toolchain with gcc and
  the bionic libc but that requires some consideration like to find the
  oldest kernel version you want to support, probably to find the right
  bionic libc to target old Android versions too, etc.

References:
-----------
[1]https://redmine.replicant.us/projects/replicant/wiki/SDK
[2]https://gitlab.com/Matrixcoffee/hello-world-debian-android.git
[3]As I use Guix on my main laptop, I ran PureOS under Guix by using a
   chroot just to build my project.

   Note that debootstraping PureOS is currently broken in all FSDG
   distributions but PureOS (they have custom patches on top of
   debootstrap, so if you want to install PureOS from debootstrap, you'd
   need to Download PureOS's debootstrap source code and use that).

   PureOS also has a docker container and it should be FSDG compliant
   but installing it through docker requires you to blindly trust
   Docker Hub not to have modified the image, and making your own
   container requires PureOS's debootstrap (and debuerotype).

[4]https://developer.android.com/reference/
[5]https://developer.android.com/license
[6]https://git.sr.ht/~gnutoo/android-modem-tools

Denis.

Attachment: pgpEEXGPhRu89.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]