Smart Mobile Studio
  • News
  • Forums
  • Download
  • Store
  • Showcases
    • Featured demos
    • The Smart Contest 2013, Round 1 – Graphics
  • Documentation
    • Get the book
    • System requirements
    • Prerequisites
    • Getting started
      • Introduction
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • Themes and styles
    • Project types
      • Visual project
      • Game project
      • Console project
    • Layout manager
    • Networking
      • TW3HttpRequest
      • TW3JSONP
      • Loading files
  • About

Monthly Archives: December 2014

Using DataSnap Connector Importer

Posted on 20.12.2014 by gabr42 Posted in Documentation, News

This tutorial shows how to use DataSnap connector in the Smart Mobile Studio Enterprise.

Server

Firstly, create a DataSnap server. In this example we are using Delphi XE7 but any older version will be OK as long as it can create a REST server.

Start by creating new project. Select DataSnap REST Application from the DataSnap Server branch. It is important to create REST server as Smart doesn’t work with binary data format used in MIDAS-based DataSnap server.

Create DataSnap REST server

Continue reading→

Writing REST Clients with Smart 2.1.2

Posted on 14.12.2014 by gabr42 Posted in Documentation, News

Besides a bunch of fixes, Smart 2.1.2 introduced a new unit, SmartCL.Inet.REST. This unit greatly simplifies writing REST clients in Smart. A simplest way to introduce it is with an example.

Introduction

Let’s say we have a REST server listening at http://someserver/hbbtv/streamevents. It supports one request – PUT – and three parameters – applicationid, eventid, and eventdata. To send a request, one would just open a HTTP connection (TW3HttpRequest would do that for you in Smart) and send something like http://someserver/hbbtv/streamevents/applicationid=1&eventid=233&eventdata=Test (or http://someserver/hbbtv/streamevents/1/233/Test if your REST server is not completely braindead). Still, you would have to set up the TW3HttpRequest object, concatenate the URL and parse the response. And whenever you write some code, there’s an opportunity to introduce a bug so it’s best if you code as little as possible.

The REST client for the example above can be written in one statement.

REST['someserver', '/hbbtv/streamevents']
  .Get([1, 233, 'Test'])
  .OnDone(lambda (http) Log('Event sent'); end)
  .OnError(LogHttpError);

Continue reading→

Pages

  • About
  • Feature Matrix
  • Forums
  • News
  • Release History
  • Download
  • Showcases
    • The Smart Contest 2013, Round 1 – Graphics
  • Store
  • Documentation
    • Creating your own controls
    • Debugging, exceptions and error handling
    • Differences between Delphi and Smart
    • Get the book
    • Getting started
      • Introduction
      • Local storage, session storage and global storage
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • pmSmart Box Model
      • Themes and styles
    • Layout manager
    • Networking
      • Loading files
      • TW3HttpRequest
      • TW3JSONP
    • Prerequisites
    • Real data, talking to sqLite
    • System requirements
    • Project types
      • Visual project
      • Game project
      • Console project

Archives

  • December 2019
  • December 2018
  • November 2018
  • July 2018
  • June 2018
  • February 2018
  • September 2017
  • April 2017
  • November 2016
  • October 2016
  • September 2016
  • April 2016
  • March 2016
  • January 2016
  • October 2015
  • September 2015
  • July 2015
  • April 2015
  • January 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • November 2011
  • October 2011
  • September 2011

Categories

  • Announcements (25)
  • Developers log (119)
  • Documentation (26)
  • News (104)
  • News and articles (16)

WordPress

  • Register
  • Log in
  • WordPress

Subscribe

  • Entries (RSS)
  • Comments (RSS)
© Optimale Systemer AS