Are PhoneGap and Apache Cordova real servers? - apache

After reading the docs, it seems that phonegap/cordova is like a local web server that serves html, js and css to the mobile native browser.
Can phonegap/cordova serve files not only in local ? i want to know if it is possible to make them LAN servers for example, without installing apache on the mobile device??
Thanks.
UPDATE:
I feel i need to describe my probleme.
I need to create a mobile app, that allows mobile devices connected on the same wifi network (without internet) communicate with each others. If this is possible only with phonegap it would be great.

Cordova uses the WebView component to display your content. It's more or less equivalent to opening html files directly in your desktop browser by going to file > open.
If you want some content on a lan, just link to it in the html that is rolled into the Cordova app as you would load any content in html from an external source.

Related

Hikvision MJPEG substream embed to HTML

we're using a couple of hundreds Hikvision Cameras (DS-9664NI-I8) for a University. We want to embed them to a web page hosted locally. Cameras, NVR, and webpage are on same local network.
We don't want to use RSTP, we will use HTTP.
We're able to run the camera sub-stream on the browser using the following URL
http://<username>:<password>#<IP Address>/Streaming/channels/102/httpPreview
But, when I embed this to image src, this won't work, as browsers don't support the HTML embedded credentials.
How to play the camera streams on the web page?
You can disable security on streams. But if it possible - that depends on your camera and its firmware version. And be aware of consequences of course, secure your image with another means - firewall, etc.

Does Apache Cordova need a server?

I see that it uses HTML, CSS, and JS, but does that package with the app or does it need a server if it is a static page?
Also if a server is needed could i get away with hosting on Github pages.
Your HTML, CSS, and JS files are bundled with the app bundle and loaded from local storage. This means that your content comes from file:// (unless you have certain plugins installed that create an http server on localhost).
You'll only need a server if you need one as a backend (which you'd communicate with via XHR/Ajax).

Is cordova available in WL Webview where the url being loaded is a jsp or server side resource

I am loading a jsp or server side application using worklight webview (super.loadUrl("hostname:port/Myapplciation",false)). My question is will cordova related functionality work since its inside WL webview. If it doesn't work what is the actually reason because I had read that WL hybrid application runs inside a webview and cordova works there.
Thanks
yes, it will work.
(adding some more text to make answer at least 30 chars long so it can be submitted)
I don't have a working environment to try it out in, but my suspicion is that getting the JS files from either location should work, but that getting them from the device would be preferred because then you wouldn't have a cache miss and a remote download, and you wouldn't need to host them on the remote server.

How to make dojo work offline

I have a project that loads http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js, I want to be able use this project offline
I tried to download dojo.xd.js and link to it locally but this still doesn't work offline
In firebug, on the net tab I can see that there are a lot more .js files that load
Is there a simple way of making this work offline?
The way of integration depends on your way of using it.
I assume you have webserver running locally (without inet access)?!
At the dojo website there are several ways of dojo integration available. Just download one of them (do not use CDN) and put the file on your local web server. Then it is available through the local url (can be relative to your site).
If you wan't to build an "offline" app without a webserver then take a look at Adobe AIR and interation of the dojo toolkit with Dojo Extensions for Adobe AIR.
Another option might be the integration together with PhoneGap or Cordova to build an offline App, e.g. for an IPhone etc. with HTML/Javascript. Win8/RT Applications for the M$ AppStore does support HTML/Javascript, too (have not tested this with Dojo).
Keep in mind there are also some security restrictions (e.g. loading and execution of JavaScript) if you plan to "release" your app as simple html file (click to open in browser).

How to upload a photo image using Sencha Touch without phonegap

Is it possible to upload an image created by the phone using Sencha Touch but without any dependency on PhoneGap? Basically my app will be accessible via the web, and not installed natively on the device. I want to be able to select an image from the phone storage and then be able to upload it to the service. I effectively want the same functionality as you would get with the file upload control on a normal desktop browser.
Is this possible, and if so how?
There is a current solution in its infancy, but it works. I tested it on my Nexus 7 using Chrome. Here is the list of compatibility:
Android (4.0 up) browser support as regular
Google Chrome for desktop and mobile
iOS Safari browser support from version 6.0 (not tested on mobile)
https://github.com/kostysh/File-uploading-component-for-Sencha-Touch
Desktop webbrowser and mobile browser are different in lot many cases. To access file upload option you need to access the OS API which is not possible using javascript only. Phonegap provides us option to connect js with device API. If you can find a way to do this, without using Phonegap, then may be you can fix, or else its not possible.