How to sync multiple clients with a cloud database not platform specific - ios

I'm sure our scenario is not unique but with the rise of varying platforms such as iOS, Android, Windows Phone and of course Windows, Mac, etc. there can be varying clients all sharing the same data. Our cloud database is SQL Server 2008 R2 and we are building an app for multiple devices. Even if just on iOS, we still have a single user with multiple devices (iPhone and iPad).
We need to build a sync system so a single user can keep Device1, Device2, and Cloud (SQL Server) in sync. Can anyone suggest a system for going about this? I can only imagine that we'll have to get a list of UniqueID's (GUID) and row versions (and/or LastUpdatedUtc time stamps) and pass a list to the cloud, do a compare with the cloud's data, then apply updates, return changes required for that device, and do this for each device. Is this the proper way to handle this? Then how do you build such a system that performs well?
I'm open to any suggestions on building a sync system, again for the scenario of one user, multiple devices (cloud, device1, device2).
Thank you.

have a look at the Sync Framework Toolkit
you should find samples there for WP, iPhone, HTML5, etc...

Related

How to register and identify single device on Android Things Console or How do we get a device onto a channel

I am new to IoT. I am going through the Android Things Console docs where it was written:
You must flash the device with an image from the Android Things Console in order for the device to receive updates.
Here, I am not able to understand how devices get registered/enrolled on Android Things console and how we can identify a single device. How do you get a device onto a channel .
When you create an image in the console, the system image is linked to that product that you've created. This hidden identifier is used for future OTA updates.
It does not allow you to identify single devices. If you want that, you may want to use your own solution, which may involve a number of IoT solutions like Google Cloud IoT Core.
To get devices onto a channel, you can take a look at the UpdateManager.

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.

About Jasper IoT Platform

I am just bit curious. I am new in IoT and currently started working on it using ESP8266 device. I know that it needs some firmware to write and install, like smart.js.
But I have read, Jasper (http://www.jasper.com/) can connect any device and manager, monitor etc. So I am bit curious how it works internally. I am not sure whether it installs firmware created by Jasper or in other way. I was reading this article: http://www2.cumulocity.com/guides/users-guide/jasper/#link-sims
Anyone knows about this? I mean how Jasper works to connect to any devices?
Cisco bought Jasper, which is useful for IoT business. However it might be better way for you to check Interactor(www.interactor.com) which is great for IoT development. Interactor works to conntect to any device with any protocol.
Cisco Jasper should not be confused with device management libraries (whether they be server based, or device based or both).
Jasper is a telecom based service that allows you to see and manage the connection state of sim inserted in the device. Regardless of the state of a device, the modem and sim (provided they are powered) will connect to the telco and provide basic information about the connection.
Think of it as a network tool (server originated) for the gateway on the device, not the device itself. It allows you to force disconnect devices from the network, ban sims from the account so a stolen or runaway sim can eat through data, basic connectivity tests (is the modem powered, does the sim have permission to transmit data over the network, etc).
The main value of jasper is that it allows you to manage you data costs by applying the appropriate rate plan to each device, and disconnect devices that are using too much (for whatever reason).
Jasper does not cost anything to use, however telcos will apply a rev commit (min monthly spend) usually $500/month to gain access. the sims are the same as PCS (phone) sims, but they are on their own network internally, and are specific to that telcos jasper. i.e. you can't take 500 devices using PCS sims, and import those sims into jasper. you'd need to do a physical swap of the sims.

Is it possible to get a unique identifier for an ios device from a browser, in a controlled environment?

This is (a very simplified version of) the scenario with which I am faced:
I have an existing web application which manages jobs. We are now purchasing a number of ios devices (iphones and ipads) and I need the web application to know which specific device (regardless of the user) is updating information through the web application (as well as getting the GPS co-ordinates, but I think I have that covered with the geolocation API).
I have control of all the devices, they will all come to me before being distributed and will return to me periodically, so I can modify/restrict etc., but I can't jailbreak.
I have no experience of ios, but if there is a way to do this without needing an app, that would be the best choice.
You can use HTML5 storage to create and save a GUID the first time user accesses your website and send it with subsequent requests.

Transfer data over wifi without a database

I want to get to know how I can transfer data easily between 2 iPhones, over wifi. I would like to know if I could do that without having a server or database, but within an app (so without using email).
Game Kit has support for Peer-to-Peer-Connectivity and is, despite the name, not only usable for games:
The GKSession class allows your application to create and manage an
ad-hoc Bluetooth or local wireless network, as shown in Figure 1.
Copies of your application running on multiple devices can discover
each other and exchange information, providing a simple and powerful
way to create multiplayer games on iOS. Further, sessions offer all
applications an exciting mechanism to allow users to collaborate with
each other.
You can also check out Bonjour API from Apple. I am not sure if you need a static IP for it to work or it can just work over wifi. Just trying to give a pointer.
Based on your exact usecase, it can work well.
Check it out here, Game center is also there.
http://developer.apple.com/technologies/ios/networking.html

Resources