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.
Related
I'm trying to get my chrome packaged app to be able to launch a third party chrome app. Unfortunately, I am unable to use chrome.management.launchApp() because the management API is unsupported for packaged apps. I found several other answers on SO that suggest using messaging to launch the app such as the one found here, but they all refer to launching one's own app.
Is it possible to send some message that will automatically launch the app, like this:
chrome.runtime.sendMessage(<appId>,<launchApp>)
Or is there some other way to do this?
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.
I'm developing a web app using HTML5,CSS3 and JavaScript.
Then I want to use the Apache ordova platform to generate a native android app from my web app but I still don't understand what do I need for this,specially do I need a server-side development with php for example??
First off i suggest you read this
Pretty much your app will be able to accomplish a little bit more than what you would be able to do in a browser if all you had available was the ability to write html/js*.
*by this i mean that you have access to device-specific hardware which is not available in a browser and a few more things but pretty much that's it.
You will need to install node.js (or io.js), then install cordova through npm, and make sure you have the Android SDK installed. Once you create your project, your html/css/js will be wrapped into a native webview component, you do not need any server to render it, effectively your app is a native app that can be installed from google play.
You will need a server, typically a RESTful API, if your app needs to query data remotely or persist to some third party. If you are thinking through a classic MVC mindset (render a page through some php code) then you probably need to read about cordova and how it works. A cordova app is a client-side only app, no server-side processing is possible unless through a network communication to a server you have access to on the internet. You can do persistence locally (to the android device) and even use a local database, but remember that this db exists on the device, so you won't be able to share information between users unless you somehow coordinate that through your app (and most likely a server-side app / rest api).
It is unlikely that your existing web app can be wrapped into a cordova app straight away, cordova apps are single page apps mostly.
I was thinking about how to architect my project. Im making a meteor webapplication for the normal browser, which will be a 'eventmanager'. which will be used to make events, that a seperate meteor app will then connect to via ddp, signup for the events etc.
So im obviously using DDP to connect the two apps but suddenly i was wondering where meteor places the serverside code in a mobile application, since this is a huge deal, a mobileapp has to work even when not on the internet, so i thouth that it would be logical that some of the serverside rendering was happening offline on the phone, and if thats not the case, well then i would have to seperate my app somehow, into something that renders with the localstorage data if not connected to the internet & i would have to sync the two applications databases + local storage.
Im thinking that the serverside code does run on the mobile phone, it just feels counterintuitive that each mobile phone has its own 'server'.
thanks for any help :)
Cordova is just a wrapper. It works just like any other browser. While it does provide API access to the hardware, the app itself is not native. It's a hybrid app platform.
The client side runs within the app container (Cordova) and communicates with the server portion over sockets.
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.