App Android ITDevCon2011 disponibile sul Market (ITALIAN)

Manca solo una settima all’inizio di ITDevCon2011. Per permettere a tutti gli iscritti (e far decidere chi è ancora indeciso) di sfruttare al meglio i due giorni di intensa formazione, abbiamo appena pubblicato l’applicazione ITDevCON2011 sul’Android Market.
Trevete il programma completo della conferenza, i profili degli speaker e informazioni sugli sponsor.
Inoltre, potrete definire i vostri speech preferiti in modo da essere avvisati subito prima dell’inizio dello speech.
Potrete votare e commentare ogni speech. Potete commentare da subito inserendo le vostre aspettative per lo speech o alcune delucidazioni sul contenuto. Il voto invece sarà possibile solo a speech avvenuto.

Dal punto di vista tecnico, questa applicazione Android utilizza un servizio REST scritto con Delphi utilizzando DataSnap e i Mobile DataSnap connectors per Android.
Per chi fosse interessato al “Making”, durante la conferenza potrà assistere allo speech di Salvatore Sparacino che illustrerà i vari step dello sviluppo e le soluzioni tecnologiche adottate.
Per definire il vostro profilo, votare e commentare, dovrete utilizzare il codice fornito al momento dell’iscrizione. Se non siete partecipanti, o ancora non vi è arrivato il codice di accesso, potete utilizzare l’applicazione come “anomymous”. In questo caso non potrete salvare i vostri speech preferiti Né votare o commentare.

Dashboard

La time table
Speaker details
Dettagli dello speaker (in questo screenshot, DavidI)

Il link da dove installare l’applicazione è il seguente:
https://market.android.com/details?id=it.bittime.itdevcon2011

Happy ITDevCon2011

ITDevCon 2011 Time Table

Yes, it is a bit late, but this year has been really difficult to choose between all the speeches proposals arrived from all over the world.
The new Delphi XE2 version (and the RAD Studio XE2 Suite too) are really full of new cool features and many of the best delphi developers want to show what can be done in Delphi XE2. Great situation!

However, also this year, there will be many talks and many speakers. For the first time there will be 2 plenary sessions with more than one speaker in the main TObject hall. During these sessions all the attendants will be in the same hall and I’m sure that there will be very interesting Q&A time at the end of the sessions.
As usual there will be english and italian speeches. In every time frame you will find a suitable talk for your language.

This year we are glad to have DavidI as a conference speaker. Thanks to be with us David!

As you can see from the time table, there will be many topics, but if you are particulary interested in Firemonkey, LiveBindings, DataSnap and Mobile, you will find a specific sets of speeches about these topics.

In particular:

  • DavidI and Pavel Glowacky will show all the cool stuff available in Delphi XE2
  • Marco Cantù will held an interesting session about Firemonkey development
  • Bruno Fierens will held a 2 parts session about Firemonkey cross-platform component development.
  • I’ll hold 2 sessions about LiveBindings and how to use them with the most popular Data Access Design Patterns
  • Debora Mizzoni (web) and Luca Giacalone (android) will talk about mobile development with RadPHP
  • Salvatore Sparacino will show how to use the datasnap mobile connectors to develop a real-world app
  • and many others on many others topics

This year we’ll have also a “Conference App” very similar to the Google I/O one. With this app you will be able to:

  • Read the time table
  • Set you preferred speeches
  • Read infos about the speakers
  • Comment on speeches
  • Share you comments about itdevcon on facebook and twitter
  • Read infos about our sponsors

This app has been developed using Delphi and the datasnap mobile connectors (for the backend) and an Android device for the frontend. ASAP the app will be published on the Android Market. Here’s some screen shots from the “ITDevCon2011” android app.

The home screen
The time table with all the speeches infos. The starred ones are your preferred speeches.
Speaker's details

The principal developer of this app (Salvatore Sparacino) will explain all parts (datasnap, the connectors, and the android development) in a specific talk. Are you interested in mobile development using Delphi as backend? If yes, you cannot miss his talk!

The time table is available here.
The complete speakers list is available here.

You can register for the event here.

There are interesting discounts for groups, students and for whom will buy RAD Studio XE2 in these days. If you are interested, contact directly our sales office at dir_comm at bittime.it.

See you in Verona!

In the core of LiveBindings expressions of RAD Studio XE2

WARNING! I’ve been authorized by EMBARCADERO to write about RAD Studio XE2.

RAD Studio XE2 is full of nice and exciting features. One of the most awaited of them is the LiveBindings.

The LiveBindings is available to the VCL and the new FireMonkey framework and allows to connect a property object to another using an expression and a set of observers.
Let’s say Edit1.Text “is binded to” Person1.Name also in a bidirectional way. The “link” between a property (or a group of properties) and another property can also be very complex.

The following is an example of a complex bind expression that return a value:

"This is a full name: " + Trim(ToUpperCase(FirstName)) + ", " + Trim(ToUpperCase(LastName))

I’ve waited LiveBindings for ages and now they are here!

So, let’s look a deep inside to the core of livebindings expression evaluator,
the TBindingExpression.

The TBindingExpression is an abstract class that allows to evaluate an expression. But, what’s an expression? An expression is a string that return, or not return, a value. You could see an expression as a little function or procedure.
To explain the concept, I’ve build a simple expression interpreter using an XE2 beta version.

It is very simple but shows the power of expression engine.
This is the scriptengine while evaluates a simple arithmetic expression.

The expression engine is not only a “static” evaluator. Using the powerful Delphi RTTI introduced in Delphi 2010, you can also allows the expression to “read” and “call” property and method of your Delphi objects!!

So, now, some code is needed.

As you can see, you can “register” some association between a real object and an alias in the expression. So, if my object are declared as the following:

I can use a expression as the following:

Going further, you can call methods in your expression!

So, if you have methods declared as following:

You can use the following expression:

Obviously, when you link a property to another you should not use dialogs in the expressions, but this feature is VERY powerful.
You can create different expression and use them as a custom calculator for specific business rules. The expressions are strings, so you can store them in a file or in a database and use them as needed. The expression engine is not a complete scripting language, but it can be used (and abused) in a very broad range of situations.

For complex business rules, I hate the classic chain

Data->TDataSet->DBAware

so I usually use a DomainModel that use datasets only to read data.

The LiveBinding allows me to use (for complex business rules) the following chain

Data->ORM->DataObjects->Bindings->VisualControls

This is only an introduction to the LiveBingind engine. ASAP I’ll post other articles about it.

I’ll talk about the livebinding engine at the ITDevCon2011 conference. Will be you there?

RAD Studio XE2 will be officially presented all over the world during the “RADStudio XE2 World Tour”.
You can find the list of all launch events in the RADStudio XE2 World Tour page.

I’ll be a presenter at 3 launch events in Italy and United Arab Emitates.
These are the events where I’ll be (click to register):

  • 19th Dubai, United Arab Emirates
  • 21nd Milan, Italy
  • 22nd Rome, Italy

Stay tuned.

DataSnap Mobile Connectors in RAD Studio XE2

WARNING! I’ve been authorized by EMBARCADERO to write about RAD Studio XE2.

RAD Studio XE2 is full of nice and exciting features. One of the most interesting IMHO is the DataSnap extension called “Mobile Connectors”.

In the past, I’ve talked about connecting and using your datasnap REST service with Android, creating ad-hoc json messages and manually parsing the returned json messages. With RAD Studio XE2 this is no longer needed. If you have a DataSnap REST service, you can automatically generate the proxy connector for the major mobile platforms. Yes, just like you have been doing with Delphi or C++ since Delphi 2010.

DataSnap XE2 version supports 4 mobile platforms:

  • Android (Using Java)
  • BlackBerry (Using Java)
  • Windows Phone (Using C#)
  • iOS 4.2 (Using ObjectiveC)

If you want to enable your DataSnap server for the Mobile Connectors you have to explicitely check the feature in the “New DataSnap Server” wizard.

The generated proxies support all the standard Delphi types and maps them to the native target language. Some of the most used Delphi types (e.g. TStream, TDBXReader and so on) have been rewritten in the target language to allows a greater compatibility and a simpler programming interface. The functionalities of the various Delphi classes are not-one-to-one with the Delphi version, but  similar.

From a remote (or local) machine you can download the generated proxy and all the required files using a tool called “Win32ProxyDownloader.exe” which is in the bin folder of your RAD Studio installation. In my FieldTest version, this tool called without parameters, shows its help.

As usual you should have the RAD Studio bin folder in your PATH environment variable, so you can change your current directory to where you want the proxy and write this command in a commandprompt window:

Win32ProxyDownloader -language java_android -host localhost:8080

The proxy and all the needed files are ready in the current directory.

Mat DeLong wrote a very nice Eclipse plugin to use the proxy downloader directly from Android or BlackBerry development environment. You can find this plugin here.

You know that Android is my preferred mobile platform, don’t you?

So, let’s go with an Android example.

To use the generated java proxy, in an Android client application I can write something like this:

//Create the connection
connection = new DSRESTConnection();
connection.setHost("10.0.0.2");
connection.setPort(8080);
connection.setProtocol("http");
//Create the proxy
proxy = new DSProxy.TServerMethods1(connection);
//Use a simple remote method
int sum = proxy.Sum(1,4));
//Use a complex remote method
TStream inStream = null;
TStream outStream = null;
String s = "abc";
inStream = new TStream(s.getBytes());
outStream = proxy.DoSomethigWithATStream(inStream, sum, "Hello DataSnap Mobile Connectors");
//here I can use the java TStream type

All the custom Delphi types (e.g. TPerson) are mapped on the target platform as TJSONObject. All the TJSONValue hierarchy has been ported, with a very similar interface, to the target platform as a wrapper of the native JSON classes.

So, you can write code as the following (Java on Android):

TJSONObject jobj = new TJSONObject();
jobj.addPairs("firstname", "Daniele");
jobj.addPairs("lastname", "Teti");
jobj.addPairs("age", 31);
jobj.addPairs(new TJSONPair("nickname", new TJSONString("Spiderman")));
if (jobj.has("firstname"))
  doSomethingWithFirstName(jobj.getString("firstname"));
doSomethingWithAge(jobj.getDouble("age").intValue());

All the proxies work in a similar way except for the Windows Phone one. Indeed, the WP proxy is asynchronous because Microsoft does not allow a sinchronous http request in the main thread. All the proxies are thread safe.

The proxies are generated on the fly by a set of specialized writers. The TDSProxyGenerator component is in charge of generate the actual proxy code in the target language/platform using one of the specialized generators.

In the next figure you can see all the available proxy generators. Some of them are there since Delphi XE but all the mobile platforms have been added in XE2.

That’s all for now.

RAD Studio XE2 will be officially presented all over the world during the “RADStudio XE2 World Tour”.

You can find the list of all launch events in the RADStudio XE2 World Tour page.

I’ll be a presenter at 3 launch events in Italy and United Arab Emitates.

These are the events where I’ll be (click to register):

RAD Studio XE2 had a lot of new features. This is really the BEST ever Delphi version since version 1.

I’ll blog about other XE2 features mostly Delphi related (as usual) so stay tuned.