TotalCross Changelog
All notable changes to this project will be documented in this file.
Welcome to the July 2020 release (version 6.1.0). We hope you enjoy the updates in this version. The key highlights are:
- Maven plugin new version: your
pom.xml
file should change; - KnowCode Compatibility - It is now possible to run Android XMLs Layouts on Linux Arm;
- Virtual Keyboard - New look and animations;
- Using external applications - Through the runtime.exec method;
- Anonymous user statistics - There is now an option to contribute by sending anonymous data;
- Changing the SDL implementation - Removing the SDL code from within the TotalCross SDK and changing the static to dynamic link.
Join our community on the telegram to suggest activities and learn about development for embedded systems.
After the latest Language Support for Java extension updates, some systems had compatibility issues with Java 11. We launched a new version of the TotalCross maven plugin to solve them, the 1.1.6. You must change the following line:
...
<plugin>
<groupId>com.totalcross</groupId>
<artifactId>totalcross-maven-plugin</artifactId>
<!-- This line: -->
<version>1.1.6</version>
<configuration>
<name>${project.name}</name>
<platforms>
...
In this version, a name tag was added to ContentHandler (Pull request #20), making it possible for KnowCode, a tool that uses a neural network, to convert interface images to XML and TotalCross, allowing it to run on Linux Arm with the same performance as an application built directly with the TotalCross SDK

Home appliance application built with Android XML using KnowCode
In this milestone some improvements were implemented in the keyboard, which are:
- In Linux Arm the virtual keyboard is enabled by default. To disable it just put
Settings.virtualKeyboard = false
in yourMainWindow
class; - In order to improve performance and make the design cleaner, the
ripple effect
animation on the keyboard buttons was removed; - In order to obtain more effective responsiveness, the calculations of width and height were changed, leaving it less dependent on absolute values;
In the images below you can see the visual difference:

Virtual Keyboard on TCSDK 6.0.3 in Expanding Raspberry Pi Ports sample

Virtual Keyboard on TCSDK 6.1.0 in Expanding Raspberry Pi Ports sample
To allow the use of external libraries in the simplest way possible is one of TotalCross goals. There is a branch in our repository called tcni which (still a Proof Of Concept) allows the use of these external libraries
TCNI is a foreign function interface programming framework that enables TotalCross/Java code running in a Java virtual machine to call and be called by native applications and libraries written in other languages such as C, C ++ and assembly.
But while TCNI is not ready to be launched, we have developed a middle ground that allows the use of external applications in TotalCross, through the method
runtime.exec()
. This method creates a new process and executes the command you passed in this new process (Pull request #21). For example, create a python script to access a temperature sensor and with the
runtime.exec()
get the return of it, as you can see in this example:
When TotalCross decided to become a free and open source tool, the decision was made to no longer require an activation key from the user, which was previously necessary to differentiate free users from customers. As this removal would imply resolving a series of errors and making many changes, the team decided to generate an eternal and unlimited key and use it as a default, provisionally, until we resolve some pending issues and can go back to this point and withdraw it for good.
So in 6.1.0 we went back to that and removed the activation key, including the class
register.java
, as you can see in detail in pull request #53And to better track which users' preferences when using the TotalCross SDK, we set up the SDK to ask if the developer wants to contribute anonymous data and if the answer is positive, we record parameters for Deploy, timezone, launchers, operating system version and version of TotalCross used.

We chose to remove SDL code from the SDK TotalCross in this version to improve the build organization and allow people to customize the build of their facilities according to their hardware.
In addition, we changed the SDL link from static to dynamic because:
- Allows the distribution to have corrections and be used without having to compile the TC again but the guy needs to install the SDL before TotalCross
- Reverted scroll flick animation back to a previous version to fix a bug that caused the content to be pulled back after a scroll;
- Fixed wrong size returned by FontMetrics.stringWidth(String s) on devices that use skia with .ttf file type fonts.
- Disabled screen shifting on Android and iOS (when clicking on edit the keyboard would appear over edit);
- Added tag name to XML's ContentHandler.
- SDL statically linked SDL dynamically linked for Linux x86-64;
- Fix Linux x86 and 64 launcher (x-sharedlib to x-executable).
- Added Skia for Android so now is supported truetype fonts
- Fixed Android buildType
- Added iOS files on public repository;
- Support to Metal on iOS;
- Fixed SQLite on Linux Desktop.
- There were no changes
- There were no changes
- TotalCross is under the LGPL v2.1;
- Removed the mirror from GitLab to GitHub: GitHub is officially the main repository;
The remaining changelogs will be added later
- Edit
- When used for dates, the calendar now properly opens at the date informed on the edit - TotalCross#550
- Fixed getCopy() to properly function when the Edit uses the field decimalPlaces - TotalCross#505
- Spinner: fixed Spinner animation repainting over previous frames - TotalCross#568
- OutlinedEdit: fixed NPE when using the cancel button on CalendarBox - TotalCross#547
- PopupMenu: fixed performance issues with Material style caused by onPaint recreating the ninepatch on every refresh. This change also affects the performance of other components that may use PopupMenu, such as ComboBox.
This feature is available on all supported devices, but not on the simulator yet. Refer to the documentation for more information and sample usage
- YouTube Player: New API for displaying YouTube videos on Android and iOS
- Added support for text prediction when using native keyboard on Android and iOS
- Edit: Fixed base line not showing when running on devices with DP smaller than 1, such as most WinCE devices - TotalCross #389
- TabbedContainer: Improved graphical performance and responsiveness
- Added support for printing on Cielo Lio devices with embedded printer. Refer to the class
totalcross.cielo.sdk.printer.PrinterManager
for usage information.
- TotalCross is now aware of the device's screen pixel density and uses this information to scale UI elements uniformly on different platforms.
- The font size is now expressed in scaleable pixels (sp) and will now scale uniformly on different screens. The font size should now be expressed as a constant value or based on
Settings.deviceFontHeight
, but never based on the screen's resolution or target platform.
ℹ Existing applications may require adjustments to their font sizes!
- Improved overrall UI responsiveness and reduced application start time on Android
- Several
Vm.sleep
calls in the vm had their time reduced by 50% or more, some calls were replaced withThread.yield()
- On Android and Java, reduced overhead in the event thread to improve UI responsiveness
Screen density support
All graphical components can now be scaled to have approximately the same physical height on any screen resolution.
Density by OS
- Android and iOS: these devices expose a manufacturer-provided screen density value. On TotalCross 5 applications, this value is retrieved by default and used to ensure consistent component sizes across devices
- Java: based on scale, e.g. /scale 0.5 = density 2.0, you can try different densities on the emulator by changing the scale command line argument
- Win32 and WinCE: Most Windows devices do not natively expose screen density information and, thus, are kept at density 1.0. To improve the look and feel on smaller screens, we use a density of 0.75 on screens with width or height less than 320
- Other platforms: nothing changed (= density 1.0)
Font
The font size is now expressed in scalable pixels (sp), this abstracts away the actual physical dimension (screen pixels) of the font. This way, their actual physical size is calculated based on the screen density. e.g: A font with size of 20sp with different screen resolutions:
- Density 1.0: actual size 20 pixels
- Density 1.5: actual size 30 pixels
- Density 2.0: actual size 40 pixels
- Density 0.75: actual size 15 pixels This change shall render TotalCross apps ready for different screen sizes with minimal implementation effort.
Updating for 5.0Using Font.getDefaultFontSize is no longer necessary, you may now use constant values and the font size will be adjusted accordingly. Applications that tried to “guess” the appropriate font size based on screen resolution may need adjustments. Applications that used Settings.uiAdjustmentsBasedOnFontHeight should have their graphical components resized more uniformly across different platforms and screen densities.
Density Independent Pixels
Controls may now have their dimensions expressed in density independent pixels units (dp), which are scaled for the screen based on its pixel density. e.g:
// adds Button with height of 20dp
add(new Button("Ok"), RIGHT, BOTTOM, PREFERRED, DP + 20);
This is now the preferred way of setting the control’s dimensions.
Improved support for animations
We now provide a central update event that controls can register for. This event fires periodically and is meant to be used to drive all animations in the framework. In comparison to using timer events for animations, this approach uses less CPU and memory, and behaves better under high CPU usage scenarios.
Updating for 5.0Several classes were updated to use the new update events and the effect on them should be noticeable without any changes. In special, we would like to highlight the ScrollContainer and the ControlAnimation components. Users are encouraged to replace similar uses of threads, sleeps and timer events with update events.
Smoother scrolling
The ScrollContainer and the Flick components were updated to provide smoother and more precise scrolling. The changes include the usage of quadratic easing animation and exponential decay. The Flick also factors in the screen’s pixel density and offers the user the option of tuning the flick acceleration. Lastly, Flick also supports consecutive drags to increase the scrolling speed.
Updating for 5.0Most of the changes made are transparent to the user, but there were some breaking changes on Flick. User may have to remove the usage of fields that are no longer available.
Icon control
With the new Icon control it’s easier to add beautiful and meaningful icons to your application.
This is now the preferred way of adding icons to your application and should be favored over image files. One major reason to favor icon font sets over images is that they are highly scalable and will look sharp in any resolution while using only a fraction of the system resources an image would use. Material Icons are already bundled with the sdk and the IconType interface may be used to implement more font sets.
Alpha support for Labels and Icons
It’s now possible to change the opacity of text and icons within Label or Icon controls. This is a key feature to design beautiful applications, as it allows text to remain legible over any background color. Transparent status bar
Currently only supported on Android, but iOS support will be ready soon.
Navigation Drawer
All the previously listed changes were put in use to futher develop the SideMenuContainer, complying with the Navigation Drawer pattern defined by the Material Design guidelines (https://material.io/guidelines/patterns/navigation-drawer.html):
- Action bar height is now 20 dp
- Bar title and menu items using the Roboto Medium font (when available)
- Labels and icons now use the correct font size, weight and opacity
- Keylines and margins are respected both inside and outside the side menu (with a special exception for really small screens)
- Smooth slide-in and out effects, with fade effect during slide removed
- Resting elevation over the content
- Swipe to open support is still in its early stages, but should be functional for most applications
- Adjusts automatically when used with transparent status bar
- SideMenuContainer.Sub, a collapsible submenu for the navigation drawer
- MaterialWindow, a popup window that slides from the bottom to the top of the screen
- Camera: On Android, choosing an image from the Gallery no longer creates a copy of it when not necessary (images from a cloud service still require a local copy) - #400
- Java
- System: added method
arraycopy
- Charset: method forName now correctly validates the given charset name and may throw
IllegalCharsetNameException
- String: added constructor
String(byte[] value, int offset, int count, String encoding)
to allow the creation of strings with a given supported enconding
- Settings: deprecated field
WINDOWSPHONE
, which will be removed in a future release.
- Android: removed compile flag that caused applications to be unbearably slow in old or low-end devices - TotalCross#561, TotalCross#580
- tccodesign script: fixed script not copying pkg files - TotalCross#572
- Camera: partially reverted changes introduced in version 4.3.3 that caused problems on some devices - TotalCross#574
- Grid: fixed column width sizing - TotalCross#480
- tccodesign script: fixed support for push notification
- Added classes
AsyncTask
andThreadPool
to improve concurrency support, refer to the documentation and the PlayBook for more information and samples
- tccodesign script
- Added --output parameter
- Removed lined that deletes UIStoryLaunch
- Fixed icon problem
- Changed to use a temporary folder during the process
- Dropped support for Windows Phone 8
- iOS
- HttpStream: Query parameters are now encoded to support the usage of unsafe characters
- iOS
- Added implementation of PBKDF2WithHmacSHA1
- Removed SMS permissions from Android manifest when using the default deploy options, and added the new option /include_sms to deploy including them
- iOS
- Fixed screen dimensions on IPhone XS
- Resign script tccodesign:
- Fixed issue with provided mobileprovision not being added to the Xcode mobileprovisions folder
- Temp files are now removed before the script execution
- Fixed issue with certificate name in the following format: iPhone Distribution|Developer: Provided Name (Team ID)
- DiscoveryAgend: Fixed potential leaks when using service discovery on WinCE
- Removed SMS permissions from Android manifest when using the default deploy options, and added the new option /include_sms to deploy including them
- Added implementation of PBKDF2WithHmacSHA1
- Local notifications do not work on Android 8+. This is caused by a change in the security requirements of the Android native notification API that was not listed in the platform's release changelog. This issue will be fixed on the next release of TotalCross 5, but a fix for version 4 won't be issued to maintain our current compatibility with older Android devices.
- Vm.exec: Added permission REQUEST_INSTALL_PACKAGES to allow the application to install an apk on Android 8+
- TreeMap: Fixed import of java.lang.Comparable
- Scanner: Added camera permission request on Android (ZXing/Scandit)
- Fixed location permission request
- Camera: Removed picture rotation detection on Android - it was source of intermittent bugs on some Samsung and Motorola devices
- GPS permission is no longer requested when the application is launched, instead the permission is automatically requested when required by the application
- Fixed regression with the Android deploy that would produce an apk not acceptable by the Play Store
- Radio
- Fixed autoSplit when the control width is set to PREFERRED
- Camera
- Fixed CAMERA_CUSTOM not taking pictures when the device is held on vertical position, this affected a few models, most notably Samsung tablets - #233
- Container
- Method getChildren changed to return an empty array instead of null when the container has no children.
- Notification
- Clicking on a notification will no longer start a new instance of the application if there's already one running on background
- PushButtonGroup
- Fixed regression on PushButtonGroup that made them unclickable on Win32, affecting all dialogs - #263
- Added a new virtual keyboard that looks more closely to the Android native keyboard and is now the default for Edit and MultiEdit.
- Android
- Android package is now built with SDK 27 (previous releases were built with SDK 22) and the latest NDK r17b (up from NDK r8b!) - The minimum SDK level required to run TotalCross applications remains unchanged (SDK 10)
- Applied the Android recommended changes to better handle activities and contexts to prevent possible resource
- TotalCross now asks for the user permission to access phone state and location on startup
🚧 On Android, features that require user permission during runtime may not be working. Please report if you have any trouble with permissions.
- iOS
- iOS package is now built with SDK 12
- Added permission request to use the camera
- General
- Improved some Color methods to produce better results by properly weighting the RGB components according to our perception of color brightness
- Added support for local notifications on JDK, Android and iOS.
- EscPosPrintStream - New API to handle ESC/POS printer commands
- Added support for fast IDCT scaling on jpeg images. Combined with the usage of the new utility classes to manage scaling jpeg images, this can greatly reduce the memory footprint of jpeg images and improve graphical performance.
ℹ Using this approach to handle images of approximately 800x800 on medium sized devices can reduce memory consumption by up to 80% while doubling the image loading speed!
- Fixed bug during activation with some JDK versions - a FileNotFoundException could be thrown when trying to recursively create directories for a new file
- Deploy
- Added protection for unlikely (but possible) NPE
- Fixed deploy with Java 10, dependencies are now listed in the jar's Manifest
- Fixed rare (but possible) NPE during deploy
- Scanner
- Fixed barcode scanning on Dolphin/Honeywell devices - value of barcode's check digit was being carried over to the calculation of the check digit on the next reading - #228
- ComboBox
- ImageControl
- Removed duplicated field
effect
- Fixed detection of press events
- Toast
- Fixed Toast appearing relative to the
topMost
window, when it should always be relative to the MainWindow
- MultiButton
- Fixed graphical bug - a transparent ComboBox arrow was being drawn on the background of the MultiButton (!)
- PushButtonGroup
- Fixed drag event to allow "giving up" on a press event by dragging outside the button bounds after a press
- MultiEdit
- Fixed text being hidden with Material style
- Fixed bug that made every even character to disappear when you typed and reappear when you typed the next one
- AccordionContainer
- Fixed arrows not changing state when switching focus between multiple collapsible panes
- CalculatorBox
- Grid
- JSONFactory
- Fixed recursive creation of complex objects
- Improved JSON parser to map methods camel cased to underscored fields in the JSON object
- Updated version of the Bouncy Castle dependency
- Launcher
- The Launcher (simulator) can no longer be used without an activation key
- Deploy
- Check paths from pkg file and throw more meaningful error message when a path is invalid
- Print Deploy exceptions on System.err instead of System.out and using the default stack trace output
- ListBox
- Deprecated method
add(Object[] moreItems, int startAt, int size)
as it was redundant and more confusing than helpful
- ComboBox
- Deprecated method
add(Object[] moreItems, int startAt, int size)
as it was redundant and more confusing than helpful
- Radio
- EscPosPrintStream - New API which supports several ESC/POS printer commands - refer to the class documentation and samples for more information
- Notification and NotificatonManager - Allows the creation and presentation of local notifications to the user, currently implemented for Android, iOS and Java.
- ImageLoader - New class to help managing image resources, especially jpeg images. Currently no caching is done by the class.
- Image
- Added static methods
Image.getJpegScaled
andImage.getJpegBestFit
to load jpeg files using fast IDCT scale, more about this here
- Java
- Added classes ByteArrayOutputStream and UncheckedIOException
- Added classes Charset and UnsupportedCharsetException, added also
String.getBytes(Charset)
- Added Cp437CharacterConverter, which supports encoding and decoding characters using the CP-437 charset (also known as IBM437, windows-437, among others). Especifically added to be used with EscPosPrintStream to properly support writing text to Leopardo A7.
- Convert
- Added method
charsetForName(String name)
, which returns one of the registered charsets available - Added method
registerCharacterConverter(AbstractCharacterConverter characterConverter)
, which allows users to create and registers their own subclass of AbstractCharacterConverter to support custom encodings - Added several aliases to the existing ISO-8859-1 and UTF-8 CharacterConverter classes and changed
setDefaultConverter
to be case insensitive and support any of listed aliases.
The existing CharacterConverter class and subclasses were changed to extend AbstractCharacterConverter, which extends Charset. The actual support to Java Charset is almost none, the main goal is to allow the usageString.getBytes(Charset)
with the existing CharacterConverter and let users encode strings with different charsets without changing the charset used by the rest of the application through Convert.setDefaultConverter.
- ListBox
- Deprecated method
add(Object[] moreItems, int startAt, int size)
as it was redundant and more confusing than helpful
- ComboBox
- Deprecated method
add(Object[] moreItems, int startAt, int size)
as it was redundant and more confusing than helpful
- iOS
- Applications signed for enterprise distribution cannot run on iOS 12 - apparently it fails to validate the certification chain that validates the signed application. It's not clear yet if this was an intended change or a bug, but there's no word from Apple about it yet.
- Applications signed for distribution through the AppStore cannot be uploaded because of changes on the way image resources are handled starting from iOS 11. We are working on a definite fix for this, in the mean time feel free to contact us to manually package the application for the AppStore.
- Notification
- Android lacks support for custom images for notifications, only the default TotalCross logo is supported
- PushButtonGroup
- The fix for the drag event caused PushButtonGroup to be unclickable on Win32, affecting all dialogs - #263
- TotalCross is now built with the iOS 11 SDK, as a side effect the minimum iOS version supported by TotalCross is now 8.0 (up from 5.1.1). Applications published on the Apple Store must be updated.
- Fixed Edit's material caption animation when navigating using the keyboard
- Fixed
WrapInputStream.read()
- the value returned is now between the range 0-255, as specified by theInpuStream.read()
documentation. The classWrapInputStream
is used byStream.asInputStream()
- Fixed
MaterialEffect
to stop discardingPEN_UP
events sent to the target Control after the effect is removed from the target Control - Implemented
ConnectionManager.getLocalHost()
for iOS - On iOS, fixed keyboard being closed when navigating to the next text input control using the "Done" button
- Fixed
SideMenuContainer
- the sidemenu is no longer draggable - Fixed retrieval of the device's current time on newer Android devices (and possibly other POSIX compliant platforms) - #147
- Fixed javadocs not being included with the SDK
- Usage of
Vm.sleep(1)
in the SDK replaced withThread.yield()
for clarity sake - Changes
LineReader
to useThread.yield()
between read attempts instead of stoping the Vm for 100 ms - Spinner's implementation changed to use TimerEvent instead of threads perform the animation
- Edit's material caption animation is faster and will no longer get mixed with the blinking cursor
WrapInputStream.read(B[], I, I)
no longer rethrowstotalcross.io.IOException
asjava.io.IOException
WrapOutputStream.write(B[], I, I)
no longer rethrowstotalcross.io.IOException
asjava.io.IOException
WrapInputStream.close()
will now properly close the underlying streamWrapOutputStream.close()
will now properly close the underlying stream- Changed the way we obtain the current device orientation and screen dimensions on Android, the previous implementations were deprecated
- Fixed support for WinCE based scanners that use OpticonH16.dll
- Added support for native laser scanning for Android based Symbol/Motorola scanners
- Launcher default color depth changed from 16 bpp to 24 bpp
- Fixed
Switch
disappearing on Android - calculation of alpha channel applied to the switch was wrong - Fixed
Socket
andHttpStream
to properly handle EOF during read operation - Fixed screen not being shifted when device is in landscape
- Fixed issue where a focused
Edit
would not receive keypress events - Fixed bug in
Edit
on Android - backspace events would not be issued when the Edit had text but had not received any typing events