[fpc-devel] FPC-JVM: Status report on Android

Sven Barth pascaldragon at googlemail.com
Tue Aug 30 22:26:45 CEST 2011


On 30.08.2011 22:11, Jonas Maebe wrote:
>
> On 30 Aug 2011, at 21:59, Sven Barth wrote:
>
>> I/ActivityManager(   62): Start proc com.example.helloandroid for activity com.example.helloandroid/.HelloAndroid: pid=375 uid=10034 gids={1015}
>> W/dalvikvm(  375): VFY: new-instance on interface or abstract class Lorg/freepascal/android/TTestActivity;
>
> It says that the VM is instantiating an abstract class. Does the TTestActivity.j file contain "abstract" in the ".class" line near the top? The compiler will automatically add this keyword if a class contains one or more (possibly inherited) abstract methods (it's required by the JVM).

Indeed it does. In the .j as well as the disassembled .dex file:

=== part of TTestActivity.j begin ===

.bytecode 49.0
.source androidfpc.pas
.class abstract public org/freepascal/android/TTestActivity
.super android/app/Activity

=== part of TTestActivity.j end ===

=== part of TTestActivity.dex begin ===

.class public abstract org/freepascal/android/TTestActivity
.super android/app/Activity
.source androidfpc.pas

=== part of TTestActivity.dex end ===

I've also found the class that defines the abstract methods. It's four 
classes above android.app.Activity in the inheritance tree 
(android.common.Context). I yet need to check whether all methods are 
overridden correctly by the subclasses (and crosscheck that with the 
documentation).

Regards,
Sven



More information about the fpc-devel mailing list