-
Notifications
You must be signed in to change notification settings - Fork 86
Android Substitutions
Files at the app or module directory named as any of the below will substitute its contents into the described areas upon compilation for Android.
C #define
macros.
Additional C code.
Java import
statements. These will be inserted in the file where the main Activity class is located.
Comma-separated list of Java classes that the main Activity class implements. These will be inserted after the implements
keyword of the main Activity class.
Java variable declarations. Include all keywords and initializations when applicable, and the final semicolon (e.g. private static final int answer = 42;
). These will be inserted inside the main Activity class at the top.
Java code to be executed in the main Activity's override of onCreate
. This will be inserted at the end of onCreate
, but before the main event loop is called. Its Bundle
argument is named savedInstanceState
.
By default, the following settings and flags have been set in onCreate
before the substitutions:
- Orientation
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
; - Window feature
Window.FEATURE_NO_TITLE
; - Audio manager setting
AudioManager.STREAM_MUSIC
; and - Window flag
WindowManager.LayoutParams.FLAG_FULLSCREEN
.
Code to override these settings and flags should therefore be located in ANDROID_java_oncreate
. For instance, to enable keeping the screen on, call getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
in this file.
Java code to be executed in the main Activity's override of onPause
. This will be inserted before the call to trigger an EVENT_SUSPEND
event in Scheme.
Java code to be executed in the main Activity's override of onResume
. This will be inserted before the call to trigger an EVENT_RESUME
event in Scheme.
Java code to be executed in the main Activity's override of onDestroy
. This will be inserted before the call to trigger the EVENT_CLOSE
and EVENT_TERMINATE
events in Scheme.
Java code to be executed in the main Activity's override of onSensorChanged
.
Additional Java code that will be inserted in the main Activity class. Some common uses of this file include:
- Overriding other methods of Activity (that are not
onCreate
,onDestroy
,onStop
,onPause
,onResume
,onAccuracyChanged
, oronSensorChanged
); - Declaring
native
methods implemented using JNI, commonly located inANDROID_c_additions
; etc.
Additional java code that will be inserted outside the main Activity class. Some common uses of this file include:
- Declaring
native
methods implemented using JNI, commonly located inANDROID_c_additions
; - Implementing additional methods that may be called using JNI from
ANDROID_c_additions
; etc.
XML that will be inserted into the app's AndroidManifest.xml
file within the <manifest>
tag. This file will usually contain <uses-*>
tags, especially <uses-permission>
; see here for a full list of allowed subtags (excluding <application>
).
XML that will be inserted into the app's AndroidManifest.xml
file within the <activity>
tag. This file should only contain <intent-filter>
tags.
XML that will be inserted into the app's AndroidManifest.xml
file within the <application>
tag. This file should only contain <receiver>
tags.
XML that will be inserted into the app's AndroidManifest.xml
file within the <application>
tag. This file should only contain <service>
tags.
XML that will be inserted into the app's AndroidManifest.xml
file as attributes of the <activity>
tag. See here for a full list of allowed attributes.
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip