Quickstart-Android.html 37.9 KB
Newer Older
kollo's avatar
kollo committed
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en"><head>
		<meta name="sfhaproxy" content="NOFOOTER,NOHEADER">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="Content-Style-Type" content="text/css">
		<meta name="generator" content="MediaWiki 1.15.1">
		<meta name="robots" content="noindex,follow">
		<meta name="keywords" content="Android,Ballerburg,Compatibility,TTconsole,Vt100emu.30c,Bytecode,ROWS,COLS,GET GEOMETRY,QUIT,END">
		<link rel="alternate" type="application/x-wiki" title="Edit" href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=Android&amp;action=edit">
		<link rel="edit" title="Edit" href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=Android&amp;action=edit">
		<link rel="shortcut icon" href="https://sourceforge.net/favicon.ico">
		<link rel="search" type="application/opensearchdescription+xml" href="https://sourceforge.net/apps/mediawiki/x11-basic/opensearch_desc.php" title="x11-basic (en)">
		<link rel="alternate" type="application/rss+xml" title="x11-basic RSS Feed" href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=Special:RecentChanges&amp;feed=rss">
		<link rel="alternate" type="application/atom+xml" title="x11-basic Atom Feed" href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=Special:RecentChanges&amp;feed=atom">
		<title>SourceForge.net: Android - x11-basic</title>
		<link rel="stylesheet" href="AQ_files/commonPrint.css" type="text/css">
		<link rel="stylesheet" href="AQ_files/index_004.css" type="text/css">
		<link rel="stylesheet" href="AQ_files/index.css" type="text/css">
		<link rel="stylesheet" href="AQ_files/index_003.css" type="text/css">
		<link rel="stylesheet" href="AQ_files/index_002.css" type="text/css">
		<!--[if lt IE 7]><script type="text/javascript" src="/apps/mediawiki/x11-basic/skins/common/IEFixes.js?207"></script>
		<meta http-equiv="imagetoolbar" content="no" /><![endif]-->

		<script type="text/javascript">/*<![CDATA[*/
		var skin = "sourceforge";
		var stylepath = "/apps/mediawiki/x11-basic/skins";
		var wgArticlePath = "/apps/mediawiki/x11-basic/index.php?title=$1";
		var wgScriptPath = "/apps/mediawiki/x11-basic";
		var wgScript = "/apps/mediawiki/x11-basic/index.php";
		var wgVariantArticlePath = false;
		var wgActionPaths = {};
		var wgServer = "https://sourceforge.net";
		var wgCanonicalNamespace = "";
		var wgCanonicalSpecialPageName = false;
		var wgNamespaceNumber = 0;
		var wgPageName = "Android";
		var wgTitle = "Android";
		var wgAction = "view";
		var wgArticleId = "33";
		var wgIsArticle = true;
		var wgUserName = "Kollo";
		var wgUserGroups = ["admin", "editor", "*", "user", "autoconfirmed"];
		var wgUserLanguage = "en";
		var wgContentLanguage = "en";
		var wgBreakFrames = false;
		var wgCurRevisionId = 395;
		var wgVersion = "1.15.1";
		var wgEnableAPI = true;
		var wgEnableWriteAPI = true;
		var wgSeparatorTransformTable = ["", ""];
		var wgDigitTransformTable = ["", ""];
		var wgRestrictionEdit = [];
		var wgRestrictionMove = [];
		var wgAjaxWatch = {"watchMsg": "Watch", "unwatchMsg": "Unwatch", "watchingMsg": "Watching…", "unwatchingMsg": "Unwatching…"};
		/*]]>*/</script>

		<script type="text/javascript" src="AQ_files/wikibits.js"><!-- wikibits js --></script><style type="text/css">@import "/apps/mediawiki/x11-basic/skins/sourceforge/FF2Fixes.css";</style>
		<!-- Head Scripts -->
		<script type="text/javascript" src="AQ_files/ajax.js"></script>
		<script type="text/javascript" src="AQ_files/ajaxwatch.js"></script>
		<script type="text/javascript" src="AQ_files/index.php"><!-- site js --></script>
	

</head>
<body class="mediawiki ltr ns-0 ns-subject page-Android skin-sourceforge">

    

	<div id="globalWrapper">
		<div id="column-content">
	<div id="content">
		<a name="top" id="top"></a>
				<h1 id="firstHeading" class="firstHeading">Android</h1>
		<div id="bodyContent">
			<h3 id="siteSub">From x11-basic</h3>
			<div id="contentSub"></div>
77
<div id="jump-to-nav">Jump to: <a href="#column-one">navigation</a>, <a href="#searchInput">search</a></div>			<!-- start content -->
kollo's avatar
kollo committed
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
			<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-Screenshot-1.png" class="image" title="Start screen of the Android User Interface of X11-Basic"><img alt="" src="AQ_files/180px-Android-Screenshot-1.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-Screenshot-1.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>Start screen of the Android User Interface of X11-Basic</div></div></div>
<p><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:X11-Basic-Android-Logo.png" class="image" title="X11-Basic-Android-Logo.png"><img alt="" src="AQ_files/128px-X11-Basic-Android-Logo.png" border="0" height="128" width="128"></a>
<a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:X11-Basic-Android-QR.png" class="image" title="X11-Basic-Android-QR.png"><img alt="" src="AQ_files/X11-Basic-Android-QR.png" border="0" height="128" width="128"></a>
</p>
<table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
<ul>
<li class="toclevel-1"><a href="#The_Android_version_of_X11-Basic"><span class="tocnumber">1</span> <span class="toctext">The Android version of X11-Basic</span></a></li>
<li class="toclevel-1"><a href="#Usage"><span class="tocnumber">2</span> <span class="toctext">Usage</span></a>
<ul>
<li class="toclevel-2"><a href="#Editing_a_program"><span class="tocnumber">2.1</span> <span class="toctext">Editing a program</span></a></li>
<li class="toclevel-2"><a href="#Installing_a_text_editor"><span class="tocnumber">2.2</span> <span class="toctext">Installing a text editor</span></a></li>
<li class="toclevel-2"><a href="#LOAD_file_select_functions"><span class="tocnumber">2.3</span> <span class="toctext">LOAD file select functions</span></a></li>
<li class="toclevel-2"><a href="#Desktop_shortcuts"><span class="tocnumber">2.4</span> <span class="toctext">Desktop shortcuts</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Configuring_X11-Basic"><span class="tocnumber">3</span> <span class="toctext">Configuring X11-Basic</span></a></li>
<li class="toclevel-1"><a href="#Sensors"><span class="tocnumber">4</span> <span class="toctext">Sensors</span></a></li>
<li class="toclevel-1"><a href="#GPS_Service"><span class="tocnumber">5</span> <span class="toctext">GPS Service</span></a></li>
<li class="toclevel-1"><a href="#Sound"><span class="tocnumber">6</span> <span class="toctext">Sound</span></a></li>
<li class="toclevel-1"><a href="#Text-Console"><span class="tocnumber">7</span> <span class="toctext">Text-Console</span></a></li>
<li class="toclevel-1"><a href="#Shell_access"><span class="tocnumber">8</span> <span class="toctext">Shell access</span></a></li>
<li class="toclevel-1"><a href="#Benchmarking"><span class="tocnumber">9</span> <span class="toctext">Benchmarking</span></a></li>
<li class="toclevel-1"><a href="#Internet_connections"><span class="tocnumber">10</span> <span class="toctext">Internet connections</span></a></li>
<li class="toclevel-1"><a href="#Getting_Online_Help_on_syntax"><span class="tocnumber">11</span> <span class="toctext">Getting Online Help on syntax</span></a></li>
<li class="toclevel-1"><a href="#Examples_of_working_programs"><span class="tocnumber">12</span> <span class="toctext">Examples of working programs</span></a>
<ul>
<li class="toclevel-2"><a href="#Updates_of_example_programs"><span class="tocnumber">12.1</span> <span class="toctext">Updates of example programs</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Bugs"><span class="tocnumber">13</span> <span class="toctext">Bugs</span></a></li>
</ul>
</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a name="The_Android_version_of_X11-Basic" id="The_Android_version_of_X11-Basic"></a><h2> <span class="mw-headline">The Android version of X11-Basic</span></h2>
<p>The Android version of X11-Basic comes as a regular app and can be 
downloaded from the Android Market. In contrast to the other versions of
 X11-Basic, the interpreter and virtal machine is embedded in a little 
IDE which allows the user to load, run, edit and compile the programs. 
Also a text console needed to be added, which handles the stdout. The 
stdin was implemented to take the keyboard actions of the device.
</p><p>The idea is to have a simple user interface after startup, to 
allow for single line commands to be entered and excecuted, as well as 
119 120 121
to load and run .bas programs. Also the excecution of the faster bytecode (ending .b) should be possible. 
</p><p>Your programs have to deal with multiple different screen sizes. 
For console programs you can use the ROWS and COLS system variables to ask for the size of the textscreen (Example: 
kollo's avatar
kollo committed
122
console-clock.bas). The screen dimensions of the graphics screen can be 
123 124 125 126
retreived with the GET_GEOMETRY command (Example: kugel.bas).
</p>
<p>Be careful with the use of the QUIT command: 
QUIT will really finish the app, so one cannot read the console output 
kollo's avatar
kollo committed
127
anymore (this is unlike the console stdout on standard UNIX systems.). 
128
Better use END.
kollo's avatar
kollo committed
129 130 131 132 133 134 135 136 137 138 139 140 141 142
</p>
<a name="Usage" id="Usage"></a><h2> <span class="mw-headline">Usage</span></h2>
<p>Android deviced usually have a BACK Butten, a HOME button and a MENU Button. 
</p>
<ul><li> The HOME Button suspends X11-Basic and returns to the Android desktop. Selecting the X11-Basic app again will resume it.
</li><li> With the BACK button, a running BASIC program will be stopped.
 If you press the back button again, the X11-Basic interpreter quits.
</li><li> The MENU Button opens a menu with following options: About, 
LOAD Program, RUN program, STOP/CONT program, NEW, Keyboard, Paste from 
Clipboard, Info/Settings, Editor, Compile, Help and Quit.
<ul><li> About: Show information about the current version of X11-Basic, news and an impressum.
</li><li> Load ... opens a fileselector which displays all .bas and all 
.b programs in the directory /mnt/sdcard/bas. The selected program will 
be loaded into memory. A program eventiually stored there before will be
143 144
 overwritten. You can display the sourcecode by entering LIST.
</li><li> Run will simply start the excecution of a program which has been loaded before. (You can also enter RUN)
kollo's avatar
kollo committed
145
</li><li> STOP/CONT will interrupt the excecution of the program or 
146 147
resume it. (You can also press the BACK button once to stop the program, and you can enter CONT to continue it).
</li><li> New will delete the program from memory (same as typing NEW at the command line).
kollo's avatar
kollo committed
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
</li><li> Keyboard will show or hide the on-screen virtual keyboard. If 
you have a hardware or external USB/bluetooth keyboard, you can also 
enter commands with that.
</li><li> Paste from Clipboard will paste any text you have copied to the clipboard (from any other application) before.
</li><li> Info/Settings will open a dialog with additional information, links, and preference settings.
<ul><li> Show Splash Screen at X11-Basic startup. This can be switched off here
</li><li> Select Font size. If the screen is small but the resolution is
 high, you want to change the font size to LARGE. This setting affects 
the console font (text mode) as well as the graphics/user-Interface.
</li></ul>
</li><li> Editor will excecute a 3rd party text editor app (e.g. Ted if 
installed) to edit the program currently loaded. If no program was 
loaded, the default file name will be new.bas.
</li><li> Compile will compile the basic source code into bytecode which
 can be excecuted about 20 times faster. The bytecode will be saved with
 .b extension in the bas/ folder.
</li><li> Help will open a window in which you can search the command reference.
</li><li> Quit will terminate the X11-Basic interpreter.
</li></ul>
</li></ul>
<a name="Editing_a_program" id="Editing_a_program"></a><h3> <span class="mw-headline">Editing a program</span></h3>
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-more.png" class="image" title="Press Menu --&gt; More to get this extended menu."><img alt="" src="AQ_files/180px-Android-menu-more.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-more.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>Press Menu --&gt; More to get this extended menu.</div></div></div>
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-editor.png" class="image" title="Press Menu --&gt; More --&gt; Editor to run your favorite text editor."><img alt="" src="AQ_files/180px-Android-editor.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-editor.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>Press Menu --&gt; More --&gt; Editor to run your favorite text editor.</div></div></div>
<ol><li> Load an existing program with Menu --&gt; Load
</li><li> Choose Menu --&gt; Editor to edit the program
</li><li> finish editing (and save it in the editor)
</li><li> Program gets automatically reload
</li><li> choose menu --&gt; run to run it
</li></ol>
<a name="Installing_a_text_editor" id="Installing_a_text_editor"></a><h3> <span class="mw-headline">Installing a text editor</span></h3>
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-editornotfound.png" class="image" title="If you get this error message, you need to install a text editor app."><img alt="" src="AQ_files/180px-Android-editornotfound.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-editornotfound.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>If you get this error message, you need to install a text editor app.</div></div></div>
<p>If you get an error when calling the text editor, you need to install one. There are plenty around, e.g. <i>920 Text Editor</i> or <i>Ted (tiny text editor)</i>.
 Install them from the market. You can install multiple editors. Then 
you are asked which one you like to use, every time you call the editor.
</p>
<a name="LOAD_file_select_functions" id="LOAD_file_select_functions"></a><h3> <span class="mw-headline">LOAD file select functions</span></h3>
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-load.png" class="image" title="Press menu --&gt; load to get this file list."><img alt="" src="AQ_files/180px-Android-menu-load.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-load.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>Press menu --&gt; load to get this file list.</div></div></div>
<p>To load a program, press menu --&gt; load. You can now select a 
program file (either .bas or .b) to load. If you touch the filename long
 you get another menu with advanced functions: 
</p>
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-load-extra.png" class="image" title="Press menu --&gt; load and longtouch a file, then you get this extra options."><img alt="" src="AQ_files/180px-Android-menu-load-extra.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-load-extra.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>Press menu --&gt; load and longtouch a file, then you get this extra options.</div></div></div>
<ul><li> LOAD -- load the program
</li><li> MERGE -- merge the program to the one already loaded (works only with .bas files)
</li><li> LOAD + RUN -- load the program and immediately run it
</li><li> LOAD + LIST -- load the program an list it
</li><li> LOAD + edit -- load the program and immediately start the editor
</li><li> LOAD + compile -- load the program and compile it
</li><li> compile + RUN -- compile the program and immediately run the compiled program
</li><li> delete   -- delete the selected file (you will be asked to confirm)
</li><li> CANCEL   -- return to the file menu
</li></ul>
<p>These functions are here for convinience only. You probably want to use LOAD+RUN or compile+RUN more often.
</p>
<a name="Desktop_shortcuts" id="Desktop_shortcuts"></a><h3> <span class="mw-headline">Desktop shortcuts</span></h3>
You can create desktop shortcuts to your BASIC programs. You can easily 
place an application shortcut on the home screen by simply pressing 
anywhere (and hold for 1 second) on the background of the desktop screen
 (On Android 4.x devices go to Apps--&gt;Widgets). <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-widgets.png" class="image" title="The X11-Basic create shortcut widget"><img alt="" src="AQ_files/180px-Android-widgets.png" class="thumbimage" border="0" height="122" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-widgets.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>The X11-Basic create shortcut widget</div></div></div>
 You first are asked to place the shortcut somewhere on the desktop. The
 X11-Basic launcher then asks for a .bas or .b file and places the link 
on the desktop. Pressing this link will automatically load X11-Basic and
 the .bas program and run it.
<a name="Configuring_X11-Basic" id="Configuring_X11-Basic"></a><h2> <span class="mw-headline">Configuring X11-Basic</span></h2>
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-selectfontsize.png" class="image" title="With the font size settings (Menu --&gt; More --&gt; Info/Settings --&gt; Select font size) you can adjust the size of the characters of the text screen output."><img alt="" src="AQ_files/180px-Android-menu-selectfontsize.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-menu-selectfontsize.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>With
 the font size settings (Menu --&gt; More --&gt; Info/Settings --&gt; 
Select font size) you can adjust the size of the characters of the text 
screen output.</div></div></div>
<p>There is really not much to configure. If you do not like the splash 
text which appears after starting the X11-Basic interpreter, you can 
switch it off (Menu --&gt; More --&gt; Info/Settings --&gt; Splash 
screen).
And you can specify a font size, in case the characters if the text 
screen appear to be too tiny to read. By default, X11-Basic trys to 
automatically set a readable font depending of your display resolution.
</p>
<a name="Sensors" id="Sensors"></a><h2> <span class="mw-headline">Sensors</span></h2>
<p>You can get the values from the devices Sensors with new SENSOR commands. See sensortest.bas.
</p>
<pre> SENSOR ON
 PRINT SENSOR(0)
</pre>
<a name="GPS_Service" id="GPS_Service"></a><h2> <span class="mw-headline">GPS Service</span></h2>
<pre> GPS ON
 print GPS_LAT,GPS_LON,GPS_ALT
 GET_LOCATION
</pre>
<a name="Sound" id="Sound"></a><h2> <span class="mw-headline">Sound</span></h2>
<p>X11-Basic supports sound, soundfile playback and tone generation. 
Also the text-to-speach feature of Android devices is supported. You can
 use the following commands:
</p>
240 241 242 243 244
<pre> 
PLAYSOUNDFILE   -- playback a sound file, like .mp3 or .ogg
SPEAK	        -- speak out a text. The language and different voices can be selected
SOUND	        -- generate a sound 
WAVE	        -- program the sound synthesizer and sounc channel mixer
kollo's avatar
kollo committed
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
</pre>
<a name="Text-Console" id="Text-Console"></a><h2> <span class="mw-headline">Text-Console</span></h2>
<p>X11-Basic on Android implements a full featured coloured VT100/ANSI Terminal emulation for text output (e.g. with <a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=PRINT&amp;action=edit&amp;redlink=1" class="new" title="PRINT (page does not exist)">PRINT</a>).
 It implements five different font sizes (5x7, 8x16, 16x32, 24x48 and 
32x64) and a changeable 8x16 bit graphics font. It uses the ESC-[-...-z 
extension which you may know from <a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=Vt100emu.30c" title="Vt100emu.30c">vt100emu.30c</a> on ATARI ST, <a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=TTconsole" title="TTconsole" class="mw-redirect">TTconsole</a> on the Tomtom devices and other terminal emulation implementations.
</p><p>There is no distinction between the text console and the graphics
 screen. Text and graphics are drawn to the same framebuffer. Unlike the
 text size of the graphics commands (e.g. <a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=TEXT&amp;action=edit&amp;redlink=1" class="new" title="TEXT (page does not exist)">TEXT</a>), the console font size can be changed only by user settings.
</p>
<a name="Shell_access" id="Shell_access"></a><h2> <span class="mw-headline">Shell access</span></h2>
<p>With the commands SYSTEM, SYSTEM$() and SHELL you can access all 
native linux tools and make them part of your basic program. With SHELL 
you can also start a shell session and use the X11-Basic console to 
enter UNIX commands. Do a 
</p>
<pre> shell "/system/bin/sh"
</pre>
<p>It appears, that on unrooted Android devices the internal shell has 
only a limited functionallity. However, this can be extended by 
installing additionally ARM binary files in the /data/local/ 
directories. This way, a busybox can be used or any other (text 
mode/console) application. E.g. pico or nano are known to work, unproven
 yet but very likely: pine and mc (midnight commander). Simply try it 
out and let us know.
</p>
<a name="Benchmarking" id="Benchmarking"></a><h2> <span class="mw-headline">Benchmarking</span></h2>
<p>You can run a benchmark-Program (Whets.bas) to see, how fast the programs get excecuted. On a Tablet PC I get 0.8 <a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=MWIPS&amp;action=edit&amp;redlink=1" class="new" title="MWIPS (page does not exist)">MWIPS</a> (for interpreted bas file) and 17 MWIPS (for the compiled .b version). On my Pencium 3GHz I get 2 MWIPS and 60 MWIPS.
</p><p>It also was reported that bytecode compiled X11Basic programs run
 40 times faster than similar ones implemented in another free popular 
basic interpreter for Android. Speed is really one of X11-Basics 
strengths!
</p>
<a name="Internet_connections" id="Internet_connections"></a><h2> <span class="mw-headline">Internet connections</span></h2>
<p>X11-Basic programs can connect to UDP and/or TCP/IP sockets anywhere 
on the network and as well can open a socket on the device to run a 
program as a server. A good example on how to make UDP connections from 
one device to another is given with udp_send.bas and udp_receive.bas.
</p><p>For an example of how to program a TCP/IP server, see 
iserver.bas. It opens a socket on a port, waits for connections and 
serves the clients on a ASCII command based protocol.
</p>
<a name="Getting_Online_Help_on_syntax" id="Getting_Online_Help_on_syntax"></a><h2> <span class="mw-headline">Getting Online Help on syntax</span></h2>
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-help.png" class="image" title="getting a verbose help and description of each command in X11-Basic (Menu --&gt; More --&gt; Help)."><img alt="" src="AQ_files/180px-Android-help.png" class="thumbimage" border="0" height="270" width="180"></a>  <div class="thumbcaption"><div class="magnify"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Android-help.png" class="internal" title="Enlarge"><img src="AQ_files/magnify-clip.png" alt="" height="11" width="15"></a></div>getting a verbose help and description of each command in X11-Basic (Menu --&gt; More --&gt; Help).</div></div></div>
<p>The X11-basic app has a builtin (offline) help on all commands and 
functions (Menu --&gt; More --&gt; Help). If you need information on a 
specific keyword, try to type in the word (first letter is enough) into 
the search field.
</p>
<a name="Examples_of_working_programs" id="Examples_of_working_programs"></a><h2> <span class="mw-headline">Examples of working programs</span></h2>
<p>Following is a list of example Programs, which do already work nearly perfect on Android:
</p>
<ul><li> timetext.bas
</li><li> sensortest.bas
</li><li> ostern.bas
</li><li> console-clock.bas
301
</li><li> ballerburg.bas (see: <a href="X11-Basic-Ballerburg.pdf" title="X11-Basic-Ballerburg.pdf">X11-Basic-Ballerburg.pdf</a>)
kollo's avatar
kollo committed
302 303 304 305 306 307 308
</li><li> <i>add more</i>
</li></ul>
<table class="gallery" cellpadding="0" cellspacing="0">
	<tbody><tr>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Kugel-bas.png" class="image" title="Kugel-bas.png"><img alt="" src="AQ_files/80px-Kugel-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
309
<p><a href="https://gitlab.com/kollo/X11-Basic_examples/raw/master/All/graphics/kugel.bas" class="external text" title="kugel.bas" rel="nofollow"><i>kugel.bas</i></a>
kollo's avatar
kollo committed
310 311 312 313 314 315
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:TTsky-bas.png" class="image" title="TTsky-bas.png"><img alt="" src="AQ_files/80px-TTsky-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
316
<p><a href="http://x11-basic.sourceforge.net/examples/TomTom/TTsky.bas" class="external text" title="TTsky.bas" rel="nofollow"><i>TTsky.bas</i></a>
kollo's avatar
kollo committed
317 318 319 320 321 322
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:3Dng-b.png" class="image" title="3Dng-b.png"><img alt="" src="AQ_files/80px-3Dng-b.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
323
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/3Dng.bas" class="external text" title="3Dng.bas" rel="nofollow"><i>3Dng.b</i></a>
kollo's avatar
kollo committed
324 325 326 327 328 329
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Ansicolor-bas.png" class="image" title="Ansicolor-bas.png"><img alt="" src="AQ_files/80px-Ansicolor-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
330
<p><a href="http://x11-basic.sourceforge.net/examples/tests/ansicolor.bas" class="external text" title="ansicolor.bas" rel="nofollow"><i>ansicolor.bas</i></a>
kollo's avatar
kollo committed
331 332 333 334 335 336 337 338
</p>
			</div>
		</div></td>
	</tr>
	<tr>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Whets-bas.png" class="image" title="Whets-bas.png"><img alt="" src="AQ_files/80px-Whets-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
339
<p><a href="http://x11-basic.sourceforge.net/examples/calculation/Whets.bas" class="external text" title="Whets.bas" rel="nofollow"><i>whets.bas</i></a>
kollo's avatar
kollo committed
340 341 342 343 344 345
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Farn-bas.png" class="image" title="Farn-bas.png"><img alt="" src="AQ_files/80px-Farn-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
346
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/farn.bas" class="external text" title="farn.bas" rel="nofollow"><i>farn.bas</i></a>
kollo's avatar
kollo committed
347 348 349 350 351 352
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Sierpinsky-bas.png" class="image" title="Sierpinsky-bas.png"><img alt="" src="AQ_files/80px-Sierpinsky-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
353
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/sierpinski.bas" class="external text" title="sierpinski.bas" rel="nofollow"><i>sierpinski.bas</i></a>
kollo's avatar
kollo committed
354 355 356 357 358 359
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Wanderermaze-bas.png" class="image" title="Wanderermaze-bas.png"><img alt="" src="AQ_files/80px-Wanderermaze-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
360
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/wanderermaze.bas" class="external text" title="wanderermaze.bas" rel="nofollow"><i>wanderermaze.bas</i></a>
kollo's avatar
kollo committed
361 362 363 364 365 366 367 368
</p>
			</div>
		</div></td>
	</tr>
	<tr>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Mandel-b.png" class="image" title="Mandel-b.png"><img alt="" src="AQ_files/80px-Mandel-b.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
369
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/mandel.bas" class="external text" title="mandel.bas" rel="nofollow"><i>mandel.bas</i></a>
kollo's avatar
kollo committed
370 371 372 373 374 375
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Mandel-simple-b.png" class="image" title="Mandel-simple-b.png"><img alt="" src="AQ_files/80px-Mandel-simple-b.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
376
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/mandel-simple.bas" class="external text" title="mandel-simple.bas" rel="nofollow"><i>mandel-simple.bas</i></a>
kollo's avatar
kollo committed
377 378 379 380 381 382
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Replicator-bas.png" class="image" title="Replicator-bas.png"><img alt="" src="AQ_files/80px-Replicator-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
383
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/replicator.bas" class="external text" title="replicator.bas" rel="nofollow"><i>replicator.bas</i></a>
kollo's avatar
kollo committed
384 385 386 387 388 389
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div style="height: 152px;">Atomium-bas.png</div>
			<div class="gallerytext">
390
<p><a href="http://x11-basic.sourceforge.net/examples/games/atomium.bas" class="external text" title="atomium.bas" rel="nofollow"><i>atomium.bas</i></a>
kollo's avatar
kollo committed
391 392 393 394 395 396 397 398
</p>
			</div>
		</div></td>
	</tr>
	<tr>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Ballerburg-bas.png" class="image" title="Ballerburg-bas.png"><img alt="" src="AQ_files/80px-Ballerburg-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
399
<p><a href="http://x11-basic.sourceforge.net/examples/games/Ballerburg/ballerburg.bas" class="external text" title="ballerburg.bas" rel="nofollow"><i>ballerburg.bas</i></a>
kollo's avatar
kollo committed
400 401 402 403 404 405
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div style="height: 152px;">Ana uhr-bas.png</div>
			<div class="gallerytext">
406
<p><a href="http://x11-basic.sourceforge.net/examples/graphics/ana_uhr.bas" class="external text" title="ana_uhr.bas" rel="nofollow"><i>ana_uhr.bas</i></a>
kollo's avatar
kollo committed
407 408 409 410 411 412
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Bifur-bas.png" class="image" title="Bifur-bas.png"><img alt="" src="AQ_files/80px-Bifur-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
413
<p><a href="http://x11-basic.sourceforge.net/examples/simulation/bifur.bas" class="external text" title="bifur.bas" rel="nofollow"><i>bifur.bas</i></a>
kollo's avatar
kollo committed
414 415 416 417 418 419
</p>
			</div>
		</div></td>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Console_clock-bas.png" class="image" title="Console clock-bas.png"><img alt="" src="AQ_files/80px-Console_clock-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
420
<p><a href="http://x11-basic.sourceforge.net/examples/console/console_clock.bas" class="external text" title="console_clock.bas" rel="nofollow"><i>console_clock.bas</i></a>
kollo's avatar
kollo committed
421 422 423 424 425 426 427 428
</p>
			</div>
		</div></td>
	</tr>
	<tr>
		<td><div class="gallerybox" style="width: 155px;">
			<div class="thumb" style="padding: 13px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=File:Resonnances-bas.png" class="image" title="Resonnances-bas.png"><img alt="" src="AQ_files/80px-Resonnances-bas.png" border="0" height="120" width="80"></a></div></div>
			<div class="gallerytext">
429
<p><a href="http://x11-basic.sourceforge.net/examples/simulation/resonnances.bas" class="external text" title="resonnances.bas" rel="nofollow"><i>resonnances.bas</i></a>
kollo's avatar
kollo committed
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
</p>
			</div>
		</div></td>
	</tr>
</tbody></table>
<a name="Updates_of_example_programs" id="Updates_of_example_programs"></a><h3> <span class="mw-headline">Updates of example programs</span></h3>
<p>Hint: X11-Basic App comes with a small selection of example programs.
 They are copied into the /bas/ directory. The X11-Basic app will never 
overwrite a file in bas/ which is already there. If you want a specific 
example program be updated (replaced with a potentially newer version, 
which has come with an update of the X11-Basic app), simply delete the 
file. It will be restored after the next excecution of X11-basic.
</p>
<a name="Bugs" id="Bugs"></a><h2> <span class="mw-headline">Bugs</span></h2>
<ul><li> GET_LOCATION is not working on every device
</li><li> Screen-refresh is not working on some SAMSUNG tablets.
</li><li> Crashes soimtimes right after start of the app on SAMSUNG devices.
</li><li> Syntax checking should be done in PROCEDURE and FUNCTION definitions.
</li><li> crash in FILESELECT with title
</li><li> we see sometimes a crash when the device is turned by 90 degrees while a program is still running. 
</li><li> EXEC on android intents does not take the extra arguments.
451
</li><li> crash after pasting something from the clipboard.
kollo's avatar
kollo committed
452 453 454 455 456 457 458 459
</li><li> <i>add some more here</i>
</li></ul>
<p>Please also read the <a href="https://sourceforge.net/apps/mediawiki/x11-basic/index.php?title=Compatibility" title="Compatibility">compatibility</a> issues.
</p>

<div class="visualClear"></div>
<div id="footer">
<ul id="f-list">
460
<li id="lastmod"> This page was last modified on 24 February 2015, at 08:46.</li>
kollo's avatar
kollo committed
461 462 463 464 465 466
</ul>
</div>
</div>

<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>
</body></html>