android externals
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark
Re: android externals
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/
Re: android externals
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/
Re: android externals
Bump noticed - I just merged this in so it will be included in the next build of 6.5 - Thanks!
Re: android externals
Thanks
Your message contains 6 characters. The minimum number of characters you need to enter is 10.
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/
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: android externals
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
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
Re: android externals
I don't know, but this is interesting http://newsletters.livecode.com/july/is ... tter4.html
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: android externals
SparkOut,SparkOut wrote:I don't know, but this is interesting http://newsletters.livecode.com/july/is ... tter4.html
Nice!
However that was not totally what I had in mind when I've posted my question to the contributors guys.
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
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
Re: android externals
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 ]
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 ]
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: android externals
@runrevmark,
Ok, thanks for the infos.
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
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
Re: android externals
So we'll have Android externals at last!?
Great!
Great!