More Coding In Delphi in More Formats

More Coding in Delphi by Nick HodgesFor everyone who updated to Delphi or RAD Studio 10 Seattle, you get a free copy of Nick Hodges new book More Coding in Delphi (At least if you update before the special offer runs out.) Just yesterday this was updated to include the book in ePub and Mobi format, in addition to the PDF version. This is great if you have a Kindle (Mobi) or other eReader (ePub) since these formats are more flexible.

So Upgrade to RAD Studio 10 Seattle today and download More Coding in Delphi by Nick Hodges and load it on your favorite eReader. Then buy a print copy too, because those are easier to get autographed.

Posted in News | 1 Comment

Another Android Background Services Video

Here is a snippet of my video from our Saturday Deep Dive that covers Android Background Services and iOS Background Mode.

For more information check out the original blog post.


Posted in News | Leave a comment

Export Trello to CSV

I’m a big fan of Trello as a way to organize and collaborate. Recently I needed to export a Trello board to CSV. They have an export to JSON, but you have to buy a years worth of business class for the export to CSV. The business class is probably worth it for other reasons as well, but I thought I would see what it would take to convert JSON to CSV using Delphi 10 Seattle’s REST Client and FireDAC. I’m really pleased with what I came up with, and it didn’t take much effort.

I used the REST Client to connect to the JSON export on Trello. The REST Client is overkill for this since it is just a simple HTTP GET request, but the REST Response DataSet adapter is what I was after. This piped the JSON into a TFDMemTable.

Now the JSON from Trello contains a few collections (JSON Array’s of objects) so I used 3 different adapters (each with a different root node) and 3 different memory tables: Cards, Lists and Labels. There are other collections, but I wasn’t interested in them right now.

Once I have the JSON in a DataSet, I need to work with it. So I put down a TFDLocalSQL component and pointed it to the Mem Tables. Then attached a TMemo to the Query of a TFDQuery component, and I was able to run SQL querries against the Trello board. This made it easy to select exactly the data I wanted to export.

For the export I just used the FireDAC ETL functionality to pump the DataSet resulting from the Local SQL query to a text writer which saves a CSV file.  I love the way FireDAC provides all this great high level functionality like Local SQL and the Text Writers. It makes so many tasks so easy to deal with.

There is still a lot of polish to do for this, but right now it does the job really well. I thought I would share it with anyone else who might be interested in exporting Trello to CSV. You could take a look at the source code and use it to convert most any REST/JSON datasource to CSV.

I put the code up on GitHub.

Posted in DataBase, REST, Tools | Tagged , , , | 9 Comments

MongoDB FireDAC C++ Sample

I created a simple sample that shows some basic FireDAC functionality with MongoDB in C++ (Works with C++Builder or RAD Studio 10 Seattle)

MongoDB FireDAC C++

This is similar to a one of the Object Pascal / Delphi MongoDB sample. It shows how you can query a MongoDB database using the new TFDMongoQuery component and display it in a grid. It also shows how to handle nested document objects (like Address) and arrays / DataSets (Address.Coords and Grades).

In addition to using the match property of the query, it also allows the specification of a sort and a projection. The projection is used to change which fields of the document you retrieve.

For more information on MongoDB, check out my MongoDB Skill Sprint and register for CodeRage X (Oct 13 – 15)



Posted in DataBase | Tagged , , | 2 Comments

More on Android Services with Delphi 10 Seattle

New Android Service WizardToday we had our RAD Studio 10 Seattle Deep Dive and I expanded on my Minimalistic Android Studio video with some more details. If you didn’t get registered to join us live, be sure and register now to get access to the replay. In the meantime, here are some more details and a new sample for you.

These slides cover both Android Services and iOS Background Execution Mode. You can read about the different iOS Background Modes in Apple’s documentation.

Luis Navaro published a new sample that shows how to download a image in the background with an Android service. It uses a local service, and launches it with an Android Intent.

Here is another sample that shows how to use the bind mechanism to launch an remote Android service and communicates to it via the Java Message (JMessage) object. There are a couple manual steps that you need to consult the included readme about. Otherwise it won’t work as expected. There are three projects in the project group. One is the actual Android Service, then the other two are apps that connect to the project. One of them is the host app that will contain the service within its APK.

Remember, you need to add the service to the host application after building the service. Then you can deploy it within the host app APK.

The DocWiki has an Overview of Android Services and a Guide to Creating Android Services.

Stay tuned for more details about Android Services with Delphi 10 Seattle.

Posted in Android, iOS, Mobile | Tagged | 3 Comments

Minimalistic Android Service with Delphi 10 Seattle

I always love making minimalistic demos because then you can see all the essential parts. I put together this short video with Delphi 10 Seattle to show the minimal parts necessary for to create an Android service. It is so simple. The Seattle release supports 4 different types of Android services. One thing this demo does show that is optional, is it create a sticky service that will relaunch if pushed out of memory. It doesn’t show how to talk to methods on the service – there are a few ways, which I can cover later. [Source]

BTW, Delphi 10 Seattle added support for iOS background execution too.

Posted in Android | Tagged | 25 Comments

RAD Studio 10 Seattle Early Bird Offer

Act fast to take advantage of the RAD Studio 10 Seattle Early Bird Offer. Expires September 30th, 2015. More information

Posted in News | Leave a comment

Conversation with Allen Bauer, Chief Scientist

Allen BauerIn this special episode we talk with Allen Bauer, Chief Scientist here at Embarcadero Technologies. This month is the 7 year anniversary of the Podcast at, and today is Allen’s birthday. This conversation was recorded during Delphi Week, a celebration of Delphi’s birthday back in February.

We talk about what Allen does as a Chief Scientist as well as some of his side projects. We also discuss some of the new platforms we face today as developers and the challenges and likelihood of Delphi targeting them. Finally some discussion about features Allen would like to see added to Delphi in the future.

Posted in Audio podCast, podcast | 7 Comments

Adding to the Android User Dictionary

On Android there is a single UserDictionary that works across all keyboards, and any app (with the appropriate permissions) can query, add and remove words. Here is some simple code to add a word to the dictionary (via XE8):

  Androidapi.JNI.Provider, Androidapi.Helpers, Androidapi.JNI.JavaTypes;
procedure AddUserWord(const AWord: string);
  // Need WRITE_USER_DICTIONARY permission
    SharedActivityContext, // Context
    StringToJString(AWord),// Word to add
    255,                   // Frequency: 1- 255
    nil,                   // optional shortcut

If you also want to read the dictionary then you need to have the READ_USER_DICTIONARY permission. Check out the documentation for more information on the UserDictionary and it’s Words list.

Posted in Android | Leave a comment

Google’s Project Brillo, Weave, and Delphi

If you followed Google I/O then you no doubt heard about Google’s announcements in the Internet of Things space: Project Brillo and Weave. Brillo is Google’s new operating system for Internet of Things devices, and Weave is the language for how the devices will communicate. Right now Brillo and Weave are just product announcements. You can sign up for more information, but there is no preview release or developer build available. A lot may change before they are released, so it is tough to talk about them, but you sill may wonder how they will play with Delphi and RAD Studio XE8.

Disclaimer: This is based on public information released by Embarcadero and Google as interpreted by me. I’m not announcing anything, nor sharing any internal secrets. Just connecting the dots. If you connect the dots and get a different picture then let me know.

Neither Brillo or Weave are on our official roadmap because they were just announced. But we do have a good record lately of supporting new platforms quickly with new releases when those platforms are in our area of focus: iOS, Android, Windows and OS X. Just with XE8 we added iOS 64-bit to meet Apple’s new requirement, and it was added in such a way that most projects just need a recompile (which is much better option than the other native tools out there)

Besides wishful thinking, lets look at what they are and what we already support with XE8.

Project Brillo is a modified (or scrubbed down) version of Android. There have already been a few new devices come out that are powered by Android beyond the traditional tablet and phone. This is because Android is an open platform that comes with a rich development and app ecosystem. Brillo is Google’s attempt to make Android more flexible for more new devices in the future. It is a great idea.

Project Brillo may be in response to Microsoft’s announcement of Windows 10 for Devices, specifically targeting Raspberry Pi 2. These devices are going to be huge in the Internet of Things (IoT). That is why Microsoft is targeting the Raspberry Pi 2, and why Google is releasing Project Brillo. They all want to be the operating system of the Internet of Things. This is one place in the IoT where Apple is behind the pack, since they are a hardware company, they don’t want to sell an OS without hardware.

What about Delphi support for Brillo? We can look at the last 3 big modified versions of Android: Amazon’s Fire OS, Google Glass and Android Wear. All three of these we supported “out of the box” with our current release at the time, and some of them we added features in future releases to enhance that support. This is because we have great support of the Android OS directly. So I would suspect we will support Brillo when it is released.

That being said, one of the goals of Brillo is to run on “broad silicon” beyond the common ARVv7 processors that most Android devices run on.  We only currently support ARMv7 and ARMv8 (with NEON being part of the ARM standard going forward, so isn’t hardly worth mentioning). We’ve seen some recent success with Intel ATOM processor support thanks to libHoudini updates in KitKat. Now if a Brillo device is running a processors meeting these specs, it is likely to be supported “out of the box.” But if Brillo is running on an ARMv5 or “Bill and Ted’s Excellent CPU” then support is less likely.

Now it is possible that Brillo will be scrubbed down so much that it is no longer compatible with an Android app. Remember that Android is based on Linux, and Linux console apps are on our official roadmap for a future release, so support is still possible.

That brings us to Google Weave: a common library of terms for how devices will communicate. Its objective is to expose the developer API in a cross-platform way. It is based on JSON and REST from what I can tell. So it will be an agreed standard within REST and JSON. We already have great JSON and REST support, and there are 3rd party libraries that extend that as well. Combine the REST client library and the EMS server REST support and I suspect we will be in a good place to support Weave.

Weave is the protocol, but the channel will most likely be WiFi via HTTPS or Bluetooth LE. Also already covered great in XE8.

Naturally once Brillo and Weave are more than just vague product announcements we may have specific support for them that would make them easier to work with and unlock more features of those platforms beyond the stuff you already get with XE8. The moral of the story is to start developing your IoT solutions with XE8 today and make sure you have Update Subscription so you are ready for the future.

Posted in Android, devices, Internet of Things | Leave a comment