Javascript Libraries and Android development in Xojo

Is there anybody who knows if a next version of Xojo would be allow the use of javascript libraries in an easy way in web apps? There are thousounds javascript code and extensions in web and would be a great asset if this can be done… Also regarding Andoid development, is there any expeed release date?

One thing is certain : without executeJavaScript and a decent way to get variables from Javascript, a browser control is pretty much useless.

I am currently porting my Check Printer to Android with another language. I needed a grid control to show records and balance which does not exist in Android. Thanks to ExecuteJavaScript and a way to get variables, I use an editable HTML table, and that saves the day. Of course the same solution should apply to iOS, if only the Xojo version was anything but a toy.

I really hope the Xojo Android team is conscious that a decent development tool must offer ways to communicate with HTML/Javascript.

@Michael Batakis — In all honesty, if one “potential” feature of Xojo is essential to you, just move to another language because it will take years before it is actually usable/stable in Xojo.

You can use Cocoa controls in Desktop applications and call Javascripts, but I really don’t know about WebApps.

The big problem when coming late to the party is you better bring some flowers for the hostess.

It seems at last that Xojo has understood the need to use consistent language across platforms, and that includes having the same features between controls. Especially such a potentially critical control as HTMLViewer.

There is no reason why methods and properties available in the desktop version should be refused to mobile developers. Especially when they are actually readily available.

That said, I have indeed been forced to move to a better language for my iOS project, and will not look back. I simply wish Android won’t discourage the same way Xojo users.

[quote=438051:@Michel Bujardet]The big problem when coming late to the party is you better bring some flowers for the hostess.[/quote] So, be humble.

I’ve heard this from some more and hope Xojo for Android will just not be too little too late. If that would be the future, then I encourage the team to focus on Xojo Web rather than Android.

I also use some Javascript in my ios and android apps, Also like to work on windows, So, not paying “pro” as (actual) xojo web has not really moving forward in years. But as much as you are right in that the HTMLViewer really sucks, that was not the question. @Michael Batakis asked about Xojo Web.

Xojo said that in Web API 2.0, the SDK will be much more flexible to use existing javascript libraries . BUT, dont hold your breathe, and never wait to start a proyect, both Android and Web API 2.0 have being announced for years, but to this day, there is not a release date.

If Xojo pivoted to using Cordova to target Android and iOS there’d be a lot more overlap with Xojo Web.

There is no “easy” or “automatic” way to do this. There is an entire client side JavaScript framework responsible for mapping events and function calls between the client browser and the Xojo server application. Any control or library with events, properties, and methods exposed in Xojo has to have its own glue code, which works with Xojo’s web framework, to make this magic happen. There is of course an API for this, but somebody has to write the glue code because every JavaScript control and library out there does things its own way.

While writing Web Custom Controls (I know, I know…though it still works I need to start updating it again) the closest I came to “easy” was the jQuery controls which could share a lot of code under the hood. Even then each jQuery control still needed a Xojo class representing it and a bit of its own glue code on both sides (Xojo and JavaScript).

@Daniel Taylor are you referring to your commercial jQuery control or (by the sounds) a pseudo jQuery generic pkatform that was partially developed ?

Steve

I’m referring to my work in Web Custom Controls (commercial). jQuery controls share common properties and behaviors, so in wcc I was able to make a base class that handled those items. Yet each control still needed its own child class and related glue code in both Xojo and JavaScript.

A developer proficient in Xojo yet completely clueless about the web stack can take Xojo web and make a nice, fully AJAX web application. There’s a lot of magic under the hood to make that happen. So I don’t think we will ever see an easy way to import and use any random JavaScript control or library out there. (I’m not going to say it’s impossible but I’m struggling to imagine how it would work.)

The new web framework that is currently under development has been designed from the ground up using jQuery, Bootstrap and FuelUX and we are striving to make creating new controls much easier than it currently is (both for us and WebSDK users).

@Daniel Taylor thanks. I’m interested in finding out more about your base class and the process for glue code using it. I’ve written a simple control already so have a half decent understanding. What’s my best course of action .?

Stephen - if there’s a library of controls like jQuery, look for common properties/methods and use base/child classes in your own design so that common code is shared between them. If all the controls in the library have a property named CommonProperty that you set by executing some JavaScript, then you only want to write your Xojo+JavaScript setter once.

Just use common sense OO design when dealing with a library of JavaScript controls that share a common foundation, and once you’ve done one the remaining ones should go faster.

Thanks for your answers, Greg’s answer creates high expectations that i would like to see it soon. When i put the question i had in my mind the B4A language for developing Android apps. I was thinking for a free tool by which a user can use to wrap javascript libraries and use with xojo plus an easy way to get back javascript variables, as Michel suggested. In my opinion it is a huge drawback for Xojo average user not to be able to use so many free javascript libraries such as mathematics, statistics, artificial intelligent etc ones to build nice and useful Xojo applications for the company they work or for they own shake. For example a non-programmer worker that needs to choose a language to implement an app for its company he might choose another more flexible framework for doing that so to has more degrees of freedom in its development because if choose xojo he would unable to use such ai, mathematics, statistical functions unless learn and be familiar enough with javascript… So for these reasons, this user might choose VB.Net to start with…
That was my train of thought when i asked the question above. Thanks again!

I’m slightly confused by this, do you mean use javascript libraries in compiled apps? Or just in web apps? You can right now include anything you wish into a web app you just need to read up on the WebSDK for creating your own controls. I’ve done dozens for various things many require lots of other libraries that I have to include in the app or link to externally and that all works fine.

If you mean link them into regular compiled apps and use them then thats more problematic. I’m not sure how you would do this except with a environment that used javascript as it’s native development language.

Also I am SO looking forward to Web2.0 I can’t even tell you. I’m eventually going to run out of other projects and start a rebuild of my web interfaces from scratch. I hope Web2.0 is available before I reach that point :wink:

I actually use a similar technique in B4A to obtain things that simply don’t exist in the native app.

A lot of JavaScript libraries are meant for Linux servers. However, some are simply JavaScript code that can be called from the DOM.

James sendman is there any example of how one can effectively use a javascipt library for performing e.g a t-test in a webapp? That could be used as a demo for any user who will try to use any such a library…

Michel, so you mean that from the thousands javascipt libraries only some can be use within Xojo for developing windows or ios or web apps?