Hi!
I have written a new method for
smartdesigner/java/JForm.java is something like this
public int SplitFileParts(Uri _toTreeUriSrc,Uri _toTreeUriDst, int _Parts) {
// Many boring code for deal with File system
return 0;
}
In
android_bridges/androidwidget.pas function jForm_SplitFileParts(env: PJNIEnv; _jform: JObject; _toTreeUriSrc: jObject; _toTreeUriDst: jObject; _Parts : integer): integer; // line code 1753
function jForm_SplitFileParts(env: PJNIEnv; _jform: JObject; _toTreeUriSrc: jObject; _toTreeUriDst: jObject; _Parts : integer): integer; // line code 5470
var
jParams: array[0..2] of jValue;
jMethod: jMethodID=nil;
jCls: jClass=nil;
label
_exceptionOcurred;
begin
Result := -1;
if (env = nil) or (_jform = nil) then exit;
jCls:= env^.GetObjectClass(env, _jform);
if jCls = nil then goto _exceptionOcurred;
jMethod:= env^.GetMethodID(env, jCls, 'SplitFileParts', '(Landroid/net/Uri;Landroid/net/Uri;I;)I');
if jMethod = nil then begin env^.DeleteLocalRef(env, jCls); goto _exceptionOcurred; end;
jParams[0].l:= _toTreeUriSrc;
jParams[1].l:= _toTreeUriDst;
jParams[2].i:= _Parts;
Result := env^.CallIntMethodA(env, _jform, jMethod, @jParams);
env^.DeleteLocalRef(env, jCls);
_exceptionOcurred: jni_ExceptionOccurred(env);
end;
Also in
android_bridges/androidwidget.pas but in JForm Class
function SplitFileParts(_toTreeUriSrc: jObject; _toTreeUriDst: jObject; _Parts : integer): integer;
function jForm.SplitFileParts(_toTreeUriSrc: jObject; _toTreeUriDst: jObject; _Parts : integer): integer;
begin
result := -1;
//in designing component state: result value here...
if FInitialized then
Result:= jForm_SplitFileParts(gapp.Jni.jEnv, FjObject, _toTreeUriSrc,_toTreeUriDst,_Parts);
end;
But when i execute the app in logcat a get
01-16 19:43:30.592 6615 6615 W System.err: java.lang.NoSuchMethodError: no non-static method "Lorg/eospfl/appsplitfile/jForm;.SplitFileParts(Landroid/net/Uri;Landroid/net/Uri;I;)I"
01-16 19:43:30.592 6615 6615 W System.err: at org.eospfl.appsplitfile.Controls.pOnClick(Native Method)
if i understand this line is falling
jMethod:= env^.GetMethodID(env, jCls, 'SplitFileParts', '(Landroid/net/Uri;Landroid/net/Uri;I;)I');
But why?
What i'm missing?
PD: Sorry for bad english