Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2020-02-04 Thread psyhonut
Hello, Jay. Can I ask you some questions about gomobile reverse binding in private messaging? On Thursday, September 12, 2019 at 3:23:24 PM UTC+3, Jay Sharma wrote: > > Hello Elias, > > *First of all, Thank you very much for help. :)* > > > *After I remove the static from function it worked well.

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-12 Thread Jay Sharma
Hello Elias, *First of all, Thank you very much for help. :)* *After I remove the static from function it worked well. * *Thanks* On Thursday, September 12, 2019 at 4:31:05 PM UTC+5:30, Elias Naur wrote: > > On Thu Sep 12, 2019 at 2:35 AM Jay Sharma wrote: > > > > *Hello Elias,* > > > > *

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-12 Thread Elias Naur
On Thu Sep 12, 2019 at 2:35 AM Jay Sharma wrote: > > *Hello Elias,* > > *Following is my java file: * > > > package reversebinding; > > public class RBinding { > public static String getStringFromJava() { > return "Hello from java !!"; > } > } > > > Your Java method is declare

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-12 Thread Jay Sharma
*Hello Elias,* *Following is my java file: * package reversebinding; public class RBinding { public static String getStringFromJava() { return "Hello from java !!"; } } *I tried the following in my go file : * import "Java/reversebinding/RBinding" // creating object like

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-12 Thread Jay Sharma
Hello Elias, Following are the lines from proposals: Creating new Java instances To create a new instance of a Java class, use the New function defined in the class package. For example: import ( "Java/java/lang/Object" "Java/java/lang" ) func NewObject() lang.Object { return Object.Ne

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-11 Thread Elias Naur
On Wed Sep 11, 2019 at 7:20 AM Jay Sharma wrote: > > > *Now, I want to create object of this class in go and want to call method > using that object from go. * > > I was checking your proposal (https://github.com/golang/go/issues/16876) > but could not able to make it. :( The proposal suggest

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-11 Thread Jay Sharma
*Thank you very much Elias : with your suggestion it is working fine.* Just last query: Currently, I called *static method* of my java class: package reversebinding; public class RBinding { public static String getStringFromJava() { return "Hello from java !!"; } } *N

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-11 Thread Elias Naur
On Wed Sep 11, 2019 at 3:51 AM Jay Sharma wrote: > > > I have one doubt when we build using gomobile in that I am giving the > classpath to my .class java file. > *Will it be included in .aar or I have to include that .class file along > with .aar in my android application. * > The class fil

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-11 Thread Jay Sharma
Hi Elias, The provided logs: 2019-09-10 16:36:54.199 9400-9430/com.sample E/GoLog: 2019/09/10 11:06:54 test.go:134: testFunction [Test] 2019-09-10 16:36:54.199 9400-9430/com.sample E/GoLog: 2019/09/10 11:06:54 test.go:136: [Test] Now going to call a java system function (System.CurrentTimeMi

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-10 Thread Elias Naur
On Tue Sep 10, 2019 at 4:26 AM Jay Sharma wrote: > --=_Part_1258_983331168.1568114760099 > Content-Type: text/plain; charset="UTF-8" > > Hello @elias, > > I tried the following: > > 1. Created a java class : > > package reversebinding; > > public class RBinding { > public static String g

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-10 Thread Jay Sharma
Just one more information: I am calling from my go code like this: RBinding.GetStringFromJava() On Tuesday, September 10, 2019 at 4:56:00 PM UTC+5:30, Jay Sharma wrote: > > Hello @elias, > > I tried the following: > > 1. Created a java class : > > package reversebinding; > > public class RBind

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-10 Thread Jay Sharma
Hello @elias, I tried the following: 1. Created a java class : package reversebinding; public class RBinding { public static String getStringFromJava() { return "Hello from java !!"; } } 2. Generated the .class file for this file. 3. Generated the android binding using gomobile

Re: [go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-09 Thread Elias Naur
On Mon Sep 9, 2019 at 3:09 AM Jay Sharma wrote: > > *Next I want to try with my own classes in java.. I want to define class > and call it from go. * > *Can you please suggest, in that case how to build with gomobile ?* > I think you can use the -classpath option to gomobile. -- elias -- You

[go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-09 Thread Jay Sharma
Hello @elias Thank you for reply. I have tried the sample with reverse binding: import ( "Java/java/lang/System" ) func JavaCall() { t := System.CurrentTimeMillis() log.Println("Init", "[Test] Called java function return value is: ", t); } Built the above with gomob

[go-nuts] Re: x/mobile: Samples for reverse binding in gomobile

2019-09-06 Thread Elias Naur
fredag den 6. september 2019 kl. 13.29.33 UTC+2 skrev Jay Sharma: > > Hello All, > > *I can not see any samples for reverse binding (Calling function from go > layer of java layer) in gomobile.* > > > There is the original proposal: https://github.com/golang/go/issues/16876 There is also some