PariDroid is a port of PARI/GP to Android, started by Charles Boyd and currently maintained by Andreas Enge. It is distributed under the GNU General Public License, either version 3 of the licence, or (at your option) any later version (GPLv3+).
The remainder of this page describes how to compile the source code for yourself; there is no need to do so if you are happy with the provided binaries.
Installing the Android build environment
for instance the
build r24.4.1, and unpack it into some location. In the following,
we will assume that the resulting directory is
to your path, for instance as symbolic links:
export SDK=/usr/local/android-sdk-r24.4.1 su cd /usr/local/bin ln -s $SDK/tools/android ln -s $SDK/tools/emulator64-arm
or by extending the execution path:
Install an Android platform by running
and, in the window that opens, keep the selected Android SDK Platform-tools and Android SDK Build-tools. Click on Obsolete. Deselect Android 6.0 (API 23) and select Android 3.0 (API 11) instead. Click on Install packages, accept the non-free license and install.
The previous step has populated
to your execution path:
cd /usr/local/bin ln -s $SDK/platform-tools/adb ln -s $SDK/build-tools/24.0.0/zipalign
Some of the tools are 32 bit dynamically linked binaries
for instance). So you need to have suitable 32 bit libraries installed.
apt-get install libc6-i386 zlib1g:i386 libstdc++6:i386appears to be enough to pull in all the needed dependencies.
For the emulator to work, we need to create a virtual Android device (avd). First,
android list target
shows two possible targets. The first one, called android-11, corresponds to the basic Android environment; the second one appears to include additional libraries from Google.
android create avd -t android-11 -n android11
now creates a new virtual device with the name android11, which should be listed when executing
android list avd
To enable input from the computer keyboard as if it were typed on the
telephone, add to the file
Start the Android emulator with
emulator64-arm -avd android11 &
A window opens in which (after a few minutes) a telephone screen is simulated. If for simpler testing purposes you can make do without a window, the command
emulator64-arm -avd android11 -no-audio -no-window &
starts the emulator faster in command line mode. To see whether the emulator is ready, call
device when the emulator is ready
unknown before). Or wait until
returns. The emulator may be stopped with
adb -s emulator-5554 emu kill
To later compile and integrate the PARI C library
into the project, download the
NDK; for instance,
64bit r10e. Rename the file to obtain the suffix
unpack it with the command
p7zip -d, for instance as
Setting up the PariDroid project
The following steps need to be executed only once. Download PariDroid from its git repository:
git clone http://pari.math.u-bordeaux.fr/git/paridroid.git cd paridroid/PariDroid
Prepare the Android project:
android update project --target android-11 -s -p . cd ..
It is not necessary any more to prepare by hand the
PARI source code; it will be fetched automatically
from the git server and placed into the
../srclib/pari directory, next to the PariDroid sources,
make for the first time.
Makefile also contains the logic to check out the
correct PARI version depending on the PariDroid version number:
its first three fields specify the PARI version.
If it corresponds to a released version, the corresponding git tag
is checked out. Otherwise, the latest git master is fetched.
Makefile is set up to create an apk in release mode,
which is then signed with a debug key. On the first run, this key needs
to be created by doing a debug build:
cd PariDroid ant debug cd ..
Set the environment variable
NDK to contain the path
to the Android NDK, which is used by the
A call to
configures and compiles the PARI library
and compiles the PariDroid project into
signed with a debug key and aligned.
The unsigned and unaligned package resides in
the signed and unaligned package in
removes the generated files. The final package can be tested by installing it in the emulator:
adb install PariDroid-VERSION.apk
After clicking on the application icon on the telephone screen, a click on the PariDroid icon should open the program. To simplify further tests, the icon can be dragged onto the home screen (it will always refer to the latest installed PariDroid instance).
The package can be uninstalled using
adb uninstall fr.ubordeaux.math.paridroid
or, more easily, an installed package can be overwritten with
adb install -r PariDroid-VERSION.apk
For debugging purposes, it may be useful to launch the command
in a separate terminal window.
Remarks for the maintainers
The configuration file
pari.cfg for version
PARI_VERSION of PARI is kept in the
config/PARI_VERSION. The version
is a synonym for the HEAD of git master, and as such is a moving target.
After updating the PARI sources, it may thus be
necessary to recreate the configuration file.
To do so, make sure that the emulator is running (with or without a window)
adb is in your path.
and retrieve the generated file