all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#65207: 30.0; More instructions for how to build Android emacs, are needed
@ 2023-08-10  9:23 Johan Widén
  2023-08-10 14:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Widén @ 2023-08-10  9:23 UTC (permalink / raw)
  To: 65207


[-- Attachment #1.1: Type: text/plain, Size: 3929 bytes --]

Note: This is a request for an enhancement of the emacs version 30
documentation. I am writing this submission in emacs 29.1, so the
current environment details are irrelevant.

I needed to build and run the Android emacs APK, to try and track down a
bug. As I am a novice regarding building Android apps, finding out how
to do this required considerable effort. I therefore suggest that
information similar to what I include below, is added as an appendix to
java/INSTALL.

First I suggest that the emacs repo top level README or INSTALL should
include a reference to java/INSTALL. Perhaps something like this:
• For instructions on how to build Android emacs, see ./java/INSTALL.

Here is now my build and run instructions:

I am using Ubuntu, so these instructions are Ubuntu specific, but should
be easily adaptable to other linux based distributions. Note that
Android Studio, Android SDK, Android NDK can be downloaded from the
software provider, if they are not available in your linux distributions package manager.

I first installed Android Studio. It is available in the Ubuntu snap store:

• sudo snap install android-studio

I then ran Android Studio to set it up, and also tried to build a sample
project. I believe that at this point $HOME/Android with important
subdirectory $HOME/Android/Sdk/build-tools/33.0.1 was added to my $HOME
directory. See below why this was important.

I then installed a number of apt packages:
• sudo apt install android-sdk
• sudo apt install sdkmanager
• sudo apt-get install crossbuild-essential-arm64
• sudo apt install google-android-ndk-r25c-installer

Not sure if package crossbuild-essential-arm64 is needed.

The SDK was installed under /usr/lib/android-sdk.
The NDK was installed under /usr/lib/android-ndk.

The sdk supports creating Java based apps.
The ndk supports creating apps using C or C++ source.

Now something important: The sdk installation created, among other
things, a directory /usr/lib/android-sdk/build-tools/debian. I tried
building with that, but this did not work, as the contents of the
directory is very incomplete. That was when I discovered $HOME/Android, and
the important directory $HOME/Android/Sdk/build-tools/33.0.1. Using that
directory instead of the debian directory, I was able to make a
successful build.

I added a number of directories to my PATH, but I do not know if that is
necessary:
if [ -d “/usr/lib/android-sdk/tools/bin” ] ; then
    PATH=“/usr/lib/android-sdk/tools/bin:$PATH”
fi
if [ -d “/usr/lib/android-sdk/platform-tools” ] ; then
    PATH=“/usr/lib/android-sdk/platform-tools:$PATH”
fi
if [ -d “$HOME/Android/Sdk/build-tools/33.0.1” ] ; then
    PATH=“$HOME/Android/Sdk/build-tools/33.0.1:$PATH”
fi
if [ -d “/usr/lib/android-ndk” ] ; then
    PATH=“/usr/lib/android-ndk:$PATH”
fi

To install cross compilers for android I now did:
• sudo sdkmanager –list
• sudo sdkmanager “platforms;android-33”

Installed under “/opt/android-sdk//platforms/android-33”.
ANDROID_CC are under
/usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin

I then ran the following in the top directory of the emacs repo:

./configure –with-android=/opt/android-sdk/platforms/android-33/android.jar \
ANDROID_CC=/usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang  \
SDK_BUILD_TOOLS=$HOME/Android/Sdk/build-tools/33.0.1

make all

To run the emulator I started Android Studio, and in the menu in the
upper right corner selected “Virtual Device Manager”. I could then
select and run the default emulator device
“Pixel_3A_API_34_extension_level_7_x86_64”. To load the APK into the
emulator I started a file manager and dragged and dropped the APK file
onto the emulator display. The computer keyboard can be used for typing into Android emacs.

[-- Attachment #1.2: Type: text/html, Size: 7672 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-10 17:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-10  9:23 bug#65207: 30.0; More instructions for how to build Android emacs, are needed Johan Widén
2023-08-10 14:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-10 17:25   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.