Communication between mobile web app and phonegap app - javascript

Both applications run on same device, I would like to exchange data between the phonegap app running in background and my web app, even while offline.
Is there a way to achieve this ? I could make only a single phonegap app but I prefer to keep a web app solution for the main application.

Related

CodenameOne to VueJS back and forth communication

We have a web app build in Vue JS and it's SPA, now we want mobile version of the app but due to time and other factors we don't want to build the mobile app from scratch so we resort to using CodenameOne BrowserComponent to load the web app and because it's CodenameOne we can submit to app stores.
The issue we're have now is that the app will have phonebook contacts access on the mobile device, CodenameOne have full access to mobile device once the user grant the permission but reading the contacts in CodenameOne and sending it to VueJs component that will display it is where our issue lie.
CodenameOne can interact with Javascript but I've not seen sample codes for VueJs.

Converting an application from wamp server to android app

I created a very simple application with javascript and html5 and php now I want to use this application as an android application please can any one know how can I connect android studio to wampserver and display my web pages as android pages
Thanks for all

How can my web app communicate with serial port

I have a cloud web app using asp web api and angular. Both hosted on azure. I need my angular app to be able to communicate to serial port (read/write). How can I do this?
I've read that chrome apps can connect to usb/serial, but i'm still confused of how it works. Should i rebuild my apps to chrome apps, or should i create a seperate apps or can i just write chrome apps that open my actual web and access the serial from my current app?
You don't have to rewrite your app. Just create a chrome app and use webview for your actual cloud app. Basicaly you have to write the serial port communication in the chrome app context and pass the data to your webview context in your chrome app which is actually the app loaded from your cload.
Other approach is to write your whole application in an offline chrome app and communicate with your cloud server trought ajax or websocket.
Another thing might help is nw.js. With this you can create desktop like apps with web technology. Basicaly in your nw.js app you will use a node.js serial modul for serial communication.
Or combinate these methods.
I suggest one of the chrome app way cuz I have good experience with its serial module.

communication between web app and native android app

I have two different apps, one is a native android app and other is a web app built using sencha and javascript.
I need to get some information from the web app to my native app.
Any idea how this communication can be done ? I am not using any webview since both are two different apps.
Please let me know. I even tried cookies, local storage etc.. But seems to be the native android app cannot access the browser cookies or local storage..
Please help.
You can try the following:
Run an httpd at your app. If you use cordova, you can take a look at org.chromium.socket plugin. There is an example of how to set up a local http server:
https://github.com/MobileChromeApps/mobile-chrome-app-samples/blob/master/webServer/server.js
At your webapp you issue AJAX calls (replacing html with JSON would fit very well) to localhost, where your app is running at the background. Your app will respond the requests, using JSON for instance.
In the other way around, your app can make AJAX calls to the server, that can update your html/js app using websockets.
If you are not using cordova, it is even easier to build an httpd in Java:) just google around.

Interaction between web site and native app

I'm not so experienced in Android development, but I have some research to do.
I need to develop a HTML+CSS+JavaScript website that has to interact with a 3rd party app.
I understood that I can do this with a native app using a WebView and wrapping the communications with the app with the method addJavascriptInterface: http://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface%28java.lang.Object,%20java.lang.String%29 .
Is it possible to do the same only with JavaScript?
Thank you

Categories