Access SQL Server Database in Phonegap Cordova App - android

I'm building an Hybrid App using Cordova in Visual Studio 2017, and JavaScript.
I have a SQL Server Database hosted on Google Cloud Platform and I want to access the data of this database in my App.
Which is the best way to do this in a Phonegap Cordova App? I have no idea since I've never did this before.
Thanks for now.

Though it's probably possible to access a sql database directly with some javascript magic, it's not safe. In this situation you will need your app to contact a web service which will communicate with you SQL tables to relay the information. Think of the web service as a "middle-man".
There are existing services out there, but it is also easy enough to create your own setup similarly to this: https://iphonedevlog.wordpress.com/2014/03/28/populate-your-phonegap-app-with-data-from-an-external-server-db/

Related

What SQL databases are used in Android to build a simple app with a login system?

I'm trying to build an Android app where the database is on the server side.I hear that SQLite is a local database so it doesn't really work for what I'm trying to do.
In java I would use JDBC to connect to MySQL and send requests normally.
In PHP too it's almost the same thing.
The app needs a login system and all of that...
How can I do this in Android ?
Android does not support MySQL out of the box, but you can implement it.
Probably the SQLite you heard about, in the Android environment, refers to Room, the standard to save persistent data locally on the device.
In the mobile world, often a good option (if they fits for you) are NoSQL databases. There are plenty, hosted services like Firebase, DynamoDB or open source like MongoDB, Supabase.

Xamarin.Android Application Connecting to SQL Database

I am looking to create a simple xamarin.android mobile application which can connect to and interact with an SQL database hosted in azure. What would be the best way to create this connection? I have been able to create a simple console application which can do this if that helps, but am unable to do a similar thing with an android app. Thanks
You can try Azure App Service Mobile Apps to work with an SQL database hosted in Azure in your app.
Have a look at these samples from Xamarin. The "MyShoope" App in particular uses data storage.
I have provided my existing .NET Backend for reference on how to create your controllers and data entities to publish to Azure. Read through the Azure Mobile Apps tutorial to learn how to create and setup your own Mobile Apps backend for My Shoppe. https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-xamarin-forms-get-started/

Sqlite database login system

I'm trying to create a login system for an android app and I would like to know if creating a Sqlite database solution would work across different devices. For example if I register in a device, could I access the app from another device with that same account without having to register again? If that does not work, what would be the solution? Thanks for the help :)
Ideal solution would be to connect the app to the server for authentication and authorization. The server can be build using any type of database whether it is sqlite or mysql etc. So it does not make any difference.
You can create a web service for the purpose of authentication using php, java or .net (your choice) and the android application can use any web service client framework such as service stack etc. for connecting to the web service.
What kind of authentication and other features you want will depend solely on your application design.
The best option is using a web server. I am doing the same and am using a .net web services for users authentication
For allowing same user to loggin in different devices with same credentials in the app you need to use central database .
Below is the link which will help you a lot.
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Note : Sqlite database is the local database , we can not use it for our central purpose or out of the specific device.

Communication between website and android app

I want to build a website, where the data will be saved in a data base, logical in a sql database. Also, I want to build an android app, which will take the data from the above (sql) data base. How can I achieve it? I mean how can I manage the communication between the website and the android app. In past, I have create website with php and sql and also I have build android apps, but now I want to achieve the communication between them. Can I use parse platform?
FYI, without any server communication you can't use the website database in android application.
If you want to manage the communication between the website and the android app means you need a centralized server which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them.
yeah unfortunately chrome won't let webapps use local storage on android. what you can do is create a local server (using org.apache.http package for example), let it run as a background android service, then have the website make requests to that url. Its considered hacky, but it would work. You can post whatever data you wanted the website to know about , and then get it from the website.

Website and Mobile Application Database Linking

I have an idea for a website that will require the use of a database to keep track of user accounts, and other things the user does on the website. I have experience with developing websites with MySQL database. I was hoping to also create an application for the website on Android and iOS. I have some experience with Android development, and I am still learning quite a lot. However, I have not done anything with databases in mobile devices.
What would be the best way to create a mobile applications and a website that the user could use to access their accounts. Would it be best to have a mobile database on the handset and sync it with the database on the server, or would it be best to have the application query the database on the server directly?
Thanks,
Michael
The best way I suggest is to use APIs.
You can create APIs to access the database through your mobile application.
You website will also be using the same database, and your mobile application will be calling the APIs to get data from the database.
May be this can help you to get started: http://www.javacodegeeks.com/2010/10/android-full-app-part-2-using-http-api.html
I think, Use web-service to communicate with web database. It is easy to use because you are using this database for both android and ios.
Thanks.

Categories

Resources