Bare Bones Android App With NDK Shared Object Built In Delphi XE7 Without Firemonkey

Delphi XE7 Bare Bones Android App Without FiremonkeyDeveloper Simon,Choi has released some source code for building a bare bones Android app in Delphi XE7 with the Firemonkey framework. Basically it is a really slimmed down Android NDK shared object with a bare bones Android SDK app that calls into the Android SDK shared object. A shared object (*.so) file is like a Windows DLL and is what your Delphi XE7 Object Pascal app gets compiled down into. An Android SDK java app wraps the shared object and loads your app from the shared object library. Normally the library contains the Firemonkey framework which has a pretty good size. Simon also released a similar project for a bare bones XE7 IOS app. The sample code from Simon allows you to create an Android NDK shared object library in Object Pascal that does not contain the Firemonkey framework. It would also appear that you could distribute this shared object as part of your own SDK to other developers to use in their java Android SDK applications. I think it would be pretty rough to build anything without all of the Firemonkey functionality (including the non visual components) but this gives you that option. The shared object exports functions which can be called directly from Java. Here is some code from the project where it demonstrates how to load the shared object and it’s exported function in Java:

And here is some sample Object Pascal code from the project that shows how to create a function and export it from the Delphi XE7 Object Pascal shared object file:

And lastly here is some pieces of code from the example which show how to load the above Java class and Android NDK shared object and call the Delphi XE7 function in Java:

The instructions are a little bit unclear because it talks about a build batch file but I don’t see that anywhere. I assume you just build the Delphi XE7 project and then compile and pack your two Java classes as an Android SDK with the shared object file from XE7 in the appropriate directory. This project should probably also compile in Appmethod.

Head over and check out the full source code for the three necessary files for creating your bare bones Delphi XE7 Android app without Firemonkey.

There is also a second page which more extensive instructions which is linked from the first but I’m not sure how it applies to the first project other than it tells how to setup building for the Android SDK.

Lastly here are the three source files for the bare bones Delphi XE7 Android shared object and app.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Turn On Full Screen Mode In Delphi XE7 Firemonkey On Android, IOS, OSX, And Windows

Stephen Ball from Embarcadero has a post up where he implements full screen mode for IOS apps built with Delphi...