electron app limited by browser connection limit - electron

We are thinking of building electron app for uploading files using aws node sdk. Completely new to electron. We want to utilize node sdk multi part feature. My question is will number of multipart connections limited by max number of connections browser can make? I know electron is not browser but container, wanted to get sense before venturing into it.

Related

PWA on IOS and offline storage

We looking to develop an "App" which would have the ability to record the details of a damaged car for assessors. The idea is that a small number of assessors would have company iPads. Then when car is damaged and returned to the car yard they can visit take photos, enter some details and then upload them into the main system later. Some of the car yards may be in areas that do not have internet coverage, so offline capability is required.
Our initial thoughts were to develop an IOS App for installation on a small number of company iPads. The App could access the camera to take photos and then when the device has internet access upload the photos to the main system. However this solution could prove too costly (regarding development costs) for the customer.
I have read about PWAs and caching data, but the caching seems to be for offline read access.
If we installed chrome on an iPad and then installed a PWA then presumably
The PWA could store pictures up to 128GB * 6% = 7.68GB?
If stored using the File System API then (as long as there is plenty
of space on the system) the data will be persisted (my understanding is there is no time limit)? Or would a different type of storage be more suitable.
The offline data is obviously important (may be required in court) so are there any other concerns around persistence & stability before the images are uploaded to the main system?
Note we would prefer to use iPads (as the customer would prefer these) but we could consider other platforms.
At this stage I am really trying to find out if a PWA accessing the offline storage is likely to be feasible, practical and stable on the platform?
Firstly, iOS restricts third party web browsers (or any app that displays web pages) to using its own engine - installing Chrome on an iPad will not enable access to any web APIs that iOS/Safari doesn't already support.
So in particular:
File System API is not available on iOS, even if you're using Chrome
Cache API has a storage limitation per website of 50MB
IndexedDB has a storage limitation per website of 500MB or half the device's free space (whichever is smaller)
PWAs and their cached data are automatically wiped from devices if not used for a few weeks
the "navigator.storage" API for requiring durable data is not support on iOS, even if you're using Chrome or Firefox.
My first thought would be that if you are only going to support iPads and indefinite offline storage is a requirement, you are probably best of with a native application. Keep in mind that for this kind of application you would need the Apple Enterprise Program, which is more expensive than the regular Developer Program.
However, if you do want to use a PWA, your best bet for local storage would be the IndexedDB. As per the comment by skybondsor, browsers do indeed limit and possibly evict data after a while, according to ADM webdocs.
But reading your question, I get the sense that you do not really need persistent local storage, but rather a method ensuring that your data will eventually end up on the server. You can accomplish this by exploiting the Background Sync methodology. This allows your application to delay the upload to when a stable internet connection is available.

Can I use OpenCV with a web app?

I want to control my app using hand gestures. For various reasons I have chosen to make a web based app.
Is it possible to control/interact with a web app with OpenCV (or any other program) running as an agent on the client, communicating directly with the page on the client rather than with the server?
The web app doesn't have to be in a common browser, it can be something like Qt WebKit. I am ok requiring the user to have an agent on their computer.
The server is not running locally!

Access Native Resources in Electron App

I'm currently evaluating Electron for an upcoming project. Perhaps my question is trivial for someone who has used Electron. However, I can't find the answer in the documentation or maybe don't fully grasp the concept.
I want to have a web app that users can access with a browser if they choose or from a native app, if they want to use a USB device (in this case, a credit card reader) attached to their pc. So, the main.js file would open the remote web app like so
win = new BrowserWindow({width: 800, height: 600})
// and load the index.html of the app.
win.loadURL('http://www.example.com/login.html')
Is there any difference in being able to access local resources (files, ports, etc, if the page is remote vs local? In other words, can you still access the USB ports from a remotely hosted web app wrapped by Electron the same as if the files were local, as in the case of an installed native Electron app? I would think it would load a remote page the same as a local but not sure if ipc would still work.
To access native resources on devices you'll need to be running an electron BrowserWindow with nodeIntegration enabled. This is the default but there are big security implications when loading content from the web into a node enabled BrowserWindow. If you're site is compromised through XSS, all your clients PC's will be open to remote code execution.
For that reason you should build a backend service with your API and then host a front end on a website and a distributed version in your app. You can still build the two from the same code.

Applications that require a web server for full functionality

Is it possible to deploy an iOS application that requires a Node.js socket to do something on a computer?
For example:
Application -> Node.js socket -> Doing something on a computer
Computer does his job -> Response from Node.js socket -> Processing data with application
I don't think that Apple allows this, but one of my friends is sure about it. My point is that this solution does not reflect to an easy usage instead of making it a little bit complicated for average users.
The answer is yes. I don't know how to integrate Node.js into app, but there are many other server that can be easily added to app, such as CocoaHTTPServer. I have created a project to manage files inside app sandbox. Open web page hosted by app to manage files. I know some other apps, which provide web page hosted by app to transfer media files.

iOS: filesharing without iTunes?

I develop an enterprise application for iOS and the user should be able to add files from the desktop to the application.
I implemented this using filesharing, which works great.
Now this company wants to get rid of iTunes from their machines (which is quite understandable, iTunes is a very invasive process).
The question is, is it still possible to somehow use filesharing without iTunes? maybe with another application?
Or what other way is there to send files to the app (preferrably without the need of an internet connection)
//edit: must work on windows 7 and must not require to install iTunes (there are some other tools that allow access to the iPad filesystem, but they go through drivers installed by iTunes)
You could exchange data via the local wireless network (a connection to the internet is not required, just the iOS device and the Windows computer need to be on the same network).
One option:
You can then create a simple TCP/IP connection over sockets between an iOS app and a Windows application and exchange the data you want.
However you probably need to implement a suitable simple Windows application to do this.
An other, maybe simpler, solution:
You could start a webserver in your iOS-App and show it's IP on the screen. By entering this IP in a browser on the desktop computer you can access websites on the iOS device, which can make documents available for download or receive uploads.
For how to do this, have a look at this question.
There are a number of ways to achieve this, ranging from trivial to sophisticated.
Your question says that you would prefer to avoid an internet connection. Simple solutions may require it - if you want to abstract the difficult parts, you're going to have to let somebody do the dirty work, and that's probably going to be someone(thing) on the internet. Midrange solutions may require a network but not internet connection. A sophisticated solution could probably be whatever you want - but one thing I would say, is that trying to tap into the USB connector is either going to result in a hacktastic or very complicated solution to implement.
One method would be to integrate a third party framework that basically does what your looking for. Look at the Dropbox development kit, for example - allowing Windows (or any platform) users to drop files on their desktops into a shared dropbox, and this can then be read by an iOS application which includes the iOS drobox API.
Another method would be to setup a simple WebDAV server in your office. Host it on a windows box, or a cheap linux box. Give users desktop's access to the share via whatever protocol you want (eg, Windows File Sharing). Then you'd implement a WebDAV client in your app (eg, WTClient) to pull files.
Finally, you could build your own transmission system. A sophisticated example might involve Bonjour and TCP/IP, a simpler-but-custom solution may involve a simple JSON web service running off a local (or remote) server.
I have suggestion but that will require the Internet. I would suggest you to use the DropBox API in the windows and iPhone both. It's awesome to use and very simple for file sharing.
Now a days everybody have dropbox account and have files in it to share. So that shouldn't cost anything other than a bit of implementation (this learning can also be used in other file sharing applications).
Here are some guidance:
iOS
REST API
You can add apps and documents to USB-connected devices with the Apple Configurator
You may use a simple Ftp server installed on PC, so you can connect to server from Ios and upload/download files from iOS to PC....
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFFTPTasks/CFFTPTasks.html
All work is done by Pc and your app will use IP (Intranet or Internet) of PC to share all files.
From Ios you can read all files in FTP server and work with them.
I use the FileBrowser app to get access to network shares over WiFi and will allow you to load supported files to the device. The company responsible is creating an API to allow you to do this within your own app: https://twitter.com/#!/Stratospherix/status/193114857271336960

Resources