Author Archives: Jim McKeeth

Meet Me in Chicago & D.C./Baltimore for a First Look at XE6

I’m joining Bob Swart and Cary Jensen for the U.S. cities of their annual Delphi Developer Days 2014 tour with the keynote and a free evening event. During my keynote and the evening session I’ll show off Google Glass development with XE6, as well as using an EEG Brain-Computer Interface to control a Mini-Cooper via Bluetooth.

I highly recommend you find time to attend the whole two days of training. I always learn a lot.

May 5-6, 2014: Washington DC/Baltimore
SpringHill Suites Arundel Mills BWI Airport
Register for Training in Washington DC/Baltimore
The free evening event starts at 6:30 PM on Monday the 5th with pizza and drinks. Same location. [Register for free event]

May 8-9, 2014: Chicago
Holiday Inn Express Hotel & Suites, Arlington Heights (O’Hare Airport)
Register for Training in Chicago
The free evening event starts at 6:30 PM on Wednesday the 8th with pizza and drinks. Same location. [Register for free event]

Delphi Developer Days are two-day live Delphi events that provide you with the latest information on Delphi as well as practical techniques to help you improve your Delphi development skills. Each event includes both joint sessions, presented by Bob and Cary together, as well as simultaneous tracks, where Cary and Bob break out into separate rooms to present individual sessions. There is also an Embarcadero Technologies Keynote by Jim McKeeth and guest speaker sessions with Nick Hodges (former Delphi product manager) of Veeva Systems in DC/Baltimore, and with Ray Konopka of Raize Software in Chicago.

A wide variety of topics are covered. Some topics, such as FireDAC and mobile development, apply to the latest versions of Delphi, but there are also many topics that apply across many versions of Delphi. See the detailed description and agenda.

All attendees receive:

  • An extensive course book (several hundred pages in length) written by Cary and Bob that includes the material covered in their sessions
  • Source code examples from their sessions
  • A chance to win valuable prizes from sponsors.
  • Lunch on both days

Space is limited to the first 42 people in each city. There is a discount for attendees of previous 2009-2013 tours, and group discounts are available when registering three or more people from the same company.Visit www.DelphiDeveloperDays.com for complete information.Platinum Sponsors: Embarcadero Technologies, Sybase, An SAP Company, and TMS software. Gold Sponsors: Devart, Dr.Explain, Gnostice Information Technologies, and Raize Software.

C++Builder XE6 for Android Wallpaper

Remember the great Delphi for Android wallpaper? Well Dave has a new wallpaper to celebrate the new C++Builder for Android support.

C++Builder for Android

Thanks Dave for the great new wallpaper!

What You Need To Know #1

Do you know the song “Video Killed The Radio Star“? It seems like today it is “Twitter & G+ killed the blog post.” I thought I would summarize some of the recent news I’ve posted elsewhere.

  • bit Time Lab has a video showing off their multi-touch bluetooth app that controls a very small mini-cooper. They developed the libraries for multi-touch support and bluetooth they used with Appmethod (Object Pascal). Very cool!
  • Project Indy has an OpenSSL update for the Heartbleed vulnerability.
  • InterBase uses OpenSSL, but was never vulnerable to Heartbleed.
  • I’ll be at Delphi Developer Days in Chicago and D.C. and we will have free evening events there too. These are great events full of fabulous content (I’ve attended in the past). I highly recommend you check them out. I’ll be showing Delphi working with Google Glass, Brain-Computer Interface, FireDAC, REST, and anything else I can squeeze in.
  • I’m also traveling to India and South Korea this month.
  • I worked with Sarina on this Tutorial for accessing Parse.com from Appmethod Object Pascal with the REST components. Great technology.
  • Eric compiled a partial list of over 100 Delphi apps in the Play Store.
  • Eric Bonilha was featured in the Brazilian News for his work on a DigiFort app for Google Glass that stream live video to and from Google Glass. It is in Portuguese, but you can see some live demos of the app starting at just after 7 minutes in. All the software used to stream video and control cameras in that segment is written in Delphi by Eric and his team.
  • Curious about what is coming in XE6? There is a RAD Studio XE6 Sneak Peak event taking place April 16th. It looks really exciting!
  • I still get people asking about the new upgrade pricing. Check out the new License Recharge Program – if you own the latest version of Delphi, RAD Studio, or C++Builder then you qualify to save a lot of money when a new product is released.
  • David Intersimone and myself are running regular Google Hangout On-Air events. These are informal technical events we share some of the things we’ve been working on recently. Make sure you join the Embarcadero Technologies G+ community so you can be involved in the next one. The first two were experiments, we plan to promote the future ones better (although they will probably remain experimental and informal).

RAD Studio XE6 Preview Event

Thought Controlled Quadcopter

Last night I “controlled” my Parrot AR.Drone Quadcopter with my thoughts through my Emotiv EPOC Brain Computer Interface via an app written in Delphi XE5. I qualify “controlled” in that my flight pattern was a little irregular and short before I crashed it. It was a “look mom, no hands” moment though as the drone was clearly responding to my thoughts for the few seconds before it crashed. I’ve got a lot of work to do in improving the process, so I will be posting code and videos soon. If you want to get a start on it though, it is based on my work from the Devices and Gadgets webinar.

I’m presenting tomorrow at Boise Code Camp on “Is Thought the Future of Wearable Input?” and if all goes well I’ll have a brief demonstration of the tech in action. If you are in the area my presentation is at 11 AM in the Special Events Center at Boise State University.

Setting Android Settings

On the Android platform all the system wide settings that are accessible via the Settings app are also accessible to your app. You just need to add the uses permission WRITE_SETTINGS. Here is a simple Delphi XE5 example for changing the screen timeout.

First you need the following in your uses clause:

Androidapi.JNI.Provider, // JSettings_SystemClass
FMX.Helpers.Android; // SharedActivityContext

Here is the code to read and set the Screen Off Timeout:

function GetScreenOffTimeout: Integer;
begin
  Result := TJSettings_System.JavaClass.getInt(
    SharedActivityContext.getContentResolver,
    TJSettings_System.JavaClass.SCREEN_OFF_TIMEOUT,
    15000);  // 15 seconds is default is not found
end;

function SetScreenOffTimeout(ATimeOut: Integer): Boolean;
begin
  Result := TJSettings_System.JavaClass.putInt(
    SharedActivityContext.getContentResolver,
    TJSettings_System.JavaClass.SCREEN_OFF_TIMEOUT,
    ATimeOut);
end;

In the GetScreenOffTimeout we pass a default value to use if none is found. I passed in 15000, which is 15 seconds, or the smallest value for my phone. The largest value on my phone is 600000, which is 10 minutes. It appears you can set it to any value, even one that the settings app doesn’t explicitly list as an option.

There are lots of other settings available for your adjustment.

CodeRage C++

Tomorrow is the start of CodeRage 8 C++, which is a lot like regular CodeRage, but with an emphasis on C++Builder. This time there is a lot of coverage on the new iOS support, as well as the new REST Components and FireDAC data access.

It all starts with JT’s opening keynote at 6:00 AM Pacific Time, which may also be of interest to Delphi developers who want to get some glimmers of future plans, roadmaps and announcements. Actually most of the sessions will have content of interest to Delphi developers, especially if you’ve missed some of the more recent CodeRage conferences. But if you are a C++ developers, then be sure to make time for all the sessions!

CodeRage C++ - February 25-26, 2014

The Delphi Object Pascal Language

What’s in a name? That which we call a rose
By any other name would smell as sweet;

The other day I noticed Github has a language choice for Pascal, but not Delphi. It turns out originally they had Delphi listed as a language, but some of the Delphi clones were getting marked as Delphi, so they renamed it to the more generic Pascal. Which immediately resulted in people requesting they rolled it back.

This brings up a good question though, “What is Delphi and what is Object Pascal?” Interestingly there were three implementations of Object Pascal that evolved from the original Pascal. The one we are all familiar with was designed at Borland as part of Turbo Pascal. Apple also designed one consulting with Nicholas Wirth. And there was the Think Pascal IDE with it’s own flavor.

The Borland flavor of Object Pascal evolved into the language we see in Delphi today, while the other two faded away. There actually exists a few other variations of Object Pascal, most all of which were inspired by the language that still lives in Delphi today.

Personally I think it is exciting to see so many other tools and languages in the Object Pascal and Pascal space. That is part of what made C & C++ so vibrant: All the other languages wanted to copy them (Java, JavaScript, C#, etc.)

So back to the question, “What is Delphi and what is Object Pascal.” Object Pascal is the language that powers Delphi. Object Pascal can exist without Delphi, but part of what defines Delphi is it’s Object Pascal language. Just in the same way C++Builder isn’t the only implementation of C++, but part of C++Builder is the C++ language. So Delphi and C++Builder are each the whole package: Language + IDE + Compiler + Debugger + Libraries + Tools. You could say they are the definitive implementation of those languages.

Could we see Delphi with a different language? That would be interesting. At one end of the spectrum there was Delphi for PHP (which evolved into HTML5 Builder.) It was Delphi’s Rapid Application Development concept combined with the PHP language. And then Delphi Prism which used the Oxygene language variant of Object Pascal combined with Visual Studio and .NET.

In my opinion, Delphi is a specific version of Object Pascal, if for no other reason than because it has a fabulous runtime library and framework. Using Object Pascal without TStringList and all the other useful types, function and libraries that Delphi comes with wouldn’t be much fun.

Hidden features in the Delphi Object Pascal language

A list of hidden features in Delphi Object Pascal that are great, obscure, best avoided or remarkable.

This was copied from Stack Overflow’s question of the same name which is closed and flagged for deletion. Licensed under cc by-sa 3.0 with attribution required. I’ve made a few changes, updates and some copy editing. Original question by Johan and others on May 19 2011 at 18:34. Post inspired by Jeroen W. Pluimers’ post.

Read more »

Indispensable Delphi Libraries

What are your indispensable Delphi libraries? The 3rd party libraries you just can’t imagine starting a new project without? I know mine have changed over the years and we have an interesting new crop of libraries in recent years. I listed some unit testing libraries recently, but thought it would be useful to focus on general purpose libraries (as opposed to visual component suits). Here are some open source libraries I either find myself using a lot, or I look forward to using:

I’m sure there are a lot that I am missing . . . What would you add to my list?

Delphi Unit Testing Tools

Recently I was discussing with some friends if everyone should learn to code and one friend said “I think everyone should learn to write unit tests.” I was reading Nick Hodges’ Coding In Delphi book (available free when you buy XE5) in the chapter on Unit Tests and my son asked me about it. In trying to explain it to him, my son was convinced it was a great idea and wanted to know why everyone didn’t do unit testing. Good question.

This month, for our RAD-In-Action webinar series we have Nick Hodges talking about Unit Testing in Delphi. If you sign up to attend the event you get a copy of the chapter on unit testing from Nick’s book. It is a good one.

Wednesday, February 12, 2014

This is sure to be a great event, and I highly recommend everyone makes time for it. In preparation for the event I thought I would list out some Delphi Unit Testing tools. These are covered in Nick’s book, but I’ll add my commentary here:

  • DUnit: The original unit testing framework for Delphi. It still ships with Delphi, and still works great.
  • DUnit2: A fork of the original DUnit this is an alternative unit testing framework that is enhanced to work with the language features introduced in Delphi 2009.
  • DUnitX: There are a lot of new language features in Delphi since DUnit was created. DUnitX is a whole new unit testing framework that takes advantage of these new language features to do some really cool things. MVP Robert Love has an excellent blog post about some of the cool things you can do with DUnitX and his plans and contributions.
  • Delphi Code Coverage: Curious how much of your code is covered by unit tests? This tool answers that question for you. There is a wizard that goes with it to integrate it into the IDE.
  • Delphi Mocks: One of the tricks with unit testing is to separate dependencies, but if your code depends on a database or network socket, how do you test it by itself? Enter Mocks. A brilliant tool to let you test the independent units of code without dependencies.

One side not about unit testing is you actually don’t need to use a framework, you just need to do it. Maybe there is another framework or tool you use, or you’ve developed your own in-house methodology. I’d love to hear about it, and I hope you join us Wednesday for Nick’s webinar, and bring your questions. I’ve got a few myself.