Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add android file transfer #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions _build/pages/android_file_transfer.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SmallBASIC File Transfer

Easy file transfer between your Android device and your desktop using WIFI.

## Step-by-Step Guide

1. Enable WIFI on your mobile to access your home network.
2. In the [setup]-screen, select a font, enable extensions and give a port number, for example 5432.
3. Follow the instructions to restart SmallBASIC.
4. Open the [about]-screen to display the device IP and token.
5. On your desktop browser, enter http://device-ip:port. For example: http://192.168.1.5:5432.
6. You should see a login screen with "Enter your access token".
7. Enter the token as shown in the [about]-page.
8. You can now upload and download SmallBASIC files between your desktop and your mobile.

<div class="video-container">
<iframe width="1158" height="651" src="https://www.youtube.com/embed/4Daj4YflyS0" title="SmallBASIC File Transfer" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div>
1 change: 1 addition & 0 deletions _build/pages/articles.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Setup external editors](/pages/language_support.html)
- [Distribute your program](/pages/distributiontool.html)
- [SmallBASIC web server](/pages/sbasicw.html)
- [SmallBASIC file transfer](/pages/android_file_transfer.html)

## Plugins

Expand Down
93 changes: 72 additions & 21 deletions _build/pages/guide.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Contents
* [Maps as Pseudo Objects for OOP](#MapsAsPseudoObjectForOOP)
* [Operators](#Operators)
* [Pseudo-operators](#pseudo)
* [Expressions](#Expressions)
* [Subroutines and Functions](#SubroutinesAndFunctions)
* [Names](#SubroutinesAndFunctionsNames)
* [Declaration of Subroutines](#DeclarationOfSubroutines)
Expand All @@ -57,7 +58,7 @@ Contents
* [Using Local Variables](#UsingLocalVariables)
* [Nested Routines](#NestedRoutines)
* [Declarations in PalmOS](#DeclarationsInPalmOS)
* [Expressions](#Expressions)
* [Conditions](#Conditions)
* [IF-THEN-ELSIF-ELSE](#IfThenElseifEndif)
* [Single-line IF-THEN-ELSE](#SingleLineIfThenElse)
* [Inline Version of IF](#InlineVersionOfIf)
Expand All @@ -71,12 +72,15 @@ Contents
* [Units](#Units)
* [Declaration](#UnitsDeclaration)
* [Import](#UnitsImport)
* [Input and Output](#InputAndOutput)
* [Print on Screen](#PrintOnScreen)
* [Read Input from the Keyboard](#ReadInputFromKeyboard)
* [The USE Keyword](#TheUseKeyword)
* [OPTION](#Statement1)
* [OPTION BASE](#Statement2)
* [OPTION MATCH](#Statement3)
* [OPTION PREDEF](#Statement4)
* [Meta Commands](#Meta)
* [The USE Keyword](#TheUseKeyword)
* [Exception Handling](#ExceptionHandling)

:::
Expand All @@ -100,7 +104,7 @@ too.

### Windows {#Windows}

Download the [latest release of SmallBASIC](https://smallbasic.github.io/pages/download.html).
Download the [latest release of SmallBASIC](/pages/download.html).
The different versions of SmallBASIC are included in the zip-file. Extract the zip-file to a
location of your choice. Open the SmallBASIC folder and start one of the following programs:

Expand All @@ -110,7 +114,7 @@ location of your choice. Open the SmallBASIC folder and start one of the followi

### Linux {#Linux}

Download the [latest release of SmallBASIC](https://smallbasic.github.io/pages/download.html).
Download the [latest release of SmallBASIC](pages/download.html).
The different versions of SmallBASIC are provided as separate AppImages. Download an AppImage
and copy it to a directory of your choice. Execute the AppImage. Depending of the Linux version
you have to make the AppImage executable: `chmod u+x AppImageFile`, where `AppImageFile` is the
Expand All @@ -119,7 +123,10 @@ filename of the AppImage.
### Android {#Android}

Download and install SmallBASIC for Android using
[Google Play](https://play.google.com/store/apps/details?id=net.sourceforge.smallbasic).
[Google Play](https://play.google.com/store/apps/details?id=net.sourceforge.smallbasic). Files
are stored in `/InternalMemory/SmallBASIC` or in case of an old Android version in
`/InternalMemory/Android/data/net.sourceforge.smallbasic/files`. For easy file transfer between
Android and desktop, please read [SmallBASIC file transfer](/pages/android_file_transfer.html)

### Build from Source {#BuildFromSource}

Expand All @@ -131,9 +138,9 @@ Please follow the instructions on [Github](https://github.com/smallbasic/SmallBA

Please read the separate articles for the different versions of SmallBASIC:

- [SDL](https://smallbasic.github.io/pages/sdl.html)
- [Android](https://smallbasic.github.io/pages/android.html)
- [FLTK](https://smallbasic.github.io/pages/fltk.html)
- [SDL](/pages/sdl.html)
- [Android](/pages/android.html)
- [FLTK](/pages/fltk.html)

## Source Code Format {#SourceCodeFormat}

Expand Down Expand Up @@ -1425,7 +1432,7 @@ the select-case structure will be exited and all following case statements will
tested anymore. If non of the case statements were entered the optional 'CASE ELSE'
statements will be entered.

See function reference [SELECT CASE](https://smallbasic.github.io/reference/655.html) for
See function reference [SELECT CASE](/reference/655.html) for
detailed information.

## Units {#Units}
Expand Down Expand Up @@ -1476,6 +1483,62 @@ IMPORT MyUnit as u
u.MyFunction(1)
```

## The USE Keyword {#TheUseKeyword}

The `USE` keyword is used on specific commands for passing a user-defined expression.

```smallbasic
SPLIT s," ",v USE TRIM(x)
```

In this example, every element of `v` will be trimmed. Use the `x` variable to
specify the parameter of the expression. If the expression needs more parameter,
you can use also the names `y` and `z`.


## Input and Output {#InputAndOutput}

### Print on Screen {#PrintOnScreen}

Use `PRINT` to print text on the screen at the current cursor location. When starting
the BASIC program, the cursor is in the top left corner. After printing to the screen
the cursor location will be updated. After execution of `PRINT`, if not otherwise
specified, the cursor will be moved to the beginning of the next line. When printing
to the last line of the screen, the screen will scroll up by one line.

Basic usage of `PRINT`:

```smallbasic
PRINT 1 ' Output: 1
PRINT 1+1 ' Output: 2
PRINT cos(pi) ' Output: -1
PRINT "Text" ' Output: Text
```

If `;` or `,` are used as last character of a print command, carriage return/line feed
(new line) will be suppressed after printing.

Please read the language reference of [PRINT](/reference/535.html)
for a detailed description. The text cursor can be set using
[LOCATE](/reference/530.html).

### Read Input from the Keyboard {#ReadInputFromKeyboard}

`INPUT` reads text from keyboard and stores it in a variable. `INPUT` can print a prompt
on screen. After execution of `INPUT` the cursor will be moved to the beginning of the
next line. `INPUT` will block execution of the program until the return-key is pressed.

Basic usage of `INPUT`:

```smallbasic
INPUT "How old are you?", age
PRINT age
```

For more information see language reference of [INPUT](/reference/527.html).
[INKEY](/reference/539.html) and [DEFINEKEY](/reference/1015.html) allow to read from
a keyboard without blocking the execution of the program.

## OPTION {#Statement1}

The `OPTION` command is used to pass parameters to the SB-environment. There are
Expand Down Expand Up @@ -1548,18 +1611,6 @@ SmallBASIC uses the following meta commands:
#unit-path: C:\sbasic\units;C:\temp
```

### The USE Keyword {#TheUseKeyword}

The `USE` keyword is used on specific commands for passing a user-defined expression.

```smallbasic
SPLIT s," ",v USE TRIM(x)
```

In this example, every element of `v` will be trimmed. Use the `x` variable to
specify the parameter of the expression. If the expression needs more parameter,
you can use also the names `y` and `z`.

## Exception Handling {#ExceptionHandling}

Exception handling is supported for file handling, and accessing serial ports and
Expand Down
71 changes: 71 additions & 0 deletions pages/android_file_transfer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!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_file_transfer</title>
<meta name="description" content="SmallBASIC | One more basic">
<link rel="canonical" href="/android_file_transfer.html">
<link rel="keywords" href="android_file_transfer">
<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">&#11205;</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_file_transfer.markdown">Edit</a>
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/android_file_transfer.markdown">History</a>
</div>
</div>
<div class="article">
<h1 id="smallbasic-file-transfer">SmallBASIC File Transfer</h1>
<p>Easy file transfer between your Android device and your desktop using
WIFI.</p>
<h2 id="step-by-step-guide">Step-by-Step Guide</h2>
<ol type="1">
<li>Enable WIFI on your mobile to access your home network.</li>
<li>In the [setup]-screen, select a font, enable extensions and give a
port number, for example 5432.</li>
<li>Follow the instructions to restart SmallBASIC.</li>
<li>Open the [about]-screen to display the device IP and token.</li>
<li>On your desktop browser, enter http://device-ip:port. For example:
http://192.168.1.5:5432.</li>
<li>You should see a login screen with “Enter your access token”.</li>
<li>Enter the token as shown in the [about]-page.</li>
<li>You can now upload and download SmallBASIC files between your
desktop and your mobile.</li>
</ol>
<div class="video-container">
<iframe width="1158" height="651" src="https://www.youtube.com/embed/4Daj4YflyS0" title="SmallBASIC File Transfer" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
</iframe>
</div>
</div>
<div class="pagefooter">
This page was last edited on |
<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>
2 changes: 2 additions & 0 deletions pages/articles.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ <h2 id="getting-started">Getting started</h2>
<li><a href="/pages/distributiontool.html">Distribute your
program</a></li>
<li><a href="/pages/sbasicw.html">SmallBASIC web server</a></li>
<li><a href="/pages/android_file_transfer.html">SmallBASIC file
transfer</a></li>
</ul>
<h2 id="plugins">Plugins</h2>
<ul>
Expand Down
Loading