Guides/JAndroid

From J Wiki
Jump to: navigation, search

Install and Upgrade

Before installation, enable Unknown Sources if not yet done.

To access the Unknown Sources setting directly, press the menu icon or button from the Home screen and tap Settings. Select Security (Android OS 4.0+) or Applications (Android OS 3.0 and earlier).

You may need to scroll down to see the Unknown Sources setting.

Open a web browser to download and install jandroid.apk on your Android device. A blue J icon labeled jandroid will appear in launcher screen if installed successfully. The first run will take about 1 minute to decompress files. After installation process has completed, tap on Back Button to finish install.

On Android 6 or newer, storage permission must be granted otherwise J Android cannot work properly.

Jandroidpermission.png

JKeyboard

This is the JKeyboard from Michael Dykman. Go to Settings >> Language & Input to activate JKeyboard. We do not collect your data. Finally scroll up and select JKeyboard in the default box.

SystemFolders

$EXTERNAL_STORAGE is the path of the emulated sdcard folder which is usually /storage/emulated/0,

~install  $EXTERNAL_STORAGE/Android/data/com.jsoftware.j.android/files
~bin      /data/data/com.jsoftware.j.android/app_jandroid/bin
~system   ~install/system
~addons   ~install/addons
~user     $EXTERNAL_STORAGE/j64-806-user or $EXTERNAL_STORAGE/j806-user
~home     $EXTERNAL_STORAGE

other folders will be under ~user

~break
~config
~projects
~snap
~temp

~break is empty and will not be used.

Upon uninstall, all files under ~install will be removed by Android.

File permission

Prior to Android 6 (except Kitkat), files on emulated sdcard and sdcard (except some special folders) are public and can be read and written by all users/apps. Explicit storafe permission is required on Android 6 or newer are required for J Android to work properly.

Files under /data/data/{android apps} are owned by the respective apps, and not accessible by other Android apps such as text editor, image viewer.

Location of Shared Libraries

Startup Files

~install/bin/profile.ijs
~install/bin/profilex.ijs         NB. if present
~home/.jprofile.ijs               NB. if present
~install/bin/startup_android.ijs  NB. if present

profilex.ijs is typically used for setting up system folders. Other customization can be put in either .jprofile.ijs .

Jconsole

Command line frontend jconsole or jconsole-nopie executable is available with full path name under

jpath '~bin/../libexec
or
/data/data/com.jsoftware.j.android/app_jandroid/libexec

Its file permission is 755. There is no visible icon for jconsole on Android screen.

It can be called from J using 2!:0 or 2!:1 in a non-interactive mode.

Certain Android Apps such as Shell and Terminal Emulator can run jconsole in an interactive mode.

Async Mode

By default jandroid run in sync mode but the following features requires async mode

  • console keyboard input of 1!:1[1 and explicit definition
  • debug and suspension not supported

Use wd command to switch between sync and async mode,

wd 'setj asyncj 0'   NB. sync
wd 'setj asyncj 1'   NB. async

and restart J to take effect.


Force Update

The Android APK file contains system base library and some addons. Whenever jandroid starts, it will check the version number stored in

~install/assets_version.txt

to determine if it needs to decompress and overwriting files. If you want to decompress files again, type

dver ''

and restart J, and then quit again to finish install.

jandroid will switch back to the default sync mode.

Limitation

  • printing not yet supported
  • keyboard shortcut is not supported
  • some addons such as FFTW do not work because of missing shared libraries.

Known issues

  • when jandroid has been killed by Android after a long in-activity period, jandroid can not restart and will crash.

Contributed by Bill Lam