Jump to content

Is Smart Mobile Studio right for me?

Recommended Posts

I'm a long time Delphi programmer and I want to get into writing iOS and eventually Android apps. Many of these apps will need to use a local database, like Sqlite, preferably with encryption. I can't rely on the user having internet access when using my apps.


1) Can SMS do CRUD on a local Sqlite database using Pascal code? Or does the Db access have to be written in  JS? Are there any examples or links for local Sqlite CRUD in SMS?


2) Can I access sensors in iOS like the accelerometer, compass, camera, shake motion, camera using Pascal code?


3) How fast are gestures and GUI controls in SMS?  One of the key reasons for using XE4 as your iOS development platform is they claim the controls respond faster because it is a "native" application. Has this been a problem in SMS?


4) Is there any problem getting an SMS app approved for the Apple Store?




Link to post
Share on other sites
  • Administrators

You should give it a try, at least. That is free, and there's no registration required. Just install the full version and play around: http://smartmobilestudio.com/trial/



There are basically two different ways to build and distribute your Smart applications. The first is to crate pure "web applications" that runs in the browser. Web applications build with Smart are capable of doing everything an ordinary HTML/JavaScript application can do. If it can be solved using web technology, then it can be solved through the Pascal language in Smart... This also means that we have to play by the restrictions and limitations that exists in the various browser. If a browser doesn't support a particular feature - then we cannot support that feature in Smart either. Obviously. More and more browsers supports most of the HTML5 W3C specifications, and that makes them capable of doing advanced stuff directly in the browser. Such web applications can be run off-line, and distribution is done directly via browser. Not via app store. WebSql and Accelerometer are examples of features that are supported in some browsers, but not all.


The other approach is to use PhoneGap as a "shell" or a layer between the Smart application and the phone hardware. The PhoneGap API provides access to several phone features that are inaccessible trough the browser. Eg. camera, contacts and the file system (Se full list at http://docs.phonegap.com/en). This PhoneGAP API is completely implemented as wrappers in Smart, and thus you can access all these features trough plain Pascal classes.


The "Phone Wrapper" is one side of the PhoneGap solution, "compiling to native" is the another. You upload the generated Smart solution to the PhoneGap build service (build.phonegap.com), and PhoneGap generates multiple "native apps" for several platform automatically. Android, iOS, Windows Phone, webOS, Symbian, BlackBerry and more from the same source code. These generated "native apps" must be distributed according to the guidelines at the various eco systems. I write "Naive" because these solutions run as native apps in the phone, but the content of these app are HTML/JavaScript.

(Might be compared to something like a Delphi project with only one client-aligned TWebBrowser in it.)




1) Take a look at: http://smartmobilestudio.com/2013/01/08/working-with-websql/ and http://smartmobilestudio.com/documentation/real-data-talking-to-sqlite-and-the-local-storage-api/


2) Some of them are supported in some browser (eg. geolocation and accelrometer). Everyone trough PhoneGap.


3) We haven't received any negative feedback on this. You could check the multi touch responsiveness with Primoz' multitouch demo:

- Article: http://www.thedelphigeek.com/2012/01/handling-touch-events.html.

- Source code: http://www.gabrijelcic.org/Smart/MultiPaint/MultiFingerPaint.zip.

- Live demo: http://helga.gabrijelcic.org/Smart/MultiPaint/


4) No problems (other that the problems you normally meet :-)

There are Smart apps available in Apple Store and Android Store already.


Link to post
Share on other sites



Thanks for the links. I did not realize that "websql" was actually Sqlite.  That certainly helps me get started.


I have downloaded the SMS eval and I'm digesting it now. [burp!]   I'll no doubt be posting more questions/suggestions in the next 30 days. I'm reading The Book and when I get through the intro I'll order the rest of it.


I've heard a lot of good things about SMS and I'm surprised there is not more activity on these forums.  Is it always this dead around here? I suppose that is a good thing because it doesn't look like people are having a lot of problems.  Are these the main support forums for SMS?




Link to post
Share on other sites
  • Administrators

Just let us know if you have any question during your trial period - or if you need to extend your trial.


You can ask questions at this forum for general discussion. We want this forum to be less formal and an area where users can discuss various topics. I'm afraid that a couple of usability issues hinders some of the activity. Search, for instance. (The search is returning the correct results, but you have to browse trough several pages to see the various results).


There are also a few sharp users that follow the "Smart-Mobile-Studio" tag at StackOverflow.com. If you are familiar with this site you can probably imagine which questions to put over there. We would actually love to have more questions posted at SO, so feel free to ask them there.


You can also ask questions directly via mail to support@smartmobilestudio.com (you'll find a link in the header of this page, too).

Link to post
Share on other sites
  • 2 months later...

Hi Jorn,


Just bought a license for SMS, because I am quite confident that SMS will be able to deliver what I'm trying to develop. I am also a long time Delphi developer and

I have a couple of questions/remarks, some might be answered already. Maybe you can point me

to these answers or provide answers.


- How do I use javascript libraries, like JQuery, in SMS? Is there an example on this subject?

- Where can I find examples of usage of the PhoneGap wrappers?





Link to post
Share on other sites

Probably not the best answer, but it should be good enough to get started.


About how to use libraries, you can look at the Box2D example, which wraps the Box2dWeb javascript library for Smart Mobile Studio.


Until now, we don't have a (perfect) tool at hand that generates wrappers for JavaScript libraries automatically. However, we are already working on it. For example there are tools to translate WebIDL code to Smart Pascal code. Also we have a TypeScript converter available (written in SmartMS itself), that allows to wrap APIs available in TypeScript easily. Since for TypeScript most APIs are already translated (see https://github.com/borisyankov/DefinitelyTyped), this is possible the best we can do at the moment.


Right now we have the following libraries wrapped:


* box2d

* d3

* easeljs

* flot

* jquery

* jquerymobile

* MongoDB

* NodeJS

* phonegap

* preloadjs

* socket.io

* soundjs

* tweenjs


While the conversion is probably not perfect, it's a good start. I don't know when or how it will be available, but I guess it is planned for version 1.2. At least this is the earliest date when we can ship the converter (if we ship it at all), as it uses NodeJS.


At the moment there is only one small internal example available on how to use the PhoneGap wrappers. However, it should be quiete easy to work with the PhoneGap wrappers. Once you are using the PhoneGapAPI.pas, just use the static PhoneGap class to access all the basic internal APIs.


Just make sure the API is "ready". To do so, pass an event handler via OnReady(). Once the event handler is started all APIs are ready to use.


On the other hand, the real power of PhoneGap comes when you start to use plugins to access further native functions of the device. That is in particular interesting as the basic APIs are often already covered by HTML5 standards already (e.g. accelerometer, geolocation etc.).


Right now we don't have yet a mechanism to use any of these plugins easily. You need to write wrappers for these yourself and extend the basic API manually. Alternatively you can of course always access the plugins via assembler directly, but that's probably not what you want.


If you have in detail questions, feel free to ask for help. If it is of general nature we can surely help you and if it is a very specific issue, we can probably forward it to experienced users/freelancer.

Link to post
Share on other sites

The wrappers are not yet available, nor am I sure, that these are fully working/tested yet. Even with automatic conversion (which can not be 1:1 at the moment due to language differences, nullable types for example), a lot of manual work is needed to make the code work as expected.


I would suggest to get used to SmartMS and how to develop code with Smart in general first. Often you don't need external JS libraries to achieve what you're looking for. In a few months (hopefully sooner than later) we'll get the version 1.2 update ready, which should probably either ship the converter and/or the wrapped libraries.

Link to post
Share on other sites
  • Administrators


There are a few different ways to wrap external libraries (and external js-code in general).


Take a look at the "Libraries" folder (short cut from the "Smart Mobile Studio" item in the Windows Start menu). Box2d is a good place to start, since you will also find a nice demo (two demos, actually) in the "Demo" folder.


Keywords for wrapping JS-code/JS-libraries:

- asm block (to write JS code directly in your Pascal code)

- variables prefixed with @ inside the asm block (maps to the corresponding pascal variable)

- variant variable (can hold and access a complete JS-object, such as a JSON structure)

- external method/external class (can map a pascal declaration to a JS implementaton)


Hope this will get you started...



Regarding jQuery-wrapping, I would recommend you to try to stick to pure Smart to begin with. Even though jQuery/jQuery Mobile/jqTouch are very popular libraries, our experience is that a pure Smart-solution is easier to create and maintain, and it will actually perform better. We have compared and tested a few projects, and you can create faster and smaller projects by using Smart-components. In v1.2 we will open for registration of custom components in the IDE, and then you will get access to even more components. Hopefully we will be able to establish a community for third party components as well.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...