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.
The different stages available are: Pre-Build, Pre-Link & Post Build. The first stage is executed before any compilation takes place. It can be used to build/copy/pre-process some code that is used by the compiler. This can be useful to update externally generated interfaces to external JS code automatically on each compilation.
The final post-build stage is executed after the build process is (nearly) done. Within this stage the output can be post-processed or uploaded. It might be the most useful stage, as there might be plenty of things you’d like to do with your application. Typical use cases of the post-build would be to upload the entire application to a certain location, typically done via FTP.
You may also want to trigger a PhoneGap / Cordova build, resulting in an APK file suited directly for native testing on an Android device. This can then be transmitted to services such as Testdroid to test your app on real devices. Or maybe you only want to backup your code on each compilation…
The least the build script offers is to call system functions. So in case you have already written some batch files, you can just trigger these from the build script. For these needs a close wrapping of the Win API function ShellExecute is available. Similar to Delphi, this is called asynchronously. Which means Smart Mobile Studio immediately returns, so that you can continue working on the code, while the batch file is executed in the background. However, in some cases a synchronous call is required, which at the same time blocks the IDE from continuation. For this case a special command is available called ‘Call’:
procedure Call(FileName: String; Parameters: String = ''; Path: String = '')
With SMTP you can email the project or only a notification to any address. Or only trigger an automatic notification, that the project has been built. All with the flexibility you are used to from Delphi. While you have high level access to the related classes you can also use custom-tailored functions for typical access such as:
procedure Upload(FileName: String; Host: String; UserName: String = 'anonymous'; Password: String = 'anonymous'; Path: String = '');
procedure SendEmail(Host: String; Recipient: String; Subject: String = ''; Body: String = ''; Attachment: String = '');
Beside basic internet access, you also have in depth access to some of the TurboPower Abbrevia classes used for zipping. Furthermore it is possible to query information from the project.
At the moment the options for this are limited, but more and more options will be added in the future.
Despite being under development as well, some basic access to Cordova is also available. Though it’s recommended to use batch files instead. With Cordova it’s possible to transform any HTML5 app into a native application. While this still uses HTML5 rendered through a browser view for the UI, it extends the possibilities to access the hardware natively.
With the next minor updates we plan to refine the build system even further. For example it shall be possible to get basic access to the code to extract symbols, expressions and more. With this (and some yet unpublished code) it is also possible to build a documentation along with the project.
With the next major version we also plan to add support for our own cloud solution, to transfer the app directly to the Smart Mobile Studio ecosystem. But that’s content of another post, some day in the future…
So let’s focus on the upcoming release right now, as it is mandatory to give you all this nice stuff described above!