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 Nov 06, 2013 11:56 pm

I'm trying to think of a way to return consistent results for LCInterfaceQueryViewScale. On iOS clearly we need to continue to return MCIPhoneGetResolutionScale because the use of device res can be toggled independently. On other platforms a close equivalent would be 1/MCResGetDeviceScale so you can on all platforms divide the rect by the LCInterfaceQueryViewScale. Sound reasonable? LCInterfaceQueryViewScale = 1 view point/pixel depending on if the platform uses points or pixels.
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 » Tue Nov 12, 2013 11:57 pm

Just bumping this because it's important that my second pull request for this is merged in before 6.5 goes final. The first one will break iOS externals using LCInterfaceQueryViewScale... making views double the size they should be...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

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

Re: android externals

Post by LCMark » Wed Nov 13, 2013 10:19 am

Bump noticed - I just merged this in so it will be included in the next build of 6.5 - Thanks!

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 Nov 13, 2013 10:21 am

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

Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 163
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: android externals

Post by Zryip TheSlug » Sat Jul 19, 2014 10:39 pm

Is a way for creating desktop externals in Java is existing?
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: android externals

Post by SparkOut » Sat Jul 19, 2014 10:51 pm

I don't know, but this is interesting http://newsletters.livecode.com/july/is ... tter4.html

Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 163
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: android externals

Post by Zryip TheSlug » Sun Jul 20, 2014 10:06 am

SparkOut wrote:I don't know, but this is interesting http://newsletters.livecode.com/july/is ... tter4.html
SparkOut,

Nice!

However that was not totally what I had in mind when I've posted my question to the contributors guys. 8-)

I do not know C or Objective C very well, or I would have probably already joined the contributors team. The fact is the only language I could have an affinity with, is Java.
The advantage I'm seeing in Java is, it is cross platform, even if it is requiring to have the JVM installed. A Java external can potentially be built for Desktop (Mac, Windows, Linux) and Android.

Now, I'm pretty too old for creating my first "Hello World" app or to reinvent my own MSM with big buttons. I want to start with a real goal.
So before to start - my probably bad tradition - is to evaluate my possibilities. Or I'm investing time in trying to explore how interfacing stuff in C or I'm choosing Java.
That's the reason of my post here.

Thanks to Jan Schenkel and his excellent blog, I can already figure out how doing concrete stuff in Java and LiveCode. But a direct integration in an External would be even better.



Best,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel

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

Re: android externals

Post by LCMark » Mon Jul 21, 2014 7:01 pm

Right now there is no direct way to write externals in Java for Desktop platforms, however the seeds are there which mean it could be done.

With 7.0 we've integrated the externals-v5 branch which has been languishing for a while into the mainline. This branch contains changes and improvements to the existing iOS externals architecture which not only brings the same IDL-file based system to all platforms (Desktop and Mobile), but also support for writing Android externals directly in Java (albeit with the need to compile a small, automatically generated, piece of C 'glue' code).

Along with this we've also updated it to support Unicode strings, and moved the Obj-C type support functions engine-side.

Now, the Java side of things is still entirely external side: the engine interface remains C (since the engine is C) but the IDL compiler generates glue-code which uses the JNI to directly invoke Java methods of classes (commands and functions are implemented in Java as static methods of a class with a specific name - e.g. com.runrev.livecode.myexternal). This glue code isn't specific to Android in any way - it just relies on the engine providing it with the JNI Environment instance which is provided to the engine by Android. The key point here is that on Android there is always a Java VM running, and an app will (therefore) always have the appropriate piece of JNI information available to it.

Thus this does give a potential path to leveraging this Java support on the Desktop also and, indeed, it could remain almost entirely external side in the first instance - on external startup, on Desktop, the glue code 'just' needs to create a Java VM instance to load and run the Java code.

Of course, there are some dragons lurking here which means a modicum of tighter integration with the engine would be needed - you'd probably want Java externals to share the same VM instance (unless they explicitly didn't want to), and some direct integration with the event dispatch loop would probably be needed to get any of the Java UI stuff working. Perhaps @janschenkel could chime in if he gets a chance - he knows a bit more about hosting Java VMs on the Desktop than I.

[ Note that there is still more work to do on the Android external side of things even at 7.0 - the basic Engine API is present, but it isn't quite complete yet ]

Zryip TheSlug
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 163
Joined: Tue Jan 26, 2010 10:15 pm
Contact:

Re: android externals

Post by Zryip TheSlug » Tue Aug 05, 2014 9:19 pm

@runrevmark,

Ok, thanks for the infos.
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel

juanjo
Posts: 35
Joined: Wed Jul 31, 2013 10:31 am

Re: android externals

Post by juanjo » Tue Aug 05, 2014 11:28 pm

So we'll have Android externals at last!?
Great!

Locked

Return to “Engine Contributors”