android externals

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Wed Aug 07, 2013 12:32 pm

Wohoo... Did you ever get a chance to look at my post/send parameter stuff? Works nicely.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Wed Aug 07, 2013 12:36 pm

Wohoo... Did you ever get a chance to look at my post/send parameter stuff? Works nicely.
Yes - it's a neat idea... Have half-finished integrating it into the externals_api_v5 branch - will hopefully finish doing that today. (My changes to the support code broke the patch as written - and I had an idea about generalizing slightly).

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 08, 2013 3:55 am

Yes - it's a neat idea... Have half-finished integrating it into the externals_api_v5 branch - will hopefully finish doing that today. (My changes to the support code broke the patch as written - and I had an idea about generalizing slightly).
Great
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Thu Aug 08, 2013 10:03 am

@monte: Have merged and pushed an initial version of the Send/Post parameters. I changed the signature of the LC.Object.Post/Send methods to use a variadic parameter list:

Code: Select all

  void Post(String message, Object... parameters)
This has the advantage that Java does automatic boxing of primitive types, so you can do things like:

Code: Select all

  t_my_object.Post("myHandler", 1, true, 2.0, "foobar")

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 08, 2013 10:19 am

Nice!

Your message contains 5 characters. The minimum number of characters you need to enter is 10.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Thu Aug 08, 2013 10:46 am

And a further tweak - moved the class/method id initialization to external startup and added a mapping for byte[] to C-data.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 08, 2013 11:02 am

Ha... I don't think anything I wrote is still in there ;-)

Nice one with the byte[] or ByteBuffer.

I wonder if we could reduce some more code replication by using this before the loop:

Code: Select all

jvalue t_java_value;
if (t_mapping -> java_method != nil)
    t_java_value = (jobject)env -> CallObjectMethod(t_param, t_mapping -> java_method);
else
    t_java_value = t_param;
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Thu Aug 08, 2013 11:08 am

I wonder if we could reduce some more code replication by using this before the loop:
I don't think that would work since the JNI method you need to call to invoked the method depends on the return-value of the method (i.e. Int, Double, Boolean, Object).

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 08, 2013 11:09 am

woops...

Code: Select all

jvalue t_java_value;
if (t_mapping -> java_method != nil)
    t_java_value = (jvalue)env -> CallObjectMethod(t_param, t_mapping -> java_method);
else
    t_java_value = t_param;
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 08, 2013 11:11 am

ah... forget it... I see what you mean. Dumb moment sorry.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Thu Aug 08, 2013 11:12 am

Ha... I don't think anything I wrote is still in there
I think you still have blame for a few lines ;)

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 08, 2013 11:30 am

You left me 9 lines ;-(

BTW is there any way we can add sdks to the git ignore file? I'm surprised it's not bothering you guys.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Thu Aug 08, 2013 12:22 pm

BTW is there any way we can add sdks to the git ignore file? I'm surprised it's not bothering you guys.
Sorted - I pulled in the request you sent ages ago with the change into runrevmark/externals_api_v5, and then iterated to develop and master (in runrev) with a few other additions.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 08, 2013 12:23 pm

Great, thanks
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Fri Aug 09, 2013 2:12 am

It looks like LCObjectPost might be broken on desktop again in 6.1.1 rc 2. While the beachball stopped happening in 6.1 apparently the message was only getting through 50% of the time. Now apparently it's not getting through at all. Let me know if you need more testing and a proper bug report or if it's something you can easily spot.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Locked

Return to “Engine Contributors”