Another fix of Delphi code – Click on the ListView

My customer found another but at Delphi application:

TListView Bug


If you click at TListView on the empty are, last item get automatically selected and events as  OnClick and OnItemClick are called.

Well it can be nice feature for someone, but it’s not really logical .. for example if you have open keyboard and you want to hide it, by clicking at the empty area.

There is no settings to tun this behavior off as it’s hard coded.

The problem is at FMX.ListView.pas unit at FindItemAbsoluteAt procedure, line 4060.

This code:

if ViewAt >= HeightSums[HeightSums.Count - 1] then
 Exit(HeightSums.Count - 1);

Replace with this code:

 if ViewAt >= HeightSums[HeightSums.Count - 1]+GetItemHeight(HeightSums.Count-1) then

And the system will start to work logically.

You can download modified unit here, just include into your project.

Fixes of TMemo for Samsung Android

One of my customer reported falling of the Delphi XE5 Application at his Samsung Android device.


When he was quickly typing multiple lines after while the app crashed.

It took me while to get the problem replicated, but eventually I found the bug.

It’s at the FMX.Platform.Android unit at TTextServiceAndroid.DrawSingleLine procedure.

From some reason the FCaredPosition is out of the range of the FLines StringList.

Replace this code:

if (FLines.Count > 0) then


if (FLines.Count > 0) and (FCaretPosition.Y>=0) and (FCaretPosition.Y<Flines.Count) then


Or you can download fixed unit here and simply included it into your project.

Embarcadero recently released new version of Delphi – XE6. Well I would suggest them to focus on fixing bugs at existing XE5 for people who already purchased their product, rather then release new version ever few months.

Accessing contacts from Delphi at iOS and Android

Recently I was doing an application that needs to access contacts at the iOS and Android.


I found those two pieces of code



that works.

But you need different unit for each platform and the names of fields are also little but different.

Read more

Upgrading iPad/iPhone to 7.1 – ‘Unable to locate DeviceSupport directory matched with connected device info’

Recently Apple released new version of the iOS for iPhone and iPad.

If you start Delphi XE5 and you will try to compile the application you will get error:

‘Unable to locate DeviceSupport directory matched with connected device info’

What you need to do is:

Step 1) to import the new iOS SDK.

At the Delphi go to Tools -> Options and Under Enviroment Options is the SDK Manager.



The new iPhoneOS 7.1 should be listed.

Read more

Reading data from the MIDI keyboard at iOS (and probably also at the Mac)

I’m just implementing support for the MIDI keyboard under iOS – mean you can connect MIDI keyboards (I’m using MIDITECH GARAGEKEY Mini) connected via the Apple iPad Camera Connection Kit.

The keyboard works perfect, you just plug it into the iPhone or iPad and it works. As the keyboard doesn’t have any additional led diode it has really low power consumption.

From the free software I found only GarageBand from Apple to be working with the keys.

At my application the keyboards can be easily implemented via the CoreMIDI (here is link to download my implementation for Delphi).

Garagekey mini


Read more

Submitting application to the Apple store from Delphi.

Today I wanted to submit my app to the Apple Store for my customer.

This is generally the procedure:, but I got some problems.

It’s done via Application Loader that can be downloaded after registration at the .


Unfortunately I got few errors after first upload:

ERROR ITMS-9000: “The bundle identifier cannot be changed from the current value, ‘PianoWizard’. If you want to change your bundle identifier, you will need to create a new application in iTunes Connect.” at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)

ERROR ITMS-9000: “This bundle is invalid. The application-identifier entitlement is missing; it should contain your 10-character Apple Developer ID, followed by a dot, followed by your bundle identifier.” at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)

ERROR ITMS-9000: “Invalid Launch Image – Your app contains a launch image with a size modifier that is only supported for apps built with the iOS 6.0 SDK or later.” at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)

ERROR ITMS-9000: “This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK or Xcode.” at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)

Here is how I handled them:

Read more

Opening an URL at separated browser under Delphi XE5.

I was just recently handling quite simple task – to open an URL from the mobile application.

It’s simple under windows .. you will just call ShellExecute function.

But at Delphi that should unify access to all basic tasks for all different platforms is this function somehow missing… ops.

I found solution for the Android and solution for the iOS.

Read more

Implementing missing iOS frameworks

The challenge

As I mentioned in previous posts, I’m just writing a game for an iOS under Delphi XE-5.

Well on the begging it was looking really nice and easy, but there are some catches.

XcodeFirst Delphi doesn’t support multi-touch. This was handled thanks to support of Iztok Kacin.

Second catch was MIDI.

I found that iOS can play MIDI by this article, but from Delphi I couldn’t call it, because “god knows why” Embarcadero created support for some of the frameworks under Delphi.

So I was digging and digging and I found out that it’s actually relatively simple to add missing frameworks to Delphi.

The solution

Embarcadero did that for some of them and Xcode gives header files to each of the framework.

Read more

Game Development – Frames per Second


At the games development if you paint animations at the screen or you are scrolling the scene, you want it to look smooth. To do that you need paint certain amount of pictures at the screen per second. This is called Frames per Second (FPS).


When you have a PC/Mac game you usually have to buy better hardware or decrease detail quality to raise the FPS to level that it will be nice.

But if you have the iPhone it’s up to the developer to create the game in such quality to look and works nicely. (if you have Android you have more choices to buy so you can still upgrade).


But what is the optimal FPS? Well let’s put little of the technical details.

Read more

Tool to easy setup deployment files for Delphi XE5

I’m using Delphi XE-5 for development and they are contradictory.

I think that person who is responsible for whole product is truly visionary and he actually saved future of whole product.

Delphi XE5

The fact that you can by one code develop under Windows (32 or 64bit), Mac, Android and iOS is just amazing.

And it’s really working.

Well the Android app take long time until it starts because the app is not a Java but it’s a native application. Benefit is that any component will work there. It’s really great.

But there are also bad things. There are some decisions that was made and that makes me crazy.

Read more