Skip to content

Commit de18244

Browse files
committed
ANDROID: ioio library module now built from smallbasic.plugins repo
1 parent bbd7a71 commit de18244

File tree

8 files changed

+43
-81
lines changed

8 files changed

+43
-81
lines changed

src/platform/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ android {
2828
buildTypes {
2929
release {
3030
ndk {
31-
debugSymbolLevel = 'FULL'
31+
debugSymbolLevel = 'FULL'
3232
}
3333
shrinkResources true
3434
minifyEnabled true
35-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
3636
signingConfig signingConfigs.release
3737
}
3838
}
@@ -54,6 +54,6 @@ android {
5454

5555
dependencies {
5656
implementation 'androidx.core:core:1.12.0'
57-
implementation project(':ioio')
57+
//implementation files('libs/ioio-release.aar')
5858
testImplementation 'junit:junit:4.13.2'
5959
}
Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,8 @@
1-
# To enable ProGuard in your project, edit project.properties
2-
# to define the proguard.config property as described in that file.
31
#
4-
# Add project specific ProGuard rules here.
5-
# By default, the flags in this file are appended to flags specified
6-
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7-
# You can edit the include path and order by changing the ProGuard
8-
# include property in project.properties.
2+
# For more details, see https://developer.android.com/build/shrink-code
93
#
10-
# For more details, see
11-
# http://developer.android.com/guide/developing/tools/proguard.html
12-
13-
# Add any project specific keep options here:
14-
15-
# If your project uses WebView with JS, uncomment the following
16-
# and specify the fully qualified class name to the JavaScript interface
17-
# class:
18-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19-
# public *;
20-
#}
21-
22-
-keep public class * {
23-
public *;
24-
}
25-
26-
-keepclasseswithmembernames class * {
27-
native <methods>;
28-
}
294

5+
-keep public class * { public *; }
6+
-keepclasseswithmembernames class * { native <methods>; }
307
-printmapping build/outputs/mapping/release/mapping.txt
318
-keepattributes LineNumberTable,SourceFile

src/platform/android/app/src/main/assets/main.bas

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ sub do_setup()
165165

166166
color colText, colBkGnd
167167
cls
168-
at 0, char_h * 6.5
169-
print "Envy Code R:"
170-
print " http://damieng.com/envy-code-r"
168+
at 0, char_h * 6
171169
print "Inconsolata:"
172170
print " Copyright 2006 The Inconsolata Project"
173171
print " http://scripts.sil.org/OFL"
172+
print "Envy Code R:"
173+
print " http://damieng.com/envy-code-r"
174174
print "Ubuntu:"
175175
print " https://ubuntu.com/legal/font-licence"
176176
at 0, char_h * 1
@@ -179,7 +179,7 @@ sub do_setup()
179179
local x = char_w / 2
180180
local y = char_h / 2
181181
rect x, y, w * 2, h + y * 2.5
182-
dim frm.inputs(3)
182+
dim frm.inputs(4)
183183
frm.inputs(0).type = "label"
184184
frm.inputs(0).label = "Select display font:"
185185
frm.inputs(0).x = char_w
@@ -195,14 +195,25 @@ sub do_setup()
195195
frm.inputs(2).color = colText
196196
frm.inputs(2).label = "OK"
197197
frm.inputs(2).value = "OK"
198-
frm.inputs(2).x = -(char_w * 8)
199-
frm.inputs(2).y = -(char_h)
198+
frm.inputs(2).x = -(char_w * 2.5)
199+
frm.inputs(2).y = -char_h
200+
frm.inputs(3).type = "button"
201+
frm.inputs(3).backgroundColor = colBkGnd
202+
frm.inputs(3).color = colText
203+
frm.inputs(3).label = "Cancel"
204+
frm.inputs(3).value = "cancel"
205+
frm.inputs(3).x = -(char_w * .75)
206+
200207
frm = form(frm)
201208
while 1
202209
frm.doEvents()
203-
if (frm.value == "OK") then exit loop
210+
if (frm.value == "OK") then
211+
exit loop
212+
elseif (frm.value == "cancel") then
213+
goto exitFunc
214+
endif
204215
wend
205-
env("fontId=" + frm.inputs(1).selectedIndex)
216+
local fontId = frm.inputs(1).selectedIndex
206217

207218
cls
208219
at 0, char_h * 1
@@ -213,9 +224,13 @@ sub do_setup()
213224
frm = form(frm)
214225
while 1
215226
frm.doEvents()
216-
if (frm.value == "OK") then exit loop
227+
if (frm.value == "OK") then
228+
exit loop
229+
elseif (frm.value == "cancel") then
230+
goto exitFunc
231+
endif
217232
wend
218-
env("loadModules=" + frm.inputs(1).selectedIndex)
233+
local loadModules = frm.inputs(1).selectedIndex
219234

220235
color colText, colBkGnd
221236
cls
@@ -242,26 +257,35 @@ sub do_setup()
242257
env("serverToken=" + token)
243258
endif
244259

260+
env("fontId=" + fontId)
261+
env("loadModules=" + loadModules)
262+
245263
local msg = "You must restart SmallBASIC for this change to take effect."
246264
wnd.alert(msg, "Restart required")
265+
266+
label exitFunc
247267
clear_screen()
248268
end
249269

250270
sub server_info()
251271
local serverSocket = env("serverSocket")
252272
local ipAddr = env("IP_ADDR")
253273
local loadModules = env("loadModules")
274+
local hasText = false
254275

255276
if (len(serverSocket) > 0 && int(serverSocket) > 1023 && int(serverSocket) < 65536 && len(ipAddr)) then
256277
serverSocket = ipAddr + ":" + serverSocket
257278
print boldOff + "Web Service: " + boldOn + serverSocket
258279
print boldOff + "Access token: " + boldOn + env("serverToken")
259280
print boldOff;
281+
hasText = true
260282
fi
261283
if (int(loadModules) == 1) then
262284
print "Extension modules: " + boldOn + "Enabled"
263285
print boldOff;
286+
hasText = true
264287
endif
288+
if (hasText) then print
265289
end
266290

267291
func fileCmpFunc0(l, r)
@@ -702,9 +726,9 @@ sub main
702726
frm.inputs << bn_files
703727
frm.inputs << bn_online
704728
frm.inputs << bn_scratch
705-
if (!is_sdl) then
729+
' if (!is_sdl) then
706730
frm.inputs << bn_setup
707-
endif
731+
' endif
708732
frm.inputs << bn_about
709733
listFiles frm, path, sortDir, basList
710734
frm = form(frm)

src/platform/android/app/src/main/java/net/sourceforge/smallbasic/MainActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ public boolean loadModules() {
363363
try {
364364
System.loadLibrary("ioio");
365365
Class.forName("net.sourceforge.smallbasic.ioio.IOIOLoader").newInstance();
366+
Log.i(TAG, "loadModules - success");
366367
result = true;
367368
} catch (Exception | UnsatisfiedLinkError e) {
368369
Log.i(TAG, "loadModules", e);

src/platform/android/ioio/ioio.mk

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/platform/android/ioio/src/main/cpp/ioio.cpp

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/platform/android/ioio/src/main/java/net/sourceforge/smallbasic/ioio/IOIOLoader.java

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
include ':app'
2-
include ':ioio'

0 commit comments

Comments
 (0)