quarta-feira, 4 de dezembro de 2013

Smart Mobile Studio - DBGrid with some curves

POST #028 =======================================================================
Like it or not, Delphi is the best development tool for Win32/Win64 but Embarcadero seems to ignore the fact. Someone could say that the baby is being thrown out with the bathwater and after all, when they realize the error will be too late.

The fate of Delphi is increasingly linked to the acclaimed FireMonkey technology. Concerns about FireMonkey are concerns about Delphi. Embarcadero beyond thinking who owns the Pascal, persists in pushing your fancy half-assed multi-platform write-once run-anywhere, in reality, is that you can write once and then run it in any platforms each "supported". For example, you develop for Android "some " Androids.

This is my space for outburst. Now, talking about SMS. Smart Mobile Studio was created with Delphi. The tool lets you instantly convert Pascal "Delphi-like" javascript code to native code. The interesting part is that the generated code (pure javascript) is ready to run on smart phones. In order to demonstrate the functionality of this greate tool, I've created a DBGrid with pictures in SmartMS. Nice photos, ehm. doncha think?

Noteworthy is that you can call javascript event handlers using object pascal . Thus, you could make a sort of binding between components of a javascript library and the native components SmartMS thus being able to create more sophisticated apps. This is warleyalex from Seven Lakes, Brazil. Stay tuned on upcoming videos about SmartMS.

Tags: OP4JS; Smart Mobile Studio; SmartMS with DBGrid.
 


sábado, 30 de novembro de 2013

Smart Mobile Studio - DBGrid component

POST #027 =======================================================================
Smart Mobile Studio (aka Delphi for Javascript) instantly converts pascal Delphi-like code into high-speed javascript. The interesting part is that JS code generated is ready to run on smart phone or any HTML5 web-kit empowered device.

I would like to create a testapp more sophisticated with SmartMS, I realized that I could write a Pascal wrapper classes to mimic the structure of the JS library, with the intent of using it to call events from pascal. In this mini video, I'll demonstrate a DBGrid with SmartMS. Thank you very much, I'm warleyalex, and you take care. Stay tuned on upcoming videos about SMS.

Tags: OP4JS; Smart Mobile Studio; SmartMS with DBGrid.
 


domingo, 13 de outubro de 2013

Delphi mORMot - My Custom 404 error page

POST #026 =======================================================================
Welcome back. Delphi mORMot server will typically generate a error "Not Found" when you attempt to follow a dead link, this message indicates that the client was able to communicate with the server, but the server could not find what was requested.

I would like to display a customised 404 error page, including a more "friendly" message that work in no-script browsers. This is for browsers that do not understand JavaScript can be redirected to special pages that do not expect users to support JavaScript.

I'm using meta refresh tag <meta http-equiv="refresh" content="0; url=/root/">
to auto redirect page. Concerning absolute URIs in redirects, I don't know if this method is the best approach for redirection, but anyway, this is another story. So please stay tuned on upcoming videos. Thank you very much for listening, I'm warleyalex, and you take care.

Tags: Delphi mORMot URI redirection; Custom 404 error page; auto redirect page.
 

segunda-feira, 7 de outubro de 2013

Smart Mobile Studio (Delphi for Javascript) - calendar widget

POST #025 =======================================================================
Welcome back, everyone. This is warleyalex. Playing with SMS - Smart Mobile Studio (AKA Object Pascal for Javascript). SmartMS instantly convertes pascal Delphi-like language into pure JavaScript. The code generated is ready to run on your iPhone or any HTML5 web-kit device. The idea here, in this mini video was demonstrate some SmartMS built-in datetime functions. As you know, since delphi and javascript deal with dates quite differently, this probably is an issue. I’m having a hard time to add an animation feature in Smart, but this is for the next video. So please stay tuned on upcoming videos. Thank you very much for listening, I'm warleyalex, and you take care.

Tags: Delphi for javascript; Object Pascal for Javascript; Smart Mobile Studio with jQuery.
 

quinta-feira, 19 de setembro de 2013

Android with Delphi - Authentication + URI Signature

POST #024 =======================================================================
Welcome back, everyone. This is warleyalex. Playing with Delphi mORMot and Android again. In this mini video, I would like to demonstrate mORMot authentication scheme using Android as client side.

Before hand to take a step further, I will explain to you that Delphi mORMot uses a technique for security called “Query Authentication”. Therefore, each REST request will expect an additional parameter named "session_signature" which will be appended at the end of the URI. As you know, all REST query must be authenticated by signing the query parameter. This signature will be checked against the valid sessions in order to validate any further request to mORMot server. This signature seems to be very effective and will avoid most of attacks such as Man-In-The-Middle and re-plays attacks.

Imagine a scenario in which a client sends an encrypted user name and password to a server to log in. If an attacker intercepts the communication (using monitoring software) and replays the sequence, he will obtain the same rights as the user. If the system enables password modification, he could even replace it with another, depriving the user of his access. In this type of Man-in-the-Middle attack, packets and authentication tokens are captured using a sniffer. Once the relevant information is extracted, the tokens are placed back on the network to gain access.

The man-in-the middle attack intercepts a communication between two systems. The MITM attack is very effective because of the nature of the HTTP protocol and data transfer which are all ASCII based. In this way, it’s possible to view and interview within the http protocol and also in the data transferred. So, for example, it’s possible to capture a session cookie reading the HTTP header, but it’s also possible to change an amount of money transaction inside the application context.

I'm having hard time trying to figure out how to implement Android-mORMot authentication scheme, the issue is I have zero expertise with Java-Android technology, but anyway… I created a similar java class to mimic authentication mORMot approach in Android. As you know, most Android and iPhones applications use an initial screen or dialog box to ask for credentials. My app accepts username and password from the user and sends to remote server application for authentication. Finally displays the main screen to the user, which there is an icon named “My Calc”, this was based on project 14 - Interface-based services.

The idea here was demonstrate “URI signature” feature in Android, in order to enhance security. These are some of the basic functionality. Of course, it would be nice if I could add others functionality such as change password, reset password feature through email or even registration. But I’m having a hard time to add feature to prompt the user to re-login (when the session is expired), but this is another story. So please stay tuned on upcoming videos. Thank you very much for listening, I'm warleyalex, and you take care.
 

domingo, 1 de setembro de 2013

Android with Delphi - CRUD

POST #023 =======================================================================
Delphi XE5 – (AKA Delphi for Android), is officially out today. It’s neither a Delphi compiler for Java nor generates Dalvik¹ VM bytecode. The compiler named “dccaarm” produces native applications with binary code, compiler builds native machine instructions ARM executables, generating automatically the package .apk. Emborcadaro guys are always stating the word native, the “native machine code” is better than and so on. To be honest, I think “native” here is synonymous of “sex”, anyone talking about it all the time generally is not doing it. In my opinion, seems to be a very interesting tool, despite the price of $ 1.5K - too expensive for most programmers.

Talking about price, size, Delphi and Android, take a look at what I'm trying to build: is a REST server with the old Delphi 7 with Android. The Android Client will list data in a simple widget listview. My first app does something useful, perform CRUD operations such as create, insert, or delete records. Eclipse with Android SDK generates this application to an .apk in 60 KB in size.


AHA! By contrast, an empty Hello World application project in Delphi for Android XE5 – the generated code (file with extension .so) a kind of shared objects library in Linux, is much bigger: around 5MB in size. How quickly does that native binary grow when you add more capability? Normally, I’m very optimistic, but recently I’ve becoming very pessimist with EMBT these days, but this is another story. So please stay tuned on upcoming videos. Next video, I'm going to talk about REST authentication using Android client. Thank you very much for listening, I'm warleyalex from Sete Lagoas, and you take care.

_______
Dalvik¹ Virtual Machine requires that the Java bytecode .class is converted to the Dalvik bytecode, so from compiled Java class files, the files are converted to the Dalvik VM bytecode to native files. dex. The Dalvik virtual machine Android normally does not run Java bytecode.