T-Shirts from Brazil Delphi Conference

I picked up some great T-Shirts during my visit to Brazil.

Delphi Developer: The evolution of mankind

Delphi Developer: The evolution of mankind

I really like this one as the Delphi Developer is the highest evolved form of developer. This is evident by not only their great taste in development tools, but also by the fact they are incredibly productive and produce great apps for all the platforms.

Aquasoft - coffeed powered developer

Aquasoft warns: This shirt contains a Delphi Developer. To run it, please fill with coffee and press F9.

I’ll take some Guaraná Antarctica instead of coffee though. Just not sure where my F9 key is located. Carlos from Aquasoft showed me a very cool ORM he is working on. Hopefully we will see some more of that in the near future.

Windows, Apple, Android = Delphi

Windows, Apple, Android = Delphi Developer

I love that Windows, Apple and Android are all following the Delphi Developer.

TDevRocks

www.TDevRocks.com.br

TDevRocks is a great blog by MVP Adriano Santos.

Posted in Conferences | 2 Comments

Connecting the Philips Hue Bridge to Wi-Fi

philips-hue-bridgeI needed to connect my Philips Hue Bridge to Wi-Fi to use it for a presentation at a conference in Brazil. Most public Wi-Fi networks segments each connection preventing communication between devices, besides the fact the Hue Bridge is Ethernet only (Not sure who at Phillips made that decision). Luckily I was able to come up with a solution.

All I needed was my MacBook Pro, which was connected to the conference WiFi and a Thunderbolt Ethernet adapter (which I always carry just incase there is wired Internet access).

Connect the Hue to the MacBook via the Thunderbolt adapter. Then under System Preferences -> Sharing. Select Internet Sharing. Connect from Wi-Fi to computers using Thunderbolt Ethernet (I usually have sharing set the otherway around). Then activate Internet Sharing (and verify you want to do it).

Sharing WiFi to Thunderbolt

This granted the Bridge access to the internet, and gave it a 192.x.x.x IP address that I could reach from my MacBook Pro (and the VM) to send commands to the bridge. This worked great for my presentation, but isn’t a solution for home connectivity.

Also, it turns out the Philips Hue Bridge I just purchased is now obsolete thanks to an Apple HomeKit requirement.

Posted in gadgets | Tagged | Leave a comment

New Delphi Seattle MongoDB Sample

I created some more Delphi 10 Seattle samples to show off MongoDB and FireDAC functionality: LocalSQL, Indexing & Geospatial.

FireDAC MongoDB NoSQL

The first one queries some data from MongoDB allowing you to specify the match, sort and projection, then it stores the results in a DataSet. At that point you can use LocalSQL to write a SQL query against the result set. While FireDAC gives you full native support for MongoDB, it also puts the SQL back into NoSQL.

MongoDB FireDAC LocalSQL

Indexing is used to improve your query performance. It is really easy to work with MongoDB queries with FireDAC.

MongoDB FireDAC Indexes

And one of the cool features of MongoDB is that you can do spatial queries. Here is an example that shows how to create a Spatial index and then do a spatial query with FireDAC. This uses the restaurant data that is included with the shipping samples, so make sure you load the restaurant data first.

Geospatial MongoDB FireDAC

If you missed my previous post I had a MongoDB FireDAC and C++Builder sample.

[You can download my new samples here.]

Posted in DataBase, Source Code | Tagged | Leave a comment

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 | Tagged | 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)

FireDAC MongoDB NoSQL

 

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 | 4 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 | 29 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