Creating a PhoneGAP with B4A, naked compiler and jsInterface

bluedude

Well-Known Member
Licensed User
Longtime User
After getting the new B4A and taking a look at jsInterface something started spinning in my head. Recent developments around HTML5 and stories on hybrid apps (native launcher with jQMobile interface) started me thinking on an idea.

What if we could do a kind of Phonegap with B4A, jsInterface and a newly to create naked B4A compiler. That way we could create a basic framework with a webview and jsInterface that connects to all the phone related stuff like GPS, Camera and even contacts. HTML5 developers could use JQMobile to do the web interface and connect that to native functions by using jsInterface.

Erel would need to provide us with a naked compiler that could sit in the project folder and re-compiles everything. The "power" user could change startup icon in the \files folder and even do more customizations.

A naked compiler could be run after every customization. I would actually be fine to pay for an extra license fee to distribute the naked compiler.

Already some companies are trying to do this, like AppMobi with MobiUS: The MobiUs WebApp Browser

I think this could be very powerful. Anyone interested?
 

bluedude

Well-Known Member
Licensed User
Longtime User
Well, that's easy. You don't need to learn a new language and web skills can be used. If you look around on the internet you see that the move is towards (slowly) HTML5 mobile web apps.

Web skills are much more available compared to Java or even B4A.

Also, if I distribute my app. I cannot do updates fast. With a hybrid approach it is easier because I can just update the HTML5.

It is a huge discussions on the web and in the end HTML5 will win because it is more portable across platforms. If you see what JQMobile is doing that is awesome.

Browsers get more capable and within a few years the whole idea of native is gone.

If we can supply people with tools to easily customize my Android project that would be a big plus. Most of them want simple branding.

Would it be hard to have a "naked" compiler?
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Erel, not sure what your answer means :) Is a naked compiler that just re-compiles the project again an option? That way people could customize icons in the \files folder and distribute their own version of the Android project. Easy customization is a key element nowadays.

This has nothing to do with native or not because it is still native. I would love to have a B4A compiler that just does that, re-compile the project in a project folder.

Cheers,
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Yeah, I understand that is the business decision :) Leave it, going to find another way for sure if needed.
 
Upvote 0

Widget

Well-Known Member
Licensed User
Longtime User
What if we could do a kind of Phonegap with B4A, jsInterface and a newly to create naked B4A compiler. That way we could create a basic framework with a webview and jsInterface that connects to all the phone related stuff like GPS, Camera and even contacts. HTML5 developers could use JQMobile to do the web interface and connect that to native functions by using jsInterface.

Dude, it ain't practical. :sign0137:

There are more than enough HTML5 RAD's out there as it is. Working in a native language like B4A is superior to using HTML. B4A is faster, smaller, and better integrated with the hardware. HTML runs in a 5MB sandbox.

Widget
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Well, don't agree. Hybrid is a nice way to go. Problem is that most developers always say native but a lot of stuff moves to HTML5, look around :)

I know and have seen the discussions, it's like the programming discussion. In the end everyone searches for widest audience and portable code.

The desktop has moved to the cloud and mobile the other way? Probably not in the end.

Anyway, I didn't want to do a discussion. Just wanted to see if a naked compiler would be an option.

Thanks for the response.

Which HTML5 rads? Most suck major.
 
Upvote 0

Roger Garstang

Well-Known Member
Licensed User
Longtime User
My brother just showed me this Phone Gap/Cordova stuff. There are some limitations that you can't do and can with B4A. My main interest I think would be the possibility to use B4A to work with it. Right now you have to load it in eclipse and it looks like it creates a dummy interface then you have to do all the compiling, signing, aligning, etc yourself. B4A does a much better job of this. I'd rather see a way of just integrating the Cordova Jar into B4A and being able to use it in our web controls. It wouldn't really be a better way of developing since I still like Native, but would give us more options and allow reusing the HTML in other projects to make Windows Phone, ios, or other versions of our application easier.

I'd much rather use B4A for Phone Gap stuff than Eclipse...I hate JAVA applications on the Desktop. From what he is saying there are lots of JAR files out there with java script code integrating it that we could use much better in B4A too. I may start looking there for JAR files and figure out how to create the xml stuff for B4A and make them work. If they can work with javascript...surely they can work much better in B4A.
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
B4A and PhoneGap are 2 different things, with B4A you create REAL Android apps, with PhoneGap you create "web apps" packaged in an APK and the limitations are not a few, not to mention speed too, a medium to large sized app might be very slow to load and perform.
 
Upvote 0

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Never said they were the same. I had just searched for it here to see if anyone did anything with it and found this thread. I don't think I'd want to take it as far as what the OP Called a "Naked Compiler", but it could be interesting if B4A could host the Jar file and make use of it. Might be as a project type or somehow integrated as a library addon that just links it in so we can make use of native things within JavaScript.

This wouldn't be a replacement for B4A, but another feature and option for those that may be using it with Eclipse to have a better way of using it. It could allow for better interaction between web content and native too.

I had just read on it and while it had advantages for making "apps" with various platforms...I doubt I'd use it for a full app. I'd probably use it more as a frame/panel within my app. It would also be capable of just making a webview within B4A and using it like some do in Eclipse which would give a better and easier IDE to work with within B4A.

Could allow for the creation of a custom browser for Android too with the ability to access Native objects. I'm not sure how Android handles content ran locally or over the web, but my biggest thing is I'd want interaction with my PHP code too and if it could do Native things that would be wild.
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I think most people didn't understand what I wanted :) Hybrid apps. are pretty popular (mix of native and web content) and the advantages are clear. Easier to manage the webview part (you just need to update the remote code) and less native code.

I actually have stretched this with the webviewextras and it works great. I have a fully driven jQuery interface that talks to native parts by using webviewextras. For example, I have a nicely designed gauge running in a remote webview that gets updates by a jQuery command when something changes inside the Android app.

You can run these type of commands when using jQuery:

MyWebViewExtras.executeJavascript(wvSensor,"$('#99e865bcdb7ee7198f1700930024148bcurrentval').val('88').trigger('change')") That would update a Gauge in my dashboard, even when it is hosted remotely.

Personally I prefer adaptive/responsive design for the UI (not native but HTML5) and then hookup features of Android. This way your UI can be designed by a web designer and someone else can do the Android code. UI changes are also easier to do because they are on the web so everyone gets the new stuff immediately, it adds a kind of abstraction layer.

You could easily add parameters to your web url to tell you call from inside Android, I do this with a parameter called inapp=false/true

Native isn't always the answer to every problem, that is for sure!

I did not have time to do a full demo yet but maybe I will schedule something for the future.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Hi,

I think most people didn't understand what I wanted :) Hybrid apps. are pretty popular (mix of native and web content) and the advantages are clear. Easier to manage the webview part (you just need to update the remote code) and less native code.

I actually have stretched this with the webviewextras and it works great. I have a fully driven jQuery interface that talks to native parts by using webviewextras. For example, I have a nicely designed gauge running in a remote webview that gets updates by a jQuery command when something changes inside the Android app.

You can run these type of commands when using jQuery:

MyWebViewExtras.executeJavascript(wvSensor,"$('#99e865bcdb7ee7198f1700930024148bcurrentval').val('88').trigger('change')") That would update a Gauge in my dashboard, even when it is hosted remotely.

Personally I prefer adaptive/responsive design for the UI (not native but HTML5) and then hookup features of Android. This way your UI can be designed by a web designer and someone else can do the Android code. UI changes are also easier to do because they are on the web so everyone gets the new stuff immediately, it adds a kind of abstraction layer.

You could easily add parameters to your web url to tell you call from inside Android, I do this with a parameter called inapp=false/true

Native isn't always the answer to every problem, that is for sure!

I did not have time to do a full demo yet but maybe I will schedule something for the future.

This is very interesting stuff, I'm hoping I can pick your brain. I'm working on a prototyping tool with JQuery Mobile and also interested in webviewextras and how it all works and fits together. The ultimate aim anyway is to be able to develop interactive wireframes inside my b4a apk. Here is my stuff so long.
https://www.b4x.com/android/forum/t...le-app-using-jquery-mobile.49689/#post-309780

Can you share your notes please? I'm kinda excited about this and really...
 
Upvote 0
Top