File tree Expand file tree Collapse file tree 10 files changed +76
-10
lines changed
src/main/java/net/sourceforge/smallbasic
java/net/sourceforge/smallbasic/ioio Expand file tree Collapse file tree 10 files changed +76
-10
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ android {
77 // can override some attributes in main/AndroidManifest.xml
88 defaultConfig {
99 applicationId ' net.sourceforge.smallbasic'
10- minSdkVersion 16
10+ minSdkVersion 19
1111 targetSdkVersion 34
1212 versionCode 59
1313 versionName ' 12.26'
@@ -26,16 +26,10 @@ android {
2626 }
2727
2828 buildTypes {
29- debug {
30- buildConfigField " boolean" , " DEBUG_VIEW" , " true"
31- buildConfigField " java.util.Date" , " BUILD_TIME" , " new java.util.Date(" + System . currentTimeMillis() + " L)"
32- }
3329 release {
3430 ndk {
3531 debugSymbolLevel = ' FULL'
3632 }
37- buildConfigField " boolean" , " DEBUG_VIEW" , " false"
38- buildConfigField " java.util.Date" , " BUILD_TIME" , " new java.util.Date(" + System . currentTimeMillis() + " L)"
3933 shrinkResources true
4034 minifyEnabled true
4135 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
@@ -60,5 +54,6 @@ android {
6054
6155dependencies {
6256 implementation ' androidx.core:core:1.12.0'
57+ implementation project(' :ioio' )
6358 testImplementation ' junit:junit:4.13.2'
6459}
Original file line number Diff line number Diff line change 4242import androidx .core .content .ContextCompat ;
4343import androidx .core .content .FileProvider ;
4444
45+ import net .sourceforge .smallbasic .ioio .IOIOUtility ;
46+
4547import java .io .BufferedReader ;
4648import java .io .BufferedWriter ;
4749import java .io .ByteArrayInputStream ;
@@ -357,6 +359,20 @@ public int getWindowHeight() {
357359 return rect .height ();
358360 }
359361
362+ public boolean loadModules () {
363+ Log .i (TAG , "loadModules" );
364+ boolean result ;
365+ try {
366+ System .loadLibrary ("ioio" );
367+ IOIOUtility .init ();
368+ result = true ;
369+ } catch (SecurityException | UnsatisfiedLinkError e ) {
370+ Log .i (TAG , "loadModules" , e );
371+ result = false ;
372+ }
373+ return result ;
374+ }
375+
360376 @ Override
361377 public void onGlobalLayout () {
362378 super .onGlobalLayout ();
Original file line number Diff line number Diff line change 99
1010# Specifies the JVM arguments used for the daemon process.
1111# The setting is particularly useful for tweaking memory settings.
12- android.defaults.buildfeatures.buildconfig =true
1312android.enableJetifier =true
1413android.nonFinalResIds =false
1514android.nonTransitiveRClass =false
Original file line number Diff line number Diff line change 1+ # SmallBASIC
2+ # Copyright(C) 2024 Chris Warren-Smith.
3+ #
4+ # This program is distributed under the terms of the GPL v2.0 or later
5+ # Download the GNU Public License (GPL) from www.gnu.org
6+ #
7+
8+ JNI_PATH := $(call my-dir)
9+ SB_HOME := $(JNI_PATH ) /../../../..
10+
11+ include $(call all-subdir-makefiles)
12+ LOCAL_PATH := $(JNI_PATH )
13+
14+ include $(CLEAR_VARS )
15+ LOCAL_MODULE := ioio
16+ LOCAL_CFLAGS := -DHAVE_CONFIG_H=1 -Wno-unknown-pragmas
17+ LOCAL_C_INCLUDES := $(SB_HOME ) $(SB_HOME ) /src
18+ LOCAL_SRC_FILES := src/main/cpp/ioio.cpp
19+ LOCAL_LDLIBS := -llog -landroid
20+ include $(BUILD_SHARED_LIBRARY )
21+
Original file line number Diff line number Diff line change 1+ #include < jni.h>
2+ #include < android/log.h>
3+
4+ JNIEnv *g_env;
5+
6+ extern " C" JNIEXPORT void JNICALL
7+ Java_net_sourceforge_smallbasic_ioio_IOIOUtility_init (JNIEnv *env, jclass clazz) {
8+ __android_log_print (ANDROID_LOG_INFO, " smallbasic" , " init entered" );
9+ g_env = env;
10+ }
Original file line number Diff line number Diff line change 1+ package net .sourceforge .smallbasic .ioio ;
2+
3+ public class IOIOUtility {
4+ private IOIOUtility () {
5+ // no access
6+ }
7+
8+ public static native void init ();
9+
10+ }
Original file line number Diff line number Diff line change 3535#define SERVER_TOKEN_KEY " serverToken"
3636#define MUTE_AUDIO_KEY " muteAudio"
3737#define THEME_KEY " theme"
38+ #define LOAD_MODULES_KEY " loadModules"
3839#define OPT_IDE_KEY " optIde"
3940#define GBOARD_KEY_QUESTION 274
4041#define EVENT_TYPE_EXIT 100
@@ -557,7 +558,14 @@ void Runtime::loadConfig() {
557558 loadEnvConfig (settings, SERVER_SOCKET_KEY);
558559 loadEnvConfig (settings, SERVER_TOKEN_KEY);
559560 loadEnvConfig (settings, FONT_ID_KEY);
561+
562+ s = settings.get (LOAD_MODULES_KEY);
563+ if (s && s->toInteger () == 1 ) {
564+ trace (" calling loadModules" );
565+ getBoolean (" loadModules" );
566+ }
560567 }
568+
561569}
562570
563571bool Runtime::loadSettings (Properties<String *> &settings) {
Original file line number Diff line number Diff line change 11include ' :app'
2+ include ' :ioio'
Original file line number Diff line number Diff line change @@ -29,5 +29,10 @@ module.exports = {
2929 ] ,
3030 "rules" : {
3131 "react/prop-types" : "off"
32+ } ,
33+ "settings" : {
34+ "react" : {
35+ "version" : "detect"
36+ }
3237 }
3338}
Original file line number Diff line number Diff line change 11{
22 "name" : " webui" ,
3- "version" : " 1.0 .0" ,
3+ "version" : " 1.1 .0" ,
44 "private" : true ,
5+ "type" : " module" ,
56 "dependencies" : {
67 "@emotion/react" : " ^11.11.4" ,
78 "@emotion/styled" : " ^11.11.0" ,
2223 },
2324 "scripts" : {
2425 "start" : " vite --host" ,
25- "build" : " GENERATE_SOURCEMAP=false vite && rm ../app/src/main/assets/webui/static/js/main.* && cp -R build/* ../app/src/main/assets/webui/" ,
26+ "build" : " GENERATE_SOURCEMAP=false vite build && rm ../app/src/main/assets/webui/static/js/main.* && cp -R build/* ../app/src/main/assets/webui/" ,
2627 "update" : " npm update && ncu -u && npm install && npm audit fix"
2728 },
2829 "eslintConfig" : {
You can’t perform that action at this time.
0 commit comments