[SOLVED] How to add new methods to JForm.java in LAMW? lazarus / 43-Android ---------------------------------------------------------------------- eolandro · 2025-01-17 04:10 Hi! I have written a new method for smartdesigner/java/JForm.java is something like this Code: Java  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i public int SplitFileParts(Uri _toTreeUriSrc,Uri _toTreeUriDst, int _Parts) {   // Many boring code for deal with File system   return 0;}  In android_bridges/androidwidget.pas Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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 5470var  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 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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 Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 01-16 19:43:30.592  6615  6615 W System.err: java.lang.NoSuchMethodError: no non-static method "Lorg/eospfl/appsplitfile/jForm;.SplitFileParts(Land roid/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 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   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 ---------------------------------------------------------------------- jmpessoa · 2025-01-18 18:27 try change Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (Landroid/net/Uri;Landroid/net/Uri;I;)  to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (Landroid/net/Uri;Landroid/net/Uri;I)       //the last ";" was deleted! ---------------------------------------------------------------------- eolandro · 2025-01-21 02:39 Yes!! thank you!!. So Java Objects needs ";" but primitives not, Right? ---------------------------------------------------------------------- jmpessoa · 2025-02-08 16:31 QuoteI have written a new method for smartdesigner/java/JForm.java is something like..... Can you put it here?   So, I will commit it to LAMW!