This week we are highlighting Jens Fudge of Middelfart, Denmark as our MVP of the week. Jens is a long time Delphi developer who works for Exotech and Archersoft. He helps organize the Danish Delphi User Group DAPUG, specifically getting speakers to their biannual workshop. Jens also regularly teaches Delphi training courses.
Beyond software development, Jens is an accomplished archer and beer brewer. He instructs and judges archery competitions, and in 1992 he won the gold medal in archery at the Paralympic games in Barcelona.
I visited Jens 7 years ago as a speaker at DAPUG. It was a treat to get to know him. The following is a podcast I recorded a few months ago that will hopefully give you a chance to get to know Jens better and learn about some of the great things he does as a Delphi developer and Embarcadero MVP.
As a way to acknowledge some of the hard work and amazing contributions each of our MVPs provides we are starting a new MVP of the Year program. It is already a few months into 2016, but I would like to start by recognizing our MVP of the year for 2015, Stefan Glienke. (He is missing from the MVP directory, but we will get him added right away.)
Stefan started programming with Turbo Pascal over 15 years ago, and now uses Delphi as his productive language of choice. He is an expert in software design patterns, principles and practices. He developed the DSharp library, Test Insight and is lead developer of Spring4d.
The process of selecting an MVP of the year involves nominations and feedback from other MVPs as well as our internal consideration. Everyone holds Stefan in high regard and appreciates his many contributions. Here is a little about Stefan.
With the recent update of our Embarcadero website, now dedicated completely to developer tools and InterBase, there is a backlog on getting the MVP directory updated. So I’m just going to announce the new MVPs here:
You can look forward to seen all of these MVPs as well as others showing up in the MVP directory soon. I’m excited to welcome them all to the Embarcadero MVP program and my apologies for not getting them listed sooner! It is great to see so many excited and talented developers in our community!
Delphi 10 Seattle es la versión que mas me ha gustado por todas las mejoras que se han agregado, destacando la liberación de la RTL que nos permitirá desarrollar aplicaciones listas para Windows 10.
Bruno Fierens of TMS Software in Belgium has their full range of components and libraries updated to work with Delphi and C++Builder 10 Seattle. [Blog in English]
Marcos Antonio Moreira of Unimed Gov. Valadares in Brazil reports:
The RAD Studio 10 Seattle is fantastic. Its integration with Windows 10 and all the new features that have been incorporated into the tool such as improvements in the IDE, compilers, connectivity and productivity make this the most complete version for Windows development, Mobile and IoT.
Desde seu lançamento no dia 31 de agosto de 2015, o RAD Studio 10 Seattle vem conquistando o cenário de desenvolvimento rápido de aplicações, acredito eu que nunca um lançamento de versão do RAD foi tão aguardado e comentado como esse.
What do you think of Delphi, C++Builder and RAD Studio 10 Seattle?
This is a collection of some Tweets by our MVPs over the last week. They are from all around the world and in various languages.
This first one was technically from the week before, but I was on the other side of the international dateline then so it all gets wibbly wobbly timey wimey.
Let's do some demographics of the Delphi developers – how old are you? http://t.co/COw6td1HMH
Not all of our MVPs are active on Twitter, check out the MVP directory for details on each of them. In the future I’ll highlight updates from different sources.
Examine the createdex.bat file to make sure it refers to the correct location for your dx.bat utility and the fmx.jar & android-support-v4.jar files.
Run the createdex.bat file to create the classes.dex file which includes the two jar files above, plus the base64coder.jar file.
Double check that the Deployment Manager references the new classes.dex and not the old ones, and that the remote path is “classes\”
Notice that the android.JNI.Base64Coder.pas file wraps and exposes the methods of the base64coder class.
Run the app on your Android device and verify that it works as expected.
The Base64Coder.JAR is Android specific, so it will not work on iOS or Windows. Some additional notes from the Developer Skill Sprint: Some useful units for making JNI calls
Androidapi.Jni – Java Native Interface type definitions
Androidapi.JNIBridge – The JNI Bridge
Androidapi.JNI.JavaTypes – JString and other common types.
Androidapi.Helpers – JStringToString and other useful conversions.
FMX.Platform.Android– Useful platform methods like GetAndroidApp, MainActivity and ConvertPointToPixel
For more see: C:\Program Files (x86)\Embarcadero\Studio\14.0\source\rtl\android (Object Pascal) and C:\Program Files (x86)\Embarcadero\Studio\14.0\include\android\rtl (C++)
You will want to make use of Conditional Defines in Object Pascal and Predefined Macros in C++. In my blog post on Android Settings I showed how to make a JNI call with Object Pascal, but you can also look at the DeviceInfo Mobile Code Snippet in both C++ and Object Pascal. To create your own JNI Bridge wrappers, look at the source code in C:\Program Files (x86)\Embarcadero\Studio\14.0\source\rtl\android (Object Pascal) and C:\Program Files (x86)\Embarcadero\Studio\14.0\include\android\rtl (C++). You can also consider the following 3rd party utilities:
If you just want to include standard Android APIs then check out the FMXExpress (also an Embarcadero MVP) project on GitHub that includes all the Android APIs. Here is the video replay of my skill sprint
Also, check out Brian Long’s video on accessing the Android API with XE5
Delphi XE5’s support for Android includes many of the most common Android APIs either wrapped in nice cross platform libraries and component or accessible directly via the JNI wrappers. The rest can be accessed by creating headers to expose them. The new JNI Bridge makes this calling of the managed Java APIs from the native Delphi app much easier then it used to be, but it still takes a little effort to make the translation (it is easier than translating a Windows API). Brian Long (an Embarcadero MVP) has an excellent video from CodeRage 8 that goes into great detail on the process.
But all of that has now changed. CHUA Chee Wee aka “Chewy” (also an Embarcadero MVP) has released an Android2DelphiImport tool that makes wrapping and accessing any and every Android API much easier. It gives you 3 distinct benefits:
You can point it at Android.jar in the Android SDK and have it create wrappers for EVERY Android API. You’ll need to copy and paste out the pieces you want (it puts them all in one source file), but it saves a lot of typing and research. It implements the wrapper using the JNI Bridge just like the RTL does.
You can point it at any other built in Java library, like the Google Glass GDK that provides all the Glass specific features on Google Glass, or maybe the Google Cloud Messaging (GCM) API. You’ll have a source file that wraps all the API calls exposed in that JAR file.
You can use it to wrap a 3rd party Java JAR file for Android and it will create a .PAS interface for it, bundle it up for inclusion in your Delphi app, and load it at runtime.
As a matter of testing this tool I pointed it the Android.jar file for Kit Kat. It took a little while, but when it was done I had over 100,000 lines of interface wrappers covering EVERY Android API on Kit Kit. I copied out the lines for Toast support, added in the necessary uses statements, and I had full toast support in just a few minutes.
My next test was to point it to the Google Glass GDK (Glass Development Kit) for building native Glass Apps. Previously I had only used the Android SDK & NDK, which supports the common Android functionality on Glass, but the GDK adds support for Glass specific features. Once the GDK is installed (via the Android SDK Manager under API 15) you will find gdk.jar in the sdk\add-ons\addon-google_gdk-google-15\libs folder. It created a nice wrapper for it, but that wrapper wouldn’t compile because the uses clause was incomplete (it has a notice that you need to adjust the uses clause). I had to track down 4 additional units for the uses clause and then I extracted 3 more apis from the earlier Android wrapper to cover APIs that weren’t previously exposed. In all it took me about 15 minutes and then I had full support for the Google Glass GDK.
Since compiling isn’t enough, I built a simple app to insert and remove cards on the Google Glass timeline. It worked like a charm. I didn’t need to tweak or adjust the generated code at all (beyond the uses clause). Here is my code:
tm := TJTimelineManager.JavaClass.from(SharedActivityContext);
card := TJCard.JavaClass.Init(SharedActivityContext);
card.setText(StringToJString('Hello Glass'));
card.setFootnote(StringToJString('From Delphi'));
id := tm.insert(card); // Use id to edit or remove card later
I haven’t tested the 3rd scenario yet, but I did observe how it works. The tool creates a .apk out of the selected JAR file. It then includes a routine to load that APK at runtime so you can call into the methods it includes. You would need to go this route when the JAR isn’t built into the platform already. I have a library that I’m planning to test this with (so stay tuned), but I wanted to blog about the other benefits right way.
I am really excited about the potential of this tool. Not only does this mean you have even easier access to the entire Android API, but you also have easy access to all the extended APIs and 3rd party APIs. It has a simple command-line interface, and very few options, but when it works that is all you need.
Right now purchasing it is a little more complicated than using it. He only accepts Bitcoins, 1/4 Bitcoin to be exact. Based on the current exchange rate it is about $200 US, which is an excellent value for what you get (and considering how much effort has gone into its development). So you will either need to mine or purchase a bitcoin to pick this tool up, but if you are doing Android development I highly recommend it.
Glenn Stephens with Orchard eBusiness has a Delphi XE5 Mobile App Development Workshop coming up next month. It is divided up into 4 different 4 hour workshops, each on a different day. This gives you a chance to work on what you learned in preparation for the next workshop. The objective is to take a developer who is experienced with Delphi and prepare them for Mobile App Development.
Glenn does good work, so I am sure this is a great opportunity to anyone who wants to make the move to mobile app development.
If you haven’t yet, take advantage of the end of year special offers before time runs out so you will have XE5 and be ready for Glenn’s workshop. I’m looking forward to seeing all your apps in the app stores!
I’m talking with a number of other individuals who will also be joining the MVP program shortly. These are in addition to all the fabulous MVPs already listed in the MVP directory. We are in the middle of a major overhaul of the MVP directory, after which all the above members should be reflected there.