NativeScript : I have to develop an offline app for Android + iOS + Web app. Offline data will be stored in SQLite DB - angular2-nativescript

Using native script, it is possible to access SQLite DB. But is it possible to use SQLite DB from NativeScript + Angular web app?

Anthing you can do in NativeScript Core, you can also do with NativeScript Angular, so yes you can access a SQLite database with NativeScript Angular as all you need is access to the local file system to store the SQLite database.
On the other hand, you mentioned "web app" so not sure if you meant to ask, "Can you access a SQLite database from a shared mobile/web app, using NativeScript Angular for the mobile app, and regular Angular for the web browser app?" If that is what you meant, then no, you wouldn't be able to access a SQLite database from the web app becuase SQLite databases are stored locally as a regular file, so there would be no way for an Angular web app in a web browser to access the same SQLite database file as a mobile app. For this situtation, you would need a traditional database server setup like MySQL, MariaDB, or PostgreSQL, hosted on an external server, where both the mobile app, and the web browser app can access that same database over a network connection. You could easily have the Angular web app, and the database cluster, hosted from the same server.
I personally use a PostgreSQL database server with a shared NativeScript Angular mobile app/Angular web app in production and it works really well. It is really nice to be able to share a lot of the Angular code (mostly core services) between the mobile and web app.

Related

Is there a way to sync PWA web client IndexedDB data to OneDrive?

I am developing a PWA web client app. The data is stored on local IndexedDB.
Is there a way to sync the IndexedDB data to OneDrive with its api? Or I have to develop my own server for syncing data.
I have checked the OneDrive api, and I know it supports files sync. I don't know how draw.io does, seems like it saves the file to OneDrive.
Right now I am considering to change the app to Chrome extension with google sync or make an Electron app to use OneDrive to sync the data.

Use external mongodb in mobile build of Meteor

I've seen in a lot of places that in order to use an External Mongodb in Meteor applications, you should use an Environment Variable MONGO_URL. However, I'm building my application to work both as web app and mobile app (by generating an apk).
The problem is that when I start meteor as MONGO_URL='mongodb://user:pwd#path.mlab.com:9999/db' meteor it works well in my computer. But, it's not possible (I haven't found any way of doing so yet) to do this in mobile.
So, anyone has any idea of how I could use an external mongodb in mobile applications?
Thanks!
It seems to me that you are confused about how Meteor works, and more generally the client-server architecture.
Only your server has access to your database (whether on the same machine or at a third party provider), so that you keep control of exactly what your Client has access to.
By "Client", we mean what your visitor uses to access your app, whether a web app through a browser, or a mobile app through a Cordova wrapper.
So your mobile app only needs to know the URL of the server it has to connect to. That is specified by the --server option when you do your meteor build.
Then your server needs to know how to access the external MongoDB. This is your MONGO_URL environment variable. In production, you would set this variable on your server host. Each provider offers a different method to configure those environment variables, most of the time there is a graphical administration panel.
Note that the way Meteor works, you can use the same server to support both your web app and mobile app at the same time.
Finally, you can also test on mobile using meteor run android instead of just meteor (or with ios instead of Android, but you need a Mac). Of course you can still specify your MONGO_URL variable in the CLI when testing, exactly like you have done when testing on browser.
For mobile (cordova) meteor applications think of the app as just a web view with the ability to access native device features (camera, bluetooth ...). Since the application is basically a web view, the underlying mongodb associated with it is the same. If you want mobile device specific storage take a look at GroundDB
For your situation, if sounds like your mobile app is having problems connecting to your server, ultimately not allowing it to pull data from the mongoDB. Make sure that when you build the mobile application you have server specifed '--mobile-server'. Also if you are running it locally, make sure your mobile device is on the same network as your computer and any firewalls that might not allow connections are disabled.

Unity 3D application cannot access SQL server database when built as web player?

When I build as a standalone executable my application works fine with database SQL server, but does not work when built as a web player. What can I do?.
You won't be able to connect to a database using the web player as it is inside a security sandbox.
Restrictions on accessing data on a domain other than the one hosting your .unity3d file.
Some limitation on the usage of the Sockets.
You can read more about it here: http://docs.unity3d.com/Manual/SecuritySandbox.html

How to access local mysql from chrome packages app

I am developing a chrome packaged app. There is already an VB application running with mysql. I want to access the same database but use chrome packaged app as client.
How to access local mysql server from chrome packages app using javascript ?
I am aware of IndexedDB.
You have two options:
Create a web service (e.g. some PHP pages) that talks to MySQL and allows your app to use it as a go-between
Write your own MySQL driver/communicator to communicate with it directly: http://developer.chrome.com/apps/socket.html
The first is the easiest and would take the form:
Your chrome app would use AJAX to communicate with the PHP pages (probably via "POST")
Your PHP pages would expect it to login, use SSL and then use a token to continue identification during a session
The PHP would have generic capabilities to do CRUD actions
The PHP would spit back JSON for the results
but the second option would make you a hero if you took the time to develop that and put it on sourceforge or github under a permissive open source license.

Developing backend Webservice and Database for iPhone App for Standalone person

I want to develop my iPhone app but I am not sure what could be the options I have for hosting database and webservice to communicate with my iPhone App. Could someone please suggest me what could be the best way to go for this?
I know how to build everything but never come across this situation. I have been working in environment where we ask Admin to give us Server where we host everything but if I want to do it myself and don't have server infrastructure what could be the options do I have? Do I need to purchase from web hosting provider?
Thanks.
From my experience, I've developed back-end part for iPad client. It was REST, ASP.NET Web API (WCF Web API) and as database on back-end MS SQL Server and MySQL.
Anyway for mobile clients you can freely use REST. It can be ASP.NET Web API from .NET or other libraries that help to make REST services for example from Java.
REST is good consumed by mobile client applications. And then from client application perspective, it's no matter what database back-end will have.
Speaking about hosting it also depends from requirements to back-end. When you have no server infrastructure, you can use cloud PaaS like Amazon AWS (EC2) for example. Or host server it by yourslef.