Server side app

Discuss the company and its products.
Posts: 16
Joined: 20:00, 19 Jan 2015

Server side app

Postby zdravko » 14:20, 20 Feb 2015

I'd like to make a server side application access bluetooth device. When a page is opened in a smart phone browser, could it download everything needed to access bluetooth device and fill in the formfields on the same page? In other words, can pack Evothings in some javascript files and load it like jQuery, and then run scripts as usual?
What files do I need, and how to intergate Cordova Bluetooth?
Regards, Zdravko

Posts: 92
Joined: 00:59, 19 Nov 2013

Re: Server side app

Postby alex » 11:32, 24 Feb 2015

Hi, there were a lot of questions in there, let's start somewhere:

Normally, BLE (Bluetooth Smart, Bluetooth Low Energy) is outside of the safety of the browser sandbox. In Evothings Studio, we use the Cordova plug-in infrastructure to extend the capabilities of a web view -- inside an app, we actually don't use the phone's browser app as such.

If you have a server-side application, you could well have a mobile app download such a file (html, js, css et cetera) either on start-up or on demand (onClick or similar) from inside the web view. This page could be pre populated with data, and using the mobile apps access to Bluetooth you could add more info to e.g. a HTML Form, so that some of the info came from the server, and some of it came from the app via the Cordova BLE plug-in for instance.

Does this address your question, and is there any specific scenario you'd like to see happen? I think the BLE Scan example could be a good starting point for your study, and you could expand from there. (code found in the Workbench part of the Evothings Studio)

Posts: 16
Joined: 20:00, 19 Jan 2015

Re: Server side app

Postby zdravko » 12:06, 24 Feb 2015

I'd like to build a small starting Evothings app on an android, that acts like a "safe browser", loading its index.html files from my web server. To start with the app would have an index.html with a form submit button "connect to web server" and the response would contain another index.html.

User avatar
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: Server side app

Postby micke » 10:39, 08 May 2015

Arriving late at the party here! Hope the question is still valid, or even better solved :)

You can certainly build a "safe browser" for your app. This is basically what Evothings Client is.

The trick is serving the cordova.js files. In Evothings Client they are bundled with the app and accessed locally, using special native code hacks.

In your own Cordova app, you can use the same code hacks, or you can serve cordova.js and associated files from the server.

The problem is cordova.js et al are different depending on the platform (iOS/Android), so you have to serve them using some conditional mechanism. The simplest way is perhaps to just have one url for the Android version of the app, and another for the iOS version.

Are you with me?

Best, Mikael

Posts: 16
Joined: 20:00, 19 Jan 2015

Re: Server side app

Postby zdravko » 08:49, 11 May 2015

Thanks. I found that if I stick to AJAX remote calls only then all the html and javascript calls to local
functions would be processed as if they were hardcoded by the on board local Evothings client. Which is
actually what I was looking for: to get different functionality from client without having to update phone
client to new application.

Best regards, Zdravko

Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 1 guest