Transplanting Javascript application to iOS/Android flutter - javascript

I have browser application which uses javascript,node.js,jquery,HTML5(canvas).
Now I want to transplant this application to iOS/Android.
I am familiar with making iOS/Android application by flutter, so I know that it is possible to make iOS/Android/webapp from dart code.
However for vice-versa??? is there any way to make iOS/Android from HTML5??
Flutter is best but ,any other way???
For example on Titanaium, is it possible to make application by Javascript.
But, it means language is javascript but no library like jquery doesn't work.
So my idea is ,,, use webview on flutter and use application via this view,, but is it possible???

Take a look at Apache Cordova. Although I'm not a fan of it and I'd advise you to write the application natively (with Java or Kotlin), Cordova is quite known and some apps on the store use it.
https://cordova.apache.org/

Related

How can I use a javascript lib in flutter web?

So im developing a project in flutter web and my client request the use of a package which is not available for flutter web (dart). This package is available in js (https://github.com/torusresearch/CustomAuth).
I wanted to know if there is any way that I can make use (or install) this package inside my flutter web project and make use of it. I know Im able to call javascript code inside flutter, but this may get a little bit complex when it requires the use of js packages. I know that there is this package in flutter -> https://pub.dev/packages/js , that can help with the implementation of javascript code.
Anyone knows how can I achieve this goal?

How to use a JS library and a JS function in a Flutter mobile app?

I want to use a JavaScript library in my mobile Flutter project. Here is the link for this library on github.
Library
How can I use this library and a function(aboutnumber()) from it in my project? How can I import this library to a project and how to access its function?
You can use https://pub.dev/packages/flutter_js package.
It allows to evaluate pure javascript code inside mobile and desktop flutter apps. By pure, I mean the package is not a browser engine, so no web API , localstorage or another browser api are available. But you can bundle some javascript code containing javascripts libraries like moment, ajv and maybe the one you related in your question if it relies only in javascript. The flutter_js injects into the javascript engine, things like console.log, xhr and fetch. But it is all. There is a send message channel which you could use to inject objects into the engine which you could provide objects which will be implemented and dart, but will be shared into the javascript global space.
In Flutter web, the javascript integration is possible using the package:js, mentioned in another answer.
Disclaimer: I'm the author of the flutter_js package
This is not possible on any platform other than the web, as described in the JS interop documentation.
On the Web, package:js can be used.
As mentioned in this other similar question, there's also webview_flutter, which embeds a whole web view onto Flutter, and that's an official Flutter package as well.

How do I go about creating a javascript ipad app that uses local storage?

I need to create an internal admin app. The app needs to be able to:
For V1
- Wrap and execute javascript code
- Will not rely on any iOS code other than perhaps the code necessary to load the javascript.
- Uses local storage
For V2
- Work offline (which means javascript code needs to be loaded in)
Any ideas on how to go about implementing such a thing?
By far the easiest and best supported way is to use Apache Cordova. They did all the work of wrapping a Webview in a native app and have a rich set of plugins for integration with all kinds of mobile APIs.
Since the app will be running in an embedded browser you can simply access the normal Localstorage APIs.
The Cordova tutorial by #ccoenraets may be a good way to get started.
From my findings the following two are great solutions:
Ionic
Apache Cordova

Is it feasible to load 'code logic' dynamically in iOS app?

I am looking at this WWDC session: Integrating JavaScript into Native Apps
My understanding is that this is a bridge between Obj-C and javascript, that allows calling javascript code from Obj-C and vice versa. I am wondering, does this mean I can dynamically load my 'code logic' from server in javascript, like in web applications? How should I structure my code so that a large part of my code is in javascript (Obj-C is still needed to drive the js code, of course).
If this is feasible, then deploying changes to iOS projects would no longer be such a painful experience(waiting for review and user upgrade,etc), development could be more agile. I know some teams use phonegap and similar frameworks just to get this advantage, but those solutions doesn't get the most of iOS native UI widgets/features.
If both data and logic can be loaded from server, and the Obj-c part is just the (relatively) stable skeleton code, then iOS apps become web apps without HTML (consider the app a customized web browser which loads code and data from server).
So my question is: how feasible is this? How should I split the code between Obj-C and js to make this as flexible as possible?
As per Appstore Review Guidelines "Apps that download code in any way or form will be rejected"

Is it easier to build for PhoneGap rather the Titanium?

We are looking for a good port of our mobile web application to native app until we have the resources to build a truly native application. We have narrowed it down to PhoneGap and Titanium.
We have an HTML5 mobile version of our application. It uses things like RPC over websockets and some other JS libs. It seems as if we can just continuing using the exact same architecture if we go with PhoneGap, where as with Titanium it seems we would need to rebuild these libs and procedures to work with Titanium.
Is this true? How do these platforms differ?
Thanks!
Phonegap is your best bet here. You can put all your current code into the www directory, and then phonegap will package that into an app. Phonegap doesn't create a web app, you create the web app and let phonegap package it for you.
If you were to use Titanium you would not be able to use any of your current html or css code. If you have kept your JS logic separate from your views, then you could re-use this logic and then build new views for a titanium application but that's very time consuming.
Titanium is not a good framework, dev time is way too long due to how difficult it is to create a UI. It's also quite buggy. We developed an app in Titanium for Android and we're going to rewrite using web technologies.
It's not true that external JS libraries are difficult to use in Titanium. Everything is converted to native code.
This Blog has a good summary of the pros and cons of PhoneGap and Titanium Appcelerator.
Short summary: PhoneGap provides a bridge to enable standards-based web apps to access native capabilities. Appcelerator is a proprietary (non-HTML based) framework that enables the creation of native apps in JavaScript.
Phonegap will be much easier for you. Just port in your existing code. Not native though. Titanium will be a rewrite.
One of the main difference is that PhoneGap creates a webapp written in JavaScript and Titanium creates native apps where your JavaScript code is compiled to Java or Objective-C. So you can't easily use external JavaScript libs with Titanium.

Categories