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

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

Related

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

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.

How to connect Swift to a postgresql database hosted on Google Cloud

I'm new to working with back-end, but have been running into issues trying to get my iOS app to connect to my PostgreSQL DB.
I have developed an app with Swift which is a game that I want to run locally on iOS devices. I have a PostgreSQL DB set up in Google Cloud Platform but I cannot figure out how to get the Swift app to connect to my PostgreSQL DB.
I've read some about using Vapor or Perfect to run the application using Googles App Engine but I'm not sure that is what I want to do since I want the app to run locally but there are a few aspects of my app that I need a global database for.
Would anyone be able to point me in the right direction of how I need to connect my Swift application with Google Cloud's PostgreSQL?
Your question is pretty much very similar to this one.
In short, the correct answer is you shouldn't connect your client side application directly to the database. Instead, you should build a service that can connect to the database, and act as a service between your application. This helps prevent any unauthorized queries to your database and provides better performance. If you wanted to do this on GCP, you could look into something like Google Cloud Functions or Google Cloud App Engine to act as a service.
An alternative would be to use a "Database-as-a-Service" like Cloud Firestore. This is a scalable, pay-as-you-go service with great mobile support.
Yeah sure you need a server, ruby on rails to connect to your Postgres database.
The server will facilitate data back and forth from the Google cloud Postgressql

What directory to publish Asp.NET Core application on desktop to?

I come from the desktop application world (WPF, WinForms), where the convention is to deploy your exe to \Program Files[ (x86)]\CompanyName\AppName\ directory, and store all the data in \Program Data\CompanyName\AppName\ directory.
What's the corresponding convention for deploying Asp.NET Core web services on a desktop (not a server) PC? Program Files directory doesn't seem like a good idea, because it requires admin credentials for writing, a problem you hit the moment you try to publish the app. On the other hand, while Program Data doesn't have the permission problem, it just doesn't feel right, given there is no corresponding Program Files location.
I've also seen C:\intepub\wwwroot\web-service-name used, when IIS was involved. Is that the way to go? I'm guessing it makes sense when running Asp.Net Core app in Kestrel behind IIS as reverse proxy, but what if I were to host my app inside a Windows Service instead?
There is a lot of enduser as well as enterprise apps deployed as windows services with embedded web applications (using Apache, tomcat..etc) Under Program Files, Ex: HPE server admin/config tools.
So for Kestrel APP, I would deploy bin in Program Files and write logs,DB,etc under Program Data. it will works without permission issues since dotnet binary has the needed perms.

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.

View TouchDB mobile database in desktop

I launch TouchDB database from my iOS application. It works as http server via TouchDB framework class - TDListener and it provide REST API for external access.
How can I view database from my desktop?
Are there some frontend applications which can be adopted for viewing my mobile database?
I've considered couchdb-futon but I don't know how tune it for my issue.
There are a few options mentioned here:
https://github.com/couchbaselabs/TouchDB-iOS/wiki/Tools-for-TouchDB
Your best best is probably TouchDB Viewer:
"TouchDB Viewer — "Official" GUI app for viewing TouchDB databases. Runs on Mac OS. Can view local database files (including ones in the iOS Simulator) or remote ones given their URL (useful if you enable the listener in your iOS app.)"
-- https://github.com/couchbaselabs/TouchDBViewer
I'm sure you could get futon talking to TouchDB, but it'd probably involve delving into the futon codebase.
EDIT:
TouchDB is the legacy 1.0 version of the project now named Couchbase Lite. So, the "TouchDB Viewer" has been converted to support Couchbase Lite databases (which has '.cblite' extension) and also it has been renamed to "CouchbaseLiteViewer - Mac app for viewing/modifying Couchbase Lite databases".