On 30.08.2011 22:32, Jonas Maebe wrote:

On 30 Aug 2011, at 22:26, Sven Barth wrote:

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).

If you create an instance of that class in FPC code and compile with -vw, the 
compiler should list the abstract methods.

There seems to be none :(

=== output begin ===

[sven@artemis helloandroid]$ ppcjvm -n -Fu/mnt/data/subversion/fpc-jvm/rtl/units/jvm-java/ -FEbin/classes -Fu../../androidlib/lib -FD/home/sven/downloads/dev/freepascal/fpcjvmlinux-snapshot1/bin -XP -vw src/androidfpc.pas
Generated: bin/classes/org/freepascal/android/TTestClass.class
Generated: bin/classes/org/freepascal/android/androidfpc.class
Generated: bin/classes/org/freepascal/android/TTestActivity.class

=== output end ===

The unit looks like this:

=== source begin ===

unit androidfpc;

{$mode objfpc}{$H+}
{$modeswitch unicodestrings}
{$namespace org.freepascal.android}

interface

uses
  android;

type
  TTestActivity = class(AAActivity)
  public
    constructor create;
  end;

  TTestClass = class(TObject)//(JLObject)
    function getText: UnicodeString;
    function getTextView(aActivity: AAActivity): AWTextView;
  end;

implementation

constructor TTestActivity.create;
begin
  inherited create;
end;

function TTestClass.getText: UnicodeString;
begin
  Result := 'Hello World through FPC TObject';
end;

function TTestClass.getTextView(aActivity: AAActivity): AWTextView;
var
  js: JLString;
  test: AAActivity;
begin
  test := TTestActivity.Create;
  if test.isTaskRoot then
    js := 'Hello World! Activity is task root'
  else
    js := 'Hello World! Activity is not task root';
  Result := AWTextView.Create(aActivity);
  Result.setText(js);
end;

end.

=== source end ===
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to