Recently there was a question about how to host Smart project on a dedicated small server to provide access in a sort of a kiosk application way. At the moment there are dozens of examples available as also shown in the Node.js on a RaspberryPi post . In contrast to microcontroller boards, this post will feature an overview over small boards, which are perfect to deliver your Smart application to a small group of clients.
Category Archives: Developers log
Smart Mobile Studio 2.1 (beta-1)
Version 2.1 of Smart Mobile Studio will soon be released.
If you would like to give this a try, you can download the installer here:
A valid license key (trial or subscription) is required.
NOTE: Since v2.0 isn’t forward compatible, you can’t open v2.1 projects in v2.0 anymore. Make sure to always backup your projects case you want to revert to v2.0 again.
—
Sincerely,
The Smart Mobile Studio Team
Smart Mobile Studio 2.0 (Hotfix 2)
The next version of Smart Mobile Studio (v2.1) is right around the corner.
We do, however, need a bit more time than first anticipated on testing and quality assurance for this release.
Thus we decided to release another hotfix for v2.0 to support the users who needs these fixes.
You can download Smart Mobile Studio 2.0.2 from the downloads section, which includes this ‘hotfix 2’.
Changelog
Fixes
- Fixed compiler bugs.
- Improved command-line compiler (more independent now).
- Source code highlighter for bg color of active line.
- Underscores allowed in component names.
- ShowMessage bug under Chromium.
- Update of Top/Left properties when dragging components.
- Update component color properly.
- Improved CTRL+Click in source code.
- Save “whole word” option in search dialog.
Download
You can download Smart Mobile Studio 2.0.2 from the downloads section.
—
Sincerely,
The Smart Mobile Studio Team
Smart Mobile Studio 2.0 (Hotfix 1)
While we are hard working on the next release of Smart Mobile Studio (few hints: docking, debugging, HTML projects) we also want to support existing 2.0 users. We have fixed bugs that were reported since version 2.0 and even added few improvements which didn’t make it into the original release.
You can download Smart Mobile Studio 2.0.1 from the downloads section.
Changelog
Fixes
- Fixed compiler bugs.
- Fixed command-line compiler.
- Project, Show application unit could be executed when no project was open which resulted in access violation error.
- Expand classes and Expand all actions in the Unit structure window were disabled for external forms.
- Alignment problems of the component palette when program is not started maximized.
- In-memory state was not refreshed after RTL reindex.
- If the RTL database cannot be loaded during startup (even if index file exists), it is automatically reindexed.
- Access violation in Options if no project is selected.
- Program terminated instead of asking for license when not running maximized and valid license was not found.
- Fixed implementation of the Focused property.
- Fixed TPointF.Displace function. Better implementation of TPoint.AngleTo and TPointF.AngleTo.
- Fixed project loading code. Project files referring to missing files can now be opened.
- Fixed links on Welcome page.
Changes
- Disabled Project.Export project, which was not implemented.
- Disabled Build Documentation menu which was not fully implemented.
- Exception logging is built into product.
- Updated CSS for the grid component.
- Class Browser is temporarily disabled (it was not working properly). We’ll fix it in the next “normal” release.
New Features
- Added grid methods TW3Grid.AddCells, TW3Columns.Clear, TW3Columns.Delete and properties TW3Column.Alignment, TW3Column.Color.
- Added grid demo.
Known issues
- [CTRL] + Click on a unit might open the wrong file if Source Maps are/were used for debugging and the directory ..\www\debug is still present.
Download
You can download Smart Mobile Studio 2.0.1 from the downloads section.
—
Sincerely,
The Smart Mobile Studio Team
Working with the grid component (part 3)
Working with footer
Beside Column’s headers, you may show footer cell for each column. In footer you may place simple text, or you may show result of formula.
Footers are not visible by default. To show footers set ShowFooter
property of W3Grid to True
.
To access Column’s footer object, use Footer
property of Column. Header
and Footer
both share same ancestor and properties such as Caption
can be found in Footer too.
Working with the grid component (part 2)
In this article we will further explain every part of working with W3Grid. Make sure to read Part 1 before reading this article.
Working with the grid component (part 1)
Smart Mobile Studio 2.0 introduced an important visual component – a grid. As its use is not obvious, we have prepared a series of articles which will introduce the component and demonstrate the usage. Articles are written by the author of the grid component, Bojan Nikolic (Berg Soft).
In this article we’ll cover the most basic steps in grid usage.
- Placing W3Grid on a form
- Adding columns and setting column properties
- Adding rows and filling cells with data
Smart Mobile Studio 2.0 beta 2
We have received lots of useful feedback from the first beta version of v.2.0. Though, there were more issues than expected, which is why we decided to add another beta version that fixes several critical issues. The current beta should now work quite smooth, despite several minor issues that need some fixing until we have a final release (see ‘Known Issues’).
Licensing
With the new beta version, we also updated the license system, which means that new license files are required. For testing/demoing a beta license is included in the installer. Keep this in mind when you try to run the beta with your old license file (will not work) and use the license file provided by the installer.
The beta is open for everyone, so no registration is required to demo our product.
Changelog
For a full list of changes for Version 2.0, please see the dedicated post “What’s new in Smart Mobile Studio 2.0”
In addition to that here’s a changelog from the previous beta version.
Fixes
- No AV for event “building” (on component/event doubleclick) anymore
- Copy, Cut & Paste were not working (properly) in Visual Designer
- RTL indexing (but still not properly used)
- Better [CTRL]+[DOWN] (goto implementation), sometimes navigated to a slightly wrong position
- Removed some memory leaks
- Fixed unicode issue in visual designer (see ‘Known Issues’)
- Some preferences were not saved properly
- Commandline compiler now works with missing templates
Changes
- Command line compiler is purely command line now (smaller size)
- Faster loading of visual designer (delayed loading of ‘Live Preview’
- Improved ‘File’ menu structure
- Menu item ‘Preferences’ moved to ‘Tools’
- Improved ‘Options’ dialog (compiler tab)
New Features
- Added package for Grid
- Added ‘Save As…’
- [ALT] + [DOWN] will cycle through components in visual designer
- Added some wordstart editor commands, but yet partly occluded by IDE shortcuts
Download
Download the beta 2 installer [89 MB].
Known issues
Compiler/Codegen
- Application title is typically not transported to HTML file (case #931)
RTL
- Packages can not yet contain CSS code for styling
IDE
- Minor glitches in source code proposal dialogs (items missing, in particular in .spr file) (case #930)
- Some available Wordstar shortcuts conflict with other shortcuts (case #723)
- Source scanning update interval internally fixed to 1000 ms, regardless of the settings (case #926)
- [CTRL]+Click does not work for scoped unit (case #641)
- Microcontroller (Espruino) support still experimental (will be official available in mid-January, cases #797, #819)
- Unicode issues for some non-common, foreign characters (case #913)
- New Visual Designer issues
- Components might get invisible (use instance select combobox, case #875)
- Opacity = 0
- Beyond boundaries / off screen
- one dimension is zero
- Multi-select not yet working (while it appears to be, case #903)
- Bring to front / send to back might not work properly (case #917)
- Non-Nudgeblock feature not yet available (case #888)
- Live Preview is only working in legacy mode (will be updated in v2.1)
- Components might get invisible (use instance select combobox, case #875)
- Welcome Page outdated and not customizable (case #899)
—
Sincerely,
The Smart Mobile Studio Team
New Package Manager
With version 2.0 we have spent some precious development time into a new package manager. Similar to other solutions it allows to separate components into packages that can be independently installed in the IDE. Although there is no imminent need for it right now, it opens the IDE for 3rd party and user components that can be integrated into the RAD environment easily.
While there is still some work ahead to iron out some teething problems in the upcoming beta version, it is already used in combination with the new visual designer and its basic set of components, called the “Smart Component Library” (SCL). In addition to the basic set of components, two additional 3rd party packages are shipped with the product TeeChart.spk (by Steema Software) and Grid.spk (by Berg Software). The packages are built to integrate neat-less into the IDE’s component palette.
Furthermore we added an example package called W3Slider.spk with embedded source code. It is designed according to the all-in-one-file approach, that can also be used for the project. With packages designed like this, installation can be as easy as dropping the spk file to the ‘Packages’ folder. In the future we will also add support for encrypted package source code, so that it is possible to build closed source packages.
Implementation Details
While the amount of changes (compared to Version 1.x) in this regards seem to be very little, it meant infact to rewrite the entire chain of handling components (in the component palette, visual designer & property inspector) from scratch. Previously all components were “hard coded” in Delphi, which means for every new component we added, we needed to update the component palette, add a dedicated Delphi component for the visual designer & property inspector, convert from Delphi to DWS at compile time and handle property storage in form file. All this code was convoluted in several manners and one couldn’t change one part without affecting other parts in the IDE.
Since we wanted to rewrite the visual designer, we had to rewrite the entire package system as well. Despite the fact that the development of version 2.0 took longer than expected, we now have a system that is perfectly decoupled in the aspects of package manager, visual designer, component palette, property inspector and form handling. It will allow us to maintain and improve each aspect separately. Also it will be possible for us in the future to switch to a JavaScript powered designer, which might allow you to create your layout on the destination device (e.g. iPhone) directly. This allows you to let a designer or even the management redesign the GUI remotely while you can focus on the code…
But let’s stick on what we have now, let’s stay on topic! The packages are basically in a similar XML format as your projects, which means you can – in case of emergencies – edit (and eventually fix) the packages at any time. This can be quite useful, since at the moment the GUI part of the package manager is limited to the essentials. For example it’s not possible at the moment to specify different categories for different components in one package. So far you may only specify one category per package, while the packages would allow an even more detailed specification of categories (per component). Also it’s not yet possible to change/specify icons for a component other than by editing the package files.
But of course you don’t need to know all the details if you only want to work with the packages, so let’s move on to the next chapter.
Package installation / usage
The installation of packages is very easy. All you need to do is to drop the package to the ‘Packages’ subdirectory.
Note that it might also be necessary to add glyphs for the component palette to the glyphs directory, but that depends whether the icons are specified internally or externally. At the moment a basic set of (external) glyphs is shipped with the product. We decided to make them available externally, so you can change them anytime to your favorite set of icons (the current icons are not always as clear as possible).
Once you have added/removed a package to the package subdirectory you have to restart the IDE in order to get the packages enumerated and listed in the component palette. If you have deleted a package, it will remain in the IDE’s cache until you restart the IDE.
After the packages have been installed, you can use the components in the same manner as you used the components in version 1.x.
Smart Mobile Studio 2.0
This is a list of all changes since the last official release (1.1.2).
Compiler
New functionality
- Added command line compiler smsc.
- Added support for external variables and external class variables.
- Scriptable HTML templates and CSS scripts.
- CSS is compressed during compilation.
- New ways to include an external resource:
- {$R ‘resource.js’} or {$R ‘file:resource.js’} will copy the resource to the ‘res’ folder during compilation and link it into the program (‘<script>’ statement will be generated in the HTML code or ‘require’ will be generated for NodeJS code).
- {$R ‘http://server/path/script.js’} or {$R ‘https://server/path/script.js’} will just link the code to the program without copying anything.
- You can specify MIME type for the resource by prefixing it to the resource name: {$R ‘text/javascript:http://server/path/file.php’}. If the MIME type is not provided, it will be generated automatically from the extension part of the resource name.
- Compiled program is stored in a ‘www’ subfolder (previously it was stored in a ‘bin’ subfolder).
Improved functionality
- Improved codegen for static and static sealed classes.
- Improved codegen for “new JObject”.
Bugs fixed
- Fixed various codegen problems related to constant arrays, external classes and nested records.
RTL
New functionality
- Added support for the Espruino microcontroller.
- Added wrappers for JavaScript functions prompt() and confirm().
- Added support for Android Home Screen applications (http://www.delphitools.info/2013/10/16/chrome-web-apps-in-android/).
- Added TMetronome class (http://www.delphitools.info/2013/10/18/time-stepping-for-games-and-simulations/).
- New units: w3WebWorker, w3c.WebSpeechAPI, Chrome.Serial, Firefox\Bluetooth.
- Added methods to the w3colors unit.
Improved functionality
- Redesigned (faster) GameView.
- Improved TW3Button with ‘pressed’ state.
- More IE shims.
- Improved W3Effects.
- Improved ColorToWebStr.
- Improved TW3BufferedImage.SetSize.
- Improved compiler messages window.
Bugs fixed
- Fixed System.Diagnostics performance timer fallback (for Safari).
- Fixed HSL delta methods in w3colors.
IDE
New functionality
- New visual designer.
- New component package manager.
- New project file format, incompatible with older Smart versions. Projects are now stored with a .sproj extension and forms with a .sfm extension.
- New, XML-based preferences file (preferences.xml) replaced INI-based file (preferences.ini).
- Added NodeJS and WebWorkers project types.
- Added tool that creates DataSnap service connector (Delphi Enterprise must be installed on the same computer).
- Build automation with build scripts.
- Source maps.
- Lines/blocks can be moved up/down with Alt+Shift+Up/Down.
- Internal browser allows taking screenshot of the running application.
- Configuration option “Save projects before compilation”.
- A project can be compiled and run even if it was never saved.
- Implemented Open, Save, Save As, Save Project As.
- Metadata information can be set for a project.
- IDE state related to the project (open tabs, top line, bookmarks) is stored in the <projectname>.dsk file and is restored when a project is open.
- Redesigned template (HTML and CSS) handling.
- Ctrl+click ‘link’ highlighting.
- Source code change bar to indicate changes (original, modified, saved).
- Default project options for each project type can be configured.
- Added compilation options ‘Automatically refresh in browser’ and ‘Handle uncaught exceptions’.
- Added support for defining conditional compilation symbols on a project level.
- Redesigned ‘run’ experience (http://smartmobilestudio.com/2013/10/12/new-ways-to-run-a-project/).
Improved functionality
- Project title can contain spaces.
- Custom HTML & CSS code is now separated from general resources
- Better structure of project options (removed dead settings)
- Application adapts to low-resolution displays.
- Improved HTML highlighter, now supports embedded JavaScript, DWS, and CSS.
- Dotted unit names are supported.
- Snippets are stored in a separate folder, one snippet per file.
- Redesigned server/internal browser forms and execution options.
- Added shortcuts to toggle Compiler Messages and Mini Map visibility.
- Improved renaming of units.
Bugs fixed
- Code completion works in .spr files.
- Highlighter preview (in Preferences) uses currently selected editor font.
- Configured editor font is correctly displayed when Preview dialog is open.
Removed functionality
- Compact toolbar.
- Exit button in the toolbar.
- Removed ‘Visual components project (New Project Script Demo)’ project type.
Other
New functionality
- New demos: eSpeak, TransitionEffects, Complex Numbers.
- Added touch and acceleration support to the “Box2D Demo” project.
Changed
- Renamed some demos (removed ‘by XXXX’).
Removed
- Removed demo “Box2D Integration”.
How to use Cordova
While the next version 2.0 is still not entirely ready, here’s a post about how your HTML5 application can be converted to a native application with Cordova (the open source base of PhoneGap). It’s a bit more tricky than with PhoneGap, but completely free of any costs and you don’t need to transmit your application to any server, which might be in times of NSA surveillance always a bit critical.
The tutorial below only covers the basics. If you want to use plugins to enhance the native experience (e.g. to access hardware directly), you need to consult the plugin’s documentation.
Continue reading
Smart Mobile Studio v2.0 (beta)
Version 2.0 of Smart Mobile Studio will soon be ready for the release.
Over the last few days, we have distributed a private beta to some selected users, and now we would like to make this available for everyone.
We know you have been waiting for this – and so have we!
Download the installer and follow the instructions.
We hope you’ll be as excited about this release as we are 🙂
—
Sincerely,
The Smart Mobile Studio Team
New build system
At the moment we’re already in the last stage of testing before the next version 2.0 will be released as beta. We hoped to make this happen in November and it still might, but probably at the very end of this month as there are still about 30+ issues that need to be resolved before a beta release. Most of them are tiny things, but there are still some heavy one, that needs more work than others. As you are developers as well, you probably know what we’re talking about…
In the meantime, this post is meant to give you some ideas of what will be possible with the next version. The main topic is about the new build system. With this it is possible to inject custom code at several stage during compilation.
Continue reading
Micro-controller programming
While it might sound ridiculous in the first place, the new version 2.0 (planned for November, but slightly delayed) will ship with RTL units to make micro-controller programming possible. So it will be not just possible to develop very high level code with Smart Mobile Studio, but also to address the very low end. Also it’s not just a remote control, but really a programming of the hardware. With this the internet of things is not science fiction anymore, but can be reality under your hands!
With the help of Espruino it’s possible to program a micro-controller with Javascript. In conteast to the classic way of programming, the JavaScript code is only interpreted by the micro-controller. The hardware is accessed and handled internally by the firmware with low-level, high performance code, which can be scipted interactively by the standarized ECMAScript (better known as JavaScript). This event based language is well suited for micro-controllers.
So far several different boards are already supported by Espruino, which includes dozens of boards based on the STM32 microcontroller, but also other devices like the Raspberry Pi. A list of working devices is updated constantly on the Espruino’s github site.
Thanks to a very successful kickstarter project (in which we also invested some money), a special board has been developed by the Espruino developer, that is designed perfectly designed for the purpose of internet for things. Compared to other devices it is quite small, highly efficient (low power consumption) and ready for easy wireless access (either with Bluetooth or WiFi). The current price of 34.99$ (around 25€) makes it especially suitable for any device you want to bring to the internet.
The favored Espruino board incude the interfaces I²C, SPI, USART and CAN and features ADC, DAC, PWM and an SD card connector. Furthermore an option for Bluetooth/Wifi and an external clock can be attached. A large prototyp area with the option to host arduino shields makes it ideal for any type of project.
In combination with Smart Mobile Studio, the JavaScript interface is used as intermediate language. Our compiler condenses high level & well structured code to a minified, micro-controller optimized code that might be ugly to read, but fast to execute. In addition to the hardware drivers it will ship with several units that make access to the hardware even easier.
The code runs directly on the hardware and can be deployed either via USB or wirelessly via Bluetooth. Thus remote programming is possible. If you decide to make the code persistent (to survive a restart), just add a ‘save;’ (… to flash) to the end of your code.
With this solution cro-controller, but also reuse and interface existing code easily. By using conditional compilation you can even make the same code compatible for all supported boards (e.g. Espruino board, Raspberry Pi and Sony Smart Watch).
And not to mention the fact that you can easily write a remote control for the hardware easily with Smart Mobile Studio.
At the moments we’re still working on the basics, but a lot of things are already possible. For now you can have a look at an older video posted about 3 months ago, but we’re also working on newer videos to give you some more ideas of what you can do on the lower end with our new Smart Mobile Studio 2.0.
New ways to run a project
While we are very busy working on the next Smart release (2.0, scheduled for November), some parts of the new version are already completed. As we can’t release an alpha or beta version now (it’s just not there yet), I decided to write few short posts as new features reach maturity. The first part of Smart I’d like to talk about is the redesigned ‘Run’ experience.
In the Smart v1, results of Run depended on few options that were partly set in the Preferences and partly in the Options. The result was a bit confusing so we decided to clean the interface and improve the experience. In the v2 release, the only option to be set in the Preferences is the server port. Everything else is configured in the project Options.
Following execution targets are supported: internal browser (Chromium, built into Smart), default browser, custom browser (you can specify the command line). The latter two can be served from the file system (if “Use built-in server to run application” is not checked) or from the internal server. If the internal browser or server are used, the browser/server window is displayed.
The Browser tab displays the running program (just as in v1) using the built-in Chromium. The Source code tab displays the compiled program. The Server tab displays the QR code which you can use to quickly open the program in a mobile device.
You can also click the “Open in browser” button to open the program in the system default browser and the photo icon on the right to create a snapshot of the internal browser window.
The last trick we have added is that you can set up your program to be automatically reloaded when it is recompiled. Just go to the project Options and check “Automatically refresh in browser”.
If you now run the program (in any browser type), change the program and recompile, it will be automatically reloaded in the browser.