Tag Archives: delphi xe8

Top Ten Video Roundup Of Awesome Connected Devices Integrated With Firemonkey

Programmable and internet connected devices like the Arduino are exploding in popularity. There are quite a few videos on up YouTube showing fun integrations between Delphi and various bluetooth, wifi, and serial connected devices. Here are the top 10 Delphi device integration videos I’ve seen.

Some of them utilize Delphi XE8 Firemonkey apps on Android and IOS while others are simple Delphi 7 VCL apps using a COM port. There are three different Arduino integrations, two different drone integrations, a brain interface integration, a robot arm integration, a depth sensor integration, an animatronic head integration, an integration with beacons and mobile devices, and a gesture control integration. Three runner ups are listed at the end and they are a swimsuit integration, IP camera integration, and a temperature sensor integration.

Add your favorite Delphi hardware integration videos I’ve missed in the comments below!

#1 Animatronic Terminator Head Controlled Via A Delphi XE8 Android App

There are four different servo motors that control this creep animatronic head. Is that the Firemonkey light in his eyes?

#2 Delphi Firemonkey Android App Controlling LED Lights In The Room

This is a slick looking control interface for changing the room lights by sliding the colored bars in this Delphi app. Another similar video is here.

#3 Audience Member Controls A Drone Using His Brain Via Appmethod App And An Emotiv Headset

Nothing says this is the future like watching a guy fly a hovering vehicle with his mind. There is a second longer video with more explanation and background that you can watch here.

#4 Robot Arm Sketches Letters Via An Arduino And Delphi Control App

The Delphi app in this video is actually playing back a list of commends to create the sketch.

#5 Demonstration Of Accessing Microsoft Kinect Depth Data From Within Delphi

You can see the depth data made available via the Kinect SDK in this video. Includes sample source code.

#6 Ultrasonic Ping Pong Game Build In Delphi And Controlled Via An Arduino

This one is awesome because of the ultrasonic controllers. The Delphi and Arduino source for this integration is available in the YouTube description. The runner up to this video uses a knob but it also has a speaker (check it out here).

#7 Appmethod Control App Used To Pilot A Parrot AR Drone Around The Office

It’s hard to top a brain controlled drone but sometimes you just need the drone to go where you want and that’s where controlling it with a Delphi app comes in.

#8 Medical App Built In Delphi On Android And IOS Utilizes Check Ins Via Beacons For Distance

I believe the apps demonstrated in this video were covered in a webinar by Embarcadero and you can find all the resources for building the apps here.

#9 Appmethod Reads Data From A Myo Gesture Control Armband To Move A TRectangle

There is also a second video here where the armband is used to control a photo app in Delphi with gestures.

#10 Slick Looking Delphi App Used To Control An Arduino Via Wifi And Bluetooth

You can test out this app demo yourself and get the Arduino side of the source code here.

BONUS: Connected Swimsuits That Monitor (Via Delphi) How Much Sun They’ve Received

It isn’t quite clear how Delphi (or Appmethod) is used. I assume it is used by the sunlight monitoring device as the control app on a tablet or phone.

DOUBLE BONUS: IP Cameras And I/O Controllers Connected And Controlled Via An A Delphi Android App

This video is good but it is someone long as it contains a lot of technical details and a lot of connected devices. Really good showcase of technology.

TRIPLE BONUS: Read Temperature Data From An Arduino Device Using Delphi And Display It In An App

This integration with Delphi is achieved via simple serial port interface.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Ten Tips For Building Professional Multi Platform Enterprise Apps With Firemonkey

Delphi XE8 Firemonkey Android IOS OSX Windows TipsYou can utilize these tips when building Firemonkey apps with Rad Studio XE8, Delphi XE8, C++Builder XE8, and Appmethod for Android, IOS, Windows, and OSX devices.

#1. Secure And Compress Your Data Connections

In a mobile world it is more important than ever to secure and compress your data connections. Your users are hopping from hotspot to hotspot and switching between 2G, 3G, and 4G as they travel while using your apps. You never know how fast the data connection will be or who might be trying to snoop on your enterprise data. Delphi XE8 uses the platform native HTTP clients for it’s REST requests so that it’s SSL/TLS implementation is always up to date. You can secure other types of connections using SSH tunneling.

#2. Secure Your Local Databases With A Password

If you are deploying a local database like SQLite (or Interbase) with your app you can encrypt the local database by setting a password. Whether it is company enterprise data, user medical data, or even user photos encrypting your local database will help keep your app data and your user’s app data secure.

#3. Keep Your Mobile Apps Responsive With Native Progress And Activity Dialogs

It is never a good idea for your users to feel like your app is frozen while it does a calculation or loads some data. Using a native progress or activity dialog can keep your app fast and responsive while your app performs work in the main thread or even other threads.

#4. Check Network Connectivity Before Trying To Connect

With mobile apps especially it is always a good idea to check for a network connection prior to attempting to open a connection. Users on mobile devices can enter and leave connectivity at any time as they travel and your app should be built with this in mind. This applies to REST, app tethering, and straight TCP/UDP connections. Some mobile platforms (like IOS) even require that you make network connections outside of the main thread so utilize anonymous threads as much as possible.

#5. Keep The Focused Edit Field Visible Above The Virtual Keyboard

If the virtual keyboard pops up over your memo or edit control in the lower half of the device screen you will need to implement a solution to scroll the field into view. There is a demo included with the latest version of Delphi called ScrollableForm which demonstrates another way of doing it.

#6. Keep In Contact With Your Users Through Push Notifications

Whether you are sending an enterprise notification about a company event or notifying a user that they have a new message increasing user retention by utilizing push notifications can really help your app succeed. Push notifications are what allow you to re-connect with a user even though the user is not currently running your app. You can utilize the BaaS components in Delphi XE8 to implement push notifications through Parse and Kinvey or you can use a third party component which implements the Pushwoosh API.

#7. Use Premium Styles For A Professional Look

There are nine premium styles that come with Delphi XE8 Firemonkey and they can really give your app a professional look. Utilizing premium styles can also allow you to provide a light and a dark theme so your users can decide which works best in their lighting environment (Hint: the dark themes work great in full sun environments). Be sure to test out using gradients and images on your form backgrounds to really make these premium themes pop.

#8. Handle App Buttons And Lifecycle System Events

When building multi platform apps be aware of the different buttons and events available on each platform. You can handle the back and menu (VK_MENU in OnKeyDown and OnKeyUp events) buttons on Android devices so your users will have an intuitive flow inside of your apps. You can also utilize events like FinishedLaunching, BecameActive, and EnteredBackground to handle changes in your app’s lifecycle. There is also a bonus component called TfgApplicationEvents which gives you easy access to OnIdle, OnOrientationChanged, and OnStateChanged.

#9. Efficiently Display Data In ListViews With Custom ItemAppearance

The standard TListView component that comes with Delphi XE8 takes one-two lines of text (a title and a detail), an image, and an accessory icon on the right. If you want to display more lines of text in each item you will need to add a custom ItemAppearance. One of the custom ItemAppearances that can be installed supports 4 lines of text (a title and 3 details). Additionally, you can create your own custom ItemAppearances and add even more. Lastly you could also use a TListBox where you can embed any number of other controls within each TListBoxItem.

#10. Optimize Icon And Splash Screen Creation And Deployment

There are a lot of different icon sizes that you will have to create to support all of the different devices and device resolutions that are available. Each of the four major app stores (Google, Apple, Amazon, and Samsung) have their own icon size requirements. There is a free utility available which makes this easier or there is a free website which will generate icons as well. A second free tool will help you make all the splash screen images you need. When deploying to Android devices be sure to add your icon to the homescreen so user’s can easily find your app. Don’t have an icon yet? Check out this set of 750 free icons from Google.

BONUS TIP: Track Usage Of Your App And Exceptions With Analytics

Delphi XE8 comes with a TAppAnalytics component which allows you to see how users are using your app. The feedback you receive from analytics allows you to make smart decisions on how to iterate the next version of your app. You can add custom event tracking anywhere in your app and send exception information automatically to the server for review. Seeing exactly where users may be getting stuck or what features they use the most is gold. The TAppAnalytics feature is a cloud service with both a free tier and paid tiers. There is also a third party component that allows you to also track your app usage using Google Analytics. Both components require an internet connection.

DOUBLE BONUS: Take a deep dive into the inner workings of cross platform mobile apps built with Delphi XE8 Firemonkey.

Check out more tips for Delphi XE7 Firemonkey on Android, Delphi XE5 Firemonkey on Android, Delphi XE5 Firemonkey on IOS, building games with Firemonkey, debugging Delphi XE7 Firemonkey apps, and migrating from C# and .NET to Delphi.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Anatomy Of A Delphi XE8 Firemonkey App On Android, IOS, Windows, And Mac

Delphi XE8 Firemonkey Anatomy Of A Cross Platform App

If you are new to working with a full featured framework like Firemonkey you may be wondering at the size of the apps that Delphi XE8 Firemonkey generates. The Firemonkey Framework has hundreds of thousands of lines of code that allows you to jump ahead and start building the app you want to build now instead of the bricks in the road to get there. Hopefully this infographic will provide some insight into what makes up an APK/IPA cross platform application deployed from Delphi XE8 with the FMX framework. The infographic covers Android, IOS, Windows, and Mac OSX apps/packages/libraries/archives created using the Firemonkey framework. Tools that utilize the Firemonkey framework are Delphi XE8, C++Builder XE8, Rad Studio XE8, and Appmethod. The infographic only covers Release mode (something you could deploy to your customers). I have also included a VCL section in the infographic so that you can compare the Windows only VCL framework to the cross platform FMX framework. Also keep in mind that when you use debug information or are in Debug mode your file could be significantly larger. The sizes of the generated files are included in the green circles. There is the normal compiled size and then there is the compressed or packaged size. APK and IPA files are packaged and compressed. The compressed sizes for Windows and Mac OSX were achieved using the 7Zip format. Here is some information directly from the infographic as well about what units are included in a FMX app on Android (it is slightly different on each platform) and how those units effect the size of the deployable file.

Let’s start off with a Hello World app which is basically a FMX form with a TLabel on the form. This comes out to around ~4.97MB when deployed to Android as an APK. Even though this is a Hello World app there is already much more functionality here than just the ability to print out ‘Hello World’ to the screen. A true ‘Hello World’ would be much smaller because it would lack these Firemonkey framework units. The FMX and RTL units included are:

System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls

Next up I’ve listed what I call a Basic App  that clocks in at ~5.50MB. A basic app has some more visual controls available to it like a TListView, a TListBox, a TTabControl, a TMemo, and even some access to advertising. Here are the FMX units included (in addition to the units from the Hello World app):

FMX.ListView.Types, FMX.Objects, FMX.ListView, FMX.Edit, FMX.ScrollBox, FMX.Memo, FMX.Layouts, FMX.ListBox, FMX.DateTimeCtrls, FMX.Advertising, FMX.TabControl

This next tier of app size I’ve termed Services because it is basically some Android JAR files which when fully included bring the app up to around ~6.40MB. These services are basically helper services for Android (some of which are provided by Google) like Google IAP, GCM, and Analytics. You can include and exclude each of these files from your APK separately. Here is a list of the additional files:

android-support-v4.dex.jar, apk-expansion.dex.jar, cloud-messaging.dex.jar, google-analytics-v2.dex.jar, google-play-billing.dex.jar, google-play-licensing.dex.jar, google-play-services.dex.jar

Next up we have what I have termed the Consumer App style app tier which rings in at around ~8.91MB. Obviously if you add more or differently functionality the size of your app can fluctuate greatly. You could also build games and they might fall in this size range depending on how many external graphics and sound you used. This type of app includes more functionality like the RESTClient, the in app purchases unit, sensors, a grid component, and the camera component. Here are the additional FMX and RTL units included by the IDE when these new components (in addition to all of the above) were added:

IPPeerClient, System.Sensors, System.Rtti, FMX.Grid, System.Sensors.Components, FMX.Media,REST.Response.Adapter, REST.Client, Data.Bind.Components, Data.Bind.ObjectScope, System.Actions, FMX.ActnList, FMX.InAppPurchase

Lastly we have the Enterprise and Database App tier which comes in at around ~10.4MB+ but can increase size from here the more you add to your app. This includes FireDAC functionality for accessing an SQLite database, LiveBindings to bind the data to a grid, accessing various path utility functions, and creating ini files for settings storage. At this level you can add tens of thousands of lines of code and lots of forms and the app could still be around this size. The RTL and FMX units included when this functionality was added (in addition to all of the above units) are as follows:

System.IniFiles, System.IOUtils, FireDAC.Stan.Intf, FireDAC.Stan.Option,FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, Data.DB, FireDAC.Stan.Param,FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.Bind.EngExt,Fmx.Bind.DBEngExt, Fmx.Bind.Grid, System.Bindings.Outputs, Fmx.Bind.Editors, Data.Bind.Grid, Data.Bind.DBScope, FireDAC.Comp.DataSet, FireDAC.Comp.Client, FireDAC.Phys.SQLiteVDataSet;

You can find out more about the Firemonkey Framework on the Embarcadero DocWiki and on the FiremonkeyX website.

Download the full Anatomy of a Firemonkey Framework Multi Platform App infographic for future reference.

Tags: , , , , , , , , , , , , ,