-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathandroid.html
More file actions
438 lines (434 loc) · 22.7 KB
/
Copy pathandroid.html
File metadata and controls
438 lines (434 loc) · 22.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SmallBASIC | android</title>
<meta name="description" content="SmallBASIC | One more basic">
<link rel="canonical" href="/android.html">
<link rel="keywords" href="android">
<link rel="stylesheet" href="/css/style.css">
<link rel="icon" type="image/png" href="/images/sb-desktop-32x32.png">
<script src="/clipboard.js"></script>
</head>
<body>
<button onclick="topFunction()" id="BackToTopBtn" title="Go to top">⯅</button>
<script src="/backtotop.js"></script>
<div class="wrapAll clearfix">
<nav class="navigation">
<div class="logo">
<a href="/"><img src='/images/sb-logo.png?v=2' alt="logo"></a>
</div>
<div class="navlinks">
<a href="/pages/download.html">Download</a>
<a href="/pages/news.html">News</a>
<a href="/pages/community.html">Community</a>
<a class='active' href="/pages/articles.html">Resources</a>
<a href="/pages/reference.html">Language Reference</a>
<a href="/pages/guide.html">SmallBASIC Manual</a>
</div>
</nav>
<div class="mainsection">
<div class="tabs clearfix">
<div class="tabsRight">
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/android.markdown">Edit</a>
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/android.markdown">History</a>
</div>
</div>
<div class="article">
<h1 id="android">Android</h1>
<blockquote>
<p>SmallBASIC for Android guide</p>
</blockquote>
<p>The Android version of SmallBASIC comes with a built-in Integrated
Development Environment (IDE), you can write programs on your
Android-powered tablet or mobile phone and run them instantly.</p>
<h2 id="getting-started">Getting started</h2>
<p>In the video below the basic steps of creating a file, opening it in
the internal editor and executing the program are shown.</p>
<div class="video-container">
<iframe width="1160" height="653" src="https://www.youtube.com/embed/2fW7usYY_CA" title="SmallBASIC "Hello World"" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
</iframe>
</div>
<p>Please note, that at the first start of the Android version of
SmallBASIC, the editor is turned off. A tap on a program name will start
it immediately. If you want to edit the file, please turn on the editor
by tapping on the three dots in the lower right corner and choosing the
entry <code>Editor [OFF]</code> to enable the editor.</p>
<h2 id="step-by-step-guide">Step-by-Step Guide</h2>
<p><img src="/images/android_menu1.png"
title="System Menu button" /></p>
<p>The items displayed depend on whether the file browser, code editor
or a running program is active.</p>
<p><img src="/images/android_menu2.png" title="System Menu" /></p>
<p>When the file browser is active you should see an “Editor” item
followed by either [ON] or [OFF]. If it shows “OFF” then press the item
to switch it to “ON”.</p>
<p>Before you start editing a program you should navigate to the
“SmallBASIC” folder. You can get there by pressing “[Go Up]” until you
hit the root level “/”. You should then see an entry for “SmallBASIC”.
If there’s not enough room to display the entire text it might appear as
something like “storage/emulated/0/SmallBAS~”. You may need to accept a
permission request to allow access to this folder when you first launch
SmallBASIC for the first time. Also make sure you <strong>do
not</strong> select the internal “net.sourceforge.smallbasic” folder
since this could be overwritten in a future SmallBASIC update.</p>
<p><img src="/images/android_navigate.png" title="System Menu" /></p>
<p>Now press the “[File]” link in the top left corner of the screen.
This will take you to the file manager. From here you can enter a file
name then press “[New]” to create it. Now press “[<<]” to exit the
file manager.</p>
<p><img src="/images/android_create_file.png" title="System Menu" /></p>
<p>Your new file should be listed in the file browser. Press the file
name link. You should finally see the program editor. If the keypad does
not appear, press the system menu button and select “Show Keypad”. For
best results you may need to install a separate keyboard.
“AnySoftKeyboard”, “Hacker’s Key” and “GBoard” all seem to work
well.</p>
<p>Start typing out your program. When you are ready to test your
program, press the system menu button then select “Run”.</p>
<p>In the help screen, the “>” characters on the left are buttons to
expand (or contract) the help item contents. In the editor, the line
number display also functions as a scrollbar. If you want to write a
quick experimental program you can use the “[Scratch]” option to bypass
the above file name setup steps.</p>
<p><img src="/images/android_scroll.png" title="System Menu" /></p>
<p>All of the above UI elements are written in SmallBASIC, see <a
href="https://github.com/smallbasic/SmallBASIC/blob/master/src/platform/android/app/src/main/assets/main.bas">main.bas</a></p>
<h2 id="using-location-sensor-and-text-to-speech-services.">Using
Location, Sensor and Text to speech services.</h2>
<p>To use the following services, your program must start with the
following two lines:</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="pp">option</span> predef load modules</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="pp">import</span> android</span></code></pre></div>
<p>The first line tell SmallBASIC to dynamically load runtime modules.
The second line imports the android module.</p>
<h2 id="location">Location</h2>
<p>GPS_ON</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>android.gps_on()</span></code></pre></div>
<p>Instructs the system to commence recording location information.
Note: This relies on the device location services being enabled by the
user.</p>
<p>GPS_OFF</p>
<div class="sourceCode" id="cb3"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>android.gps_off()</span></code></pre></div>
<p>Turns off recording of location information.</p>
<p>LOCATION</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>l = android.location()</span></code></pre></div>
<p>Returns a MAP variable holding the following details:</p>
<ul>
<li>latitude - the latitude, in degrees.</li>
<li>longitude - the longitude, in degrees.</li>
<li>speed - the speed if it is available, in meters/second over
ground.</li>
<li>accuracy - the estimated accuracy of this location, in meters.</li>
<li>altitude - altitude if available, in meters</li>
<li>bearing - the bearing, in degrees</li>
<li>provider - whether data obtained from GPS or network</li>
</ul>
<p>Note: the location data is updated internally at 1 second
intervals.</p>
<p>For more details, see: <a
href="https://developer.android.com/reference/android/location/Location.html"
class="uri">https://developer.android.com/reference/android/location/Location.html</a></p>
<h2 id="sensor">Sensor</h2>
<p>SENSOR_ON</p>
<div class="sourceCode" id="cb5"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> SensorAccelerometer = <span class="dv">0</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> SensorMagneticField = <span class="dv">1</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> SensorGyroscope = <span class="dv">2</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> SensorLight = <span class="dv">3</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> SensorProximity = <span class="dv">4</span></span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>android.sensor_on(n)</span></code></pre></div>
<p>Enables the given sensor (currently only one may be enabled at a
time). Throws an exception if the given sensor is not available (for
example, not all devices have a gyroscope).</p>
<p>SENSOR_OFF</p>
<div class="sourceCode" id="cb6"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>android.sensor_off()</span></code></pre></div>
<p>Disables any active sensor.</p>
<p>SENSOR</p>
<div class="sourceCode" id="cb7"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>s = android.sensor()</span></code></pre></div>
<p>Returns a MAP variable holding sensor details. x, y, z - The spatial
position light - (SensorLight) distance - (SensorProximity)</p>
<p>For more details, see:</p>
<ul>
<li><a href="http://i.stack.imgur.com/skBui.jpg"
class="uri">http://i.stack.imgur.com/skBui.jpg</a></li>
<li><a
href="https://developer.android.com/reference/android/hardware/SensorEvent.html"
class="uri">https://developer.android.com/reference/android/hardware/SensorEvent.html</a></li>
</ul>
<h2 id="text-to-speech">Text to speech</h2>
<p>Output data as spoken text.</p>
<p>Notes: - The text to speech module takes a moment to initialise. This
is performed the first time you call SPEAK. - You may want to turn off
the system setting to send TTS usage statistics to google before using
this feature.</p>
<p>TTS_PITCH</p>
<div class="sourceCode" id="cb8"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>android.tts_pitch(n)</span></code></pre></div>
<p>Sets the voice pitch (default is 1.0).</p>
<p>TTS_RATE</p>
<div class="sourceCode" id="cb9"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>android.tts_rate(n)</span></code></pre></div>
<p>Sets the rate of speaking (default is 1.0)</p>
<p>TTS_LANG</p>
<div class="sourceCode" id="cb10"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>android.tts_lang(s)</span></code></pre></div>
<p>Sets the locale, for example “en”, “de”, “fr” for English, German,
France. May cause the system to download the language codec if not
already installed.</p>
<p>TTS_OFF</p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>android.tts_off()</span></code></pre></div>
<p>Turns off text to speech output.</p>
<p>SPEAK</p>
<div class="sourceCode" id="cb12"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>android.speak(text)</span></code></pre></div>
<p>Performs text to speech (default is ENGLISH).</p>
<h2 id="https-web-request">HTTPS Web request</h2>
<div class="sourceCode" id="cb13"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>android.request(url, [postData, authToken])</span></code></pre></div>
<ul>
<li><code>url</code>: The URL endpoint for the request.</li>
<li><code>data</code> (optional): Data to send in the request body. If
provided, the request method is <code>POST</code> with
<code>Content-Type: application/json</code>. If omitted, the request
method defaults to <code>GET</code>.</li>
<li><code>token</code>: (optional): Bearer authentication token for a
<code>POST</code> request.</li>
</ul>
<p>The <code>REQUEST</code> function enables making HTTPS requests
(either <code>POST</code> or <code>GET</code> methods), supporting
secure connections that are not possible with the <code>OPEN</code>
command.</p>
<p><strong>Note</strong>: For desktop versions, you can utilize the
<code>RUN</code> command with <code>curl</code> for similar
functionality.</p>
<pre><code>import android
const endpoint = "https://llamafile/v1/chat/completions"
const apiKey = "no-key"
func request(content)
local post_data
dim post_data.messages(0 to 1)
post_data.model = "gpt-3.5-turbo"
post_data.messages[0].role = "system"
post_data.messages[0].content = "You are a helpful assistant"
post_data.messages[1].role = "user"
post_data.messages[1].content = content
return array(android.request(endpoint, post_data, apiKey))
end
while 1
input "Question: ", prompt
response = request(prompt)
print response.choices[0].message.content
wend</code></pre>
<p>The code snippet demonstrates how to use REQUEST to interact with a
specified endpoint, providing necessary data and token for
authentication.</p>
<h1 id="iot-device-communication">IoT Device Communication</h1>
<h2 id="usb-serial-support">USB Serial Support</h2>
<p>These functions allow you to connect, send, and receive data over a
USB serial connection.</p>
<h4 id="open-a-usb-serial-connection">🔌 Open a USB Serial
Connection</h4>
<div class="sourceCode" id="cb15"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> usb = android.openUsbSerial(vendorId, [baud], [timeout])</span></code></pre></div>
<p>Parameters:</p>
<ul>
<li><code>vendorId</code>: (required) The USB device’s Vendor ID.</li>
<li><code>baud</code>: (optional) The baud rate for communication
(default: 19200).</li>
<li><code>timeout</code>: (optional) imeout in milliseconds for receive
operations (default: 5000 ms).</li>
</ul>
<p>Returns:</p>
<ul>
<li>A USB serial object to be used with other USB functions.</li>
</ul>
<h4 id="close-the-usb-connection">❌ Close the USB Connection</h4>
<div class="sourceCode" id="cb16"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>usb.<span class="fu">close</span>()</span></code></pre></div>
<p>Closes the current USB connection. Always call this when you’re done
using the device.</p>
<h4 id="get-device-description">📋 Get Device Description</h4>
<div class="sourceCode" id="cb17"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>usb.description()</span></code></pre></div>
<p>Returns a string with details about the connected USB device, such as
product name or manufacturer info (if available).</p>
<h4 id="receive-data">📥 Receive Data</h4>
<div class="sourceCode" id="cb18"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a>dat = usb.receive()</span></code></pre></div>
<p>Reads incoming data from the connected USB device.</p>
<p>Returns:</p>
<p>A string containing the received data, or an empty string if no data
is received before timeout.</p>
<h4 id="send-data">📤 Send Data</h4>
<div class="sourceCode" id="cb19"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>n = usb.send(dat)</span></code></pre></div>
<p>Sends data to the connected USB device.</p>
<p>Parameters:</p>
<p>dat – The data to send as a string.</p>
<p>Returns:</p>
<p>The number of bytes successfully sent.</p>
<h4 id="example">📝 Example</h4>
<pre><code>import android
usb = android.openUsbSerial(0x16C0)
while 1
input k
n = usb.send(k);
print "sent "; n
print usb.receive()
wend</code></pre>
<h2 id="bluetooth-support">Bluetooth Support</h2>
<p>These functions allow you to connect to Bluetooth serial devices,
send and receive data, and manage the connection within your SmallBASIC
program.</p>
<h4 id="open-a-bluetooth-serial-connection">🔌 Open a Bluetooth Serial
Connection</h4>
<div class="sourceCode" id="cb21"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> bt = android.openBluetooth(deviceName)</span></code></pre></div>
<p>Parameters:</p>
<ul>
<li><code>deviceName</code>: (required) The Bluetooth device name to
connected with.</li>
</ul>
<p>Returns:</p>
<ul>
<li>A Bluetooth object to be used with other Bluetooth functions.</li>
</ul>
<h4 id="close-the-bluetooth-connection">❌ Close the Bluetooth
Connection</h4>
<div class="sourceCode" id="cb22"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a>bt.<span class="fu">close</span>()</span></code></pre></div>
<p>Closes the current Bluetooth connection.</p>
<p>Tip: Always close the connection when you’re done to free
resources.</p>
<h4 id="check-whether-the-bluetooth-connection-is-open">🔌 Check whether
the Bluetooth Connection is open</h4>
<div class="sourceCode" id="cb23"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a>cn = bt.connected()</span></code></pre></div>
<p>Returns true if the Bluetooth connection is currently open, otherwise
false.</p>
<h4 id="get-device-description-1">📋 Get Device Description</h4>
<div class="sourceCode" id="cb24"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a>bt.description()</span></code></pre></div>
<p>Returns a string with details about the Bluetooth connection
inclusing name and address (if available).</p>
<h4 id="receive-data-1">📥 Receive Data</h4>
<div class="sourceCode" id="cb25"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a>dat = bt.receive()</span></code></pre></div>
<p>Reads incoming data from the connected Bluetooth device.</p>
<p>Returns:</p>
<p>A string containing the received data, or an empty string if no data
is received before the timeout.</p>
<h4 id="send-data-1">📤 Send Data</h4>
<div class="sourceCode" id="cb26"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a>n = bt.send(dat)</span></code></pre></div>
<p>Sends data to the connected Bluetooth device.</p>
<p>Parameters:</p>
<p>dat – The data to send as a string.</p>
<p>Returns:</p>
<p>The number of bytes successfully sent.</p>
<h4 id="example-1">📝 Example</h4>
<pre><code>import android
bt = android.openBluetooth("TeensyBT")
print "opened"
print bt.description()
for i = 0 to 1000
if bt.connected() then
n= bt.send(i)
delay 10
print bt.receive(); " "; i
else
print "waiting..."
delay 3000
endif
next</code></pre>
<p>This example opens a connection to a device named “TeensyBT”, then
continuously sends and receives data in a loop.</p>
<h2 id="how-to-edit-and-run-a-program">How to edit and run a
program</h2>
<h3 id="internal-editor">Internal editor:</h3>
<ul>
<li>Display the menu, then click Editor [ON]</li>
<li>Tap a file name in the browser.</li>
</ul>
<h3 id="desktop-smallbasic">Desktop SmallBASIC</h3>
<ul>
<li>Enter the port number in the setup screen.</li>
<li>Connect your desktop machine and your mobile device to the same wifi
network.</li>
<li>Launch desktop SmallBASIC.</li>
<li>Right click and select “Editor [ON]”.</li>
<li>Navigate to the .bas file then click the link to begin editing.</li>
<li>Press F3, then enter the address shown in the android about screen
(IP:PORT).</li>
<li>Enter the security code, then press enter.</li>
<li>Once the settings are successful, you can press F4 to upload your
program again.</li>
</ul>
<h3 id="file-browser">File browser:</h3>
<ul>
<li>Write and debug the program with desktop SmallBASIC.</li>
<li>Copy the .bas file to your SDCard.</li>
<li>Launch SmallBASIC, then navigate to the file in the built-in file
browser, then tap the link to run.</li>
<li>or, navigate to the file in the system file browser, then tap the
link to start SmallBASIC and run the program.</li>
</ul>
<h3 id="separate-editor-on-device">Separate editor on device:</h3>
<ul>
<li>Write your SmallBASIC program in a separate editor on your
device.</li>
<li>Task switch to SmallBASIC, then run the program using the built-in
file browser.</li>
</ul>
<h3 id="web-service">Web Service:</h3>
<ul>
<li>Enter the port number in the setup screen.</li>
<li>Connect your desktop machine and your mobile device to the same wifi
network.</li>
<li>Launch a desktop browser then enter http://:</li>
<li>A simple web page is displayed. Enter your SmallBASIC program then
click run.</li>
</ul>
<h3 id="qrcode">QRcode:</h3>
<ul>
<li>Write and debug the program with desktop SmallBASIC.</li>
<li>Convert the program to an QRCode image.</li>
<li>Scan the QRCode in the separate decoder program.</li>
<li>Click okay to launch SmallBASIC and the encoded program.</li>
</ul>
<p>Note: the tool to convert source code to QR codes is here: <a
href="https://github.com/smallbasic/SmallBASIC/tree/master/web/qrcode">qrcode</a></p>
<h2 id="playing-music">Playing music</h2>
<p>PLAY(“file:///sdcard/VoiceRecorder/recordings/hello.mp3”)</p>
<p>Use the PLAY command with the prefix “file://” to play an audio
track. For supported formats, see:</p>
<p><a
href="https://developer.android.com/guide/appendix/media-formats.html"
class="uri">https://developer.android.com/guide/appendix/media-formats.html</a></p>
<h2 id="release-history">Release history</h2>
<p><a href="android_changelog.html">Android changelog</a></p>
<h2 id="privacy-policy">Privacy Policy <a
href="#privacy-policy"></a></h2>
<p><a href="privacy.html">Privacy Policy</a></p>
</div>
<div class="pagefooter">
This page was last edited on Sun, 20 Apr 2025 10:37:03 +0930
|
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
processed with
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.1.12.1</a>
</div>
</div>
</div>
</body>
</html>