What should we use for offline-first with Flutter and Yii2? - database

We wanna create an app that is offline-fist. We're trying to use or create an auto sync database that allows work offline with app. Our client is Flutter and our back-end is Yii2. What is the best solution?

I have developed multiple offline sync applications. I can not tell you about the backend much but I can tell you about the Flutter.
For storing data on your device there are multiple plugins you can use.
sqflite-: It works well in android and ios.
shared_preferences-: If you want to support all the platforms then you use shared preferences but there might be some security issues here.
For Auto-sync
You can use the internet checker and sync your database with live.
connectivity_plus-: Works well but sometimes it does not trigger the callback for connectivity. (work well for all the platforms.)
Note-: This plugin does not give you if the internet is working or not.
internet_connection_checker-: work well in all cases and also provides if the internet is actually working or not.
If you want to sync when the app is in the background then you may need to use
background_fetch
Happy Coding ;)

Related

How can I share local database of an existing app with a new app and make both work on it simultaneously?

One of my client's inventory management project supports online as well as offline mode to manage huge inventory data and is built using Xamarin.Forms & sqlite-net. Now, the client wants to create another similar kind of app and wants us to use the same local db of the first app.
The actual functionality he needs is that if I have data in one app then it can be shared to the second app and vice-versa. Like, if I'm logged into the first app then user automatically gets logged in to second app when it is launched. For that reason being, we need to have a shared database among both these apps. So, that both apps can read and write in a shared database. How can I achieve this? What will be the best and most efficient approach in Xamarin?
After some research I've found things like shreduserid for data sharing among android apps and App Groups for data sharing for iOS app. If anyone can help me with how to work around with them and best approach to follow.
Anyone having any idea or have done such thing is requested to provide your suggestions/links/code etc.
Thanks!

secure keys or sensitive data in angular2 nativescript

I am curious to know of available options, that a developer can use to secure sensitive information inside the mobile application. This is to prevent anyone from breaking the app and use keys for some nefarious purposes. Example of sensitive data includes passwords of APIs, which app can use seamlessly in the background to retrieve data.
Code obfuscation can help but cannot prevent from stealing the information;
Local storage options such as nativescript-couchbase or nativescript-secure-storage -if my understanding is correct- depends on feeding the information manually after installing the app. But the information needs to be available inside the app at the time of shipping.
OAuth is not an option as it requires the user to login in order to receive the tokens. JWT is neither an option, as the APIs are protected just using basic authentication.
I am using nativescript/angular2 but i would appreciate any generic simple yet effective ideas..
I think you are looking for obfuscation here, securing the information within your source code. By default {N} has uglify plugin configured within webpack, it gives the basic obfuscation.
There is Jscrambler support which is paid.
Also, speaking of Sqlite, there is commercial version of the plugin that supports encryptions but I haven't tried it personally. You may feed your data into it and pack your db at build time then install the db on first launch.

How to Ensure Installation of Mobile Web App on Device Only?

I'm working on an AngularJS mobile web app and am getting ready to deploy to Firebase Hosting. Does anyone know how to ensure that only devices can install the web app and prevent desktop browsers from viewing? I'm trying to protect the client's intellectual property as well as my own by making a reasonable attempt to disallow the source code from being read. Thank you!!
It's not possible to prevent the reverse engineering of any web application.
Developing a mobile application using native code may make you feel more secure about the intellectual property, however once a would be attacker gets the software on to their own hardware they will have the opportunity to defeat your software.
I wound up using ng-device-detector to determine whether the user was using a mobile device or not, and delivering a different template page depending. This library contains an isMobile() function that works great.

How to create pages in one note native client in windows wpf application OFFLINE?

How to talk with native one note client and create pages and sections in WPF application offline? As per my search there is no API exposed for One note native client to do this. Our requirement is to create pages offline and write something on it. When online this pages should sync with onedrive. Is there any way to do this?
After a lot of exploration, I came to know that onenote store does't work Offline. It was developed to work in online only. If you want to create notebooks and modify them offline then use Onenote Desktop and Application Interface to talk with it.

What database to use with PhoneGap

I am creating my first mobile app using Phonegap and I am not sure what database to use with it. I have read a few articles and am finding it hard to decide on which is best to use. Two of the ones mentioned most seem to be MongoDB or SQLite
Because PhoneGap needs Nodejs, I thought that MongoDB would be a good option but is that too robust? I am familar with Mongo but don't want to choose it just because it is convenient, I would prefer to use what is best.
The app will hopefully store information both locally and on the server. Will probably be information like you would store for a messaging app - user info, contacts, messages etc.
Anyone know which would be best to use? - or if another would suit my needs more?
The phonegap is a framework that allows you to create mobile applications using API's multi-platform web. The choice of the database in my view
should not be given by the framework, but for what kind of application you are doing.
I see three ways to store data from your mobile application.
1: Local Storage (http://www.w3schools.com/html/html5_webstorage.asp)
2: SQLite (https://github.com/brodysoft/Cordova-SQLitePlugin)
3: Database on server (can be anyone.)
The choice will depend on what you want from your application. If it is a simple application that will be stored few data, use the local storage of html5 that stores documents. If your application is already a bit bigger and more complex, you can use SQLite implemented in the browser using HTML5 which is supported by most current mobiles browser. The advantage here is that access to the base is done without the need to build a server. In the third case your application would be the type client server, in which case you should use the database on the server. The choice of database can be what you feel is appropriate.
I suggest you go with IndexedDB if you want to store a lot of data in the client or LocalStorage which is able to store 5MB worth JSON data.
This is just the front end but for the back-end there are so many to choose from and if you plan to write the back-end with Node then it will be wise to use MongoDB.
I would suggest using the Cordova-SQLitePlugin as it offers a native interface to sqlite, avoiding quota restrictions associated with WebSQL on mobile devices. The plugin is supported on Android, iOS and Windows Phone 8 platforms.
If you want to keep a local and remote database in sync, you may consider using this in conjunction with PouchDB
PhoneGap can use LocalStorage, SessionStorage, or SQLite databases. You can also use PhoneGap to connect to the devices native classes via a plugin, and pass the native class data, that it will then store on the device. check this link to find more details
What database does PhoneGap use and what is the size limit?

Resources