bug-gnulib
[Top][All Lists]
Advanced

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

Android environments


From: Bruno Haible
Subject: Android environments
Date: Tue, 27 Dec 2022 08:04:09 +0100

Po Lu wrote:
> The compilation is done on the host machine that's building Emacs (to
> produce emacs.so), which is then copied to the lib directory in the APK
> package.

I see. There are two ways to build C programs for Android:

  (A) The way it is designed by Google: With the Android NDK,
      that includes a cross-compiler. For the runtime, use an emulator
      (based on qemu) or a physical connection to a real device.

  (B) Inside a terminal emulator app (Termux [1][2] for Android ≥ 7,
      Terminal-IDE [3] for Android < 5).

(A) is a POSIX-like environment only at the C level; it has no shell and no
utilities.

(B) is a POSIX-like environment including shell and utilities.

For building a real app, the approach (A) is what one needs.

But for building and testing a library, the approach (B) provides
  - an environment that allows to reuse build infrastructure (configure etc.)
    from GNU,
  - faster turnaround cycles.

For Gnulib, we have only used approach (B). We *hope* that the resulting
source code will also work well in situation (A). But when you hit a problem
in situation (A), you are on your own. Because I won't install an NDK and
get into the complexities of cross-compilation, APK packaging, and so on.

> > Again, what is the Android API level that you are using?
> 19.

This is supported with Gnulib, as I have done a lot of testing with Android 4.3
(API level 18).

Bruno

[1] https://f-droid.org/en/packages/com.termux/
[2] https://wiki.termux.com/wiki/Main_Page
[3] https://www.spartacusrex.com/terminalide.htm






reply via email to

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