Importing an Android Class For Use in Delphi

[Estimated Reading Time: 3 minutes] In a previous post I noted the absence of the BatteryManager class in the AndroidAPI.JNI units. This class contains some constants useful when reading battery information. I showed how to use a suitably massaged literal in place of these missing constants, but in response to observations from Paul and Brian decided to look at how to import the missing class itself.

To init() or Not to Init(), That is the Correction

[Estimated Reading Time: < 1 minutes] The short answer is: Yes, init() In a previous post I lamented the fact [cough – Ed] that some Java class imports appeared to support the underlying Java constructors via an init() method, where others did not. This wasn’t a “fact” at all. It was a misunderstanding based on an incomplete grasp of the machinations of the Java class import mechanism in the AndroidAPI units.

Getting the Battery Level on Android With Delphi

[Estimated Reading Time: 5 minutes] Over the past few days I posted a two part series showing how to obtain the current battery level as part of the implementation of an Android AppWidget using Oxygene. As far as I can tell AppWidgets simply aren’t possible using Delphi but reading the battery is quite straightforward Android SDK work, and I thought a comparison of the Oxygene and Delphi equivalents might be interesting.

VM’s on External Drives – Update Redux

[Estimated Reading Time: 2 minutes] My previous post declaring a successful resolution to the problems I was experiencing with Parallels 9 VM’s stored on an external USB HDD proved premature. The apparent success of being able to start / suspend / resume / shutdown / restart etc, something that had previously been impossible, was sadly misleading though my conclusion that Parallels 9 was not responsible still appears to be valid.