hBasic > hManual > Package

hBasic Manual
Package changes

API levels Support and requirements
Identity Changes App identity
Legacy Storage Support for older devices
Scoped Storage How Google screwed up shared storage
Permissions
What to expect during installation

API

 This release includes all mods and (most) patches from v1.61 with support to target API 35;

 minSdkVersion : 19            (backward support to no less than ICS)
 targetSdkVersion : 35        (forward support up to Android 15)
 compileSdkVersion : 35    (built with sdk version: 35)

 Note: hBasic will overwrite Sample_Programs if another version of hBasic was run before).

About Android Target Versions on Google Playstore

Google requires that by the end August of each year (or after a new Android version comes out),  all Playstore apps and updates must target a level no more than one year older than the current release.

New apps must meet this requirement from August (or new version announcement).
Old Apps (already on Playstore) must also be updated.

For  August 2024 the minimum requirement will be a target of API 34 (Android 14) which would last up to August of 2025. The requirement for 2025 is likely to be a similar formula but has not yet been announced.

hBasic comes with source code in a zip package. If you are able to compile from source, then you need to be able to upgrade the platform-api level to whatever you need before compilation. (This info is beyond the scope of this manual).  Alternatively, you may compile with the latest version of hSuite.
App Identity

Package ID : com.rfo.hbasic  (since July 2020 v3.00)

Titles for Program Output, SELECT, TEXT.INPUT, and TGET were changed to generic names. (since v2.91)

Splash screen was changed to the hBasic splash screen (optional and user-definable within hSuite).

APK Signature
Since v2.91 the APK is signed with a new key (different from previous).
You will need to un-install any old version ( < v2.91 ) before installing.

Since v3.04 the APK is also signed with v2 scheme - a requirement for devices running Android 11+.
Since v3.06 the APK is also signed with v3 scheme - ( a side affect from using bundletool ).

Package version
version$() will return the app version (as before).
version$(0) will return the base version which by default is the hMaster code base version (without patches).

Both versions are user-definable  within hSuite.

Legacy Storage

hBasic's default storage base was moved to scoped storage since v3.00.
However, devices lower than Android 11 (< Api 30) can choose legacy storage by selecting the base Drive
in Preferences > Base Drive as either

/sdcard
or
/storage/emulated/0
which effectively moves the base to legacy storage (outside of scoped storage).
Devices for Android 11 and higher will not have this option.

For Standalone apks (made with hSuite/hPatcher), you also need to add permission WRITE_EXTERNAL_STORAGE
and select Customise > Legacy > use Unscoped Storage. You only need this option if the app was developed using a legacy base.

Scoped Storage

hBasic was forced to move to scoped storage (since v3.00) to cater for devices running Android 11+ (Api 30+).
This means that the app is boxed into a storage area that only itself can read or write to (by design).
Outside apps cannot normally access this private area.

Basic's legacy (unscoped) storage base is historically on External storage at </sdcard>.
This area is often emulated with faster 'internal' storage but still classified as 'External'.
On the other hand, hBasic's (scoped) storage base starts furthur inside e.g </sdcard>/Android/data/com.rfo.hbasic

Base Drive (or Base Path)
The base_drive or BasePath is the start of scoped storage.
It is usually found at <sdcard>/Android/data/com.rfo.hbasic.
(note: legacy Basic's default base drive used to be just </sdcard>)
Base Directory
The base_directory is therefore <sdcard>/Android/data/com.rfo.hbasic/rfo-basic
with source, data & databases under this base.

App Path
Historically, the App_Path or app directory is just the name of the base_directory e.g "rfo-basic"
(ironically without the path).
This will be different for custom (standalone) apps.

The mount point of </sdcard> is something like /storage/emulated/0 depending on the device.

To read and write from/to outside of the base_drive you will need an ftp client to connect to hBasic's embedded ftp server (hFTP server). You may need this if you are developing on a PC and need to transfer your basic files to your phone. To start the server, tap on Editor menu > Start FTP server. Then connect using you FTP client.

An alternative is to use a file-manager that has permission to enter hBasic's scoped storage. Recommended is Total-Commander. For furthur details, see this article on Transfer of Files for other methods.

Being boxed inside scoped storage also means you can't get out.
All apps that run on an Android 11 device and higher (Api 30+) are forced to be scoped. i.e they can no longer easily access areas outside of their own scoped storage nor easily share their own files for other apps.

However, all apps modified to use scoped storage can also run on older devices (<Api 30) (see legacy).
Scoped storage is furthur discussed in this forum post. and is mapped in this article.

Permissions

These are likely the permissions required by the user to grant when the app is installed.
Standard hBasic will ask for all dangerous permssions at the start of the program if not previously granted.
If you don't want to grant any of the permssions and don't want to be asked, select "Don't Ask Again".

You can un-grant permissions via the devices' Settings app, infact, newer Android versions may do this automatically if the app is unused for a while. hBasic will then prompt for permission the next time it starts.

StandAlone Apps (made via hSuite) can select which permissions will be required.
Only the dangerous ones will be asked for, the others are automatically granted.

App Dangerous Permissions

Device Api
Codes
Requested
< Api 23
< 6(M)

One screen requesting all permissions.
Api 23
6(M)

Media & Files
Device Location
Record Video
Record Audio
Phone Calls
Api 30
11(R)

Record Video
Device Location
Record Audio
Phone Calls
> Api 30
> 11(R)



> 13(T)
Record Video
Device Location
Record Audio
Phone Calls
Nearby Devices
Notifications




Older devices (<Api 30) configured to run legacy storage (with base at root of /sdcard) will need permission WRITE_EXTERNAL_STORAGE (Media & Files). This is not needed for Scoped Storage.

-End