Welcome, Guest
Username: Password: Remember me
CodeTyphon Cross-Build Development, discussions and problems
  • Page:
  • 1

TOPIC:

arm-android version 11 years 8 months ago #3533

  • zeljko
  • zeljko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 207
  • Thank you received: 38
whether it is possible to choose the version arm-android
translation examples andoridlcl I just managed with FPC-2.5.1
JNI example can to work only with FPC-2.5.1

if you can help out send HTML code and read the answer
request (nativetest.pas) and response (webpage.java)

the laz4android it works

I install: WinXp 32, Lazarus BigIDE, arm-android
how to work with CodeTyphon 4.10

library nativetest;

{$mode delphi}

uses jni;

const curVM:JClass=nil;

function strFromJNI(env:PJNIEnv; this:jobject): JString; cdecl;
var
Str: string;
begin
Str := '<html><body>Hello, world!</body> </html>';
Result := PEnv^.NewStringUTF(PEnv, PChar(Str));
end;

function JNI_OnLoad(vm:PJavaVM;reserved:pointer):jint; cdecl;
begin
curVM:=vm;
result:=JNI_VERSION_1_6;
end;

procedure JNI_OnUnload(vm:PJavaVM;reserved:pointer); cdecl;
begin
end;

exports
JNI_OnLoad name 'JNI_OnLoad',
JNI_OnUnload name 'JNI_OnUnload',
strFromJNI name 'Java_com_pascal_systeminfo_webpage_strFromJNI';

begin
end.
package com.pascal.systeminfo;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import java.util.Date;

public class webpage extends Activity {
WebView browser;

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
browser=(WebView)findViewById(R.id.webkit);

try {
browser.loadData(strFromJNI(),"text/html", null);
} catch(UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}

}
/**
*/
public native String strFromJNI();
/**
*/
public long nativeCodeLoaded=0;

static {
try {
System.loadLibrary("nativetest");
} catch(UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}

}

Please Log in or Create an account to join the conversation.

Last edit: by zeljko.

arm-android version 11 years 7 months ago #3591

  • zeljko
  • zeljko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 207
  • Thank you received: 38
I found a solution is bug

problems:

Lazarus find lacation libdl.so to settings FLD:\Programs\android-ndk-r8d\platforms\android-8\arch-arm\usr\lib\libdl.so
to android

lazarus blank settings patch -Fl
copy libdl.so too root source pascal

Please Log in or Create an account to join the conversation.

  • Page:
  • 1