FireMonkey access SQL Server on Android or iOS - android

Is there any way to access a SQL Server database using Delphi XE5 FireMonkey in an Android or iOS application? There doesn't appear to be a way to do it using FireDAC or UniDAC.

The recommended way to access SQL Server from iOS and Android is via DataSnap. You have to make a DataSnap-Server on a Windows-Machine that connects to SQL Server. The iOS and Android clients then connect to the DataSnap-Server.

Currently there are no clients available in Delphi that would allow you to access a SQL Server from Android and iOS.
FireDAC is the standard way to access, but mobile is only available to access Interbase (ToGo version) and SQLite.
The logical thing would be to use DataSnap or Webservice on the server.

Create a DataSnap Rest Server (http,https)
Create methods that return JSON
Consume that methods from client(Android/IOS)
DP

Related

How to connect to a SQL Database on an Android Kotlin app

I am building an Android application with Kotlin. I am not very familiar with Databases and Backend in general, I have only used AWS DynamoDB and S3. I want to try something else and learn SQL. I want to connect my app to a Cloud SQL DB like MySQL or PostreSQL. I can't use SQLite because I want the app to be served remotely and be accessible by all the users. I don't need a server, instead I would like to use a server-less structure where I make queries to the DB on function calls from inside my App. How would I do that? I read online about services like planetscale and raiway.app but I can't find a way to connect to my tables there. Are they perhaps web-only?
If you have a remote back-end you can use retrofit https://square.github.io/retrofit/ otherwise you can use room library https://developer.android.com/training/data-storage/room.
I understand that you aren't going to use a Server but in the case where you have to make queries locally, i.e. you have your database on your PC, you must use retrofit and for doing this you must make a small API that will send you JSON and you can process your queries easily with that. If not, you can use room to connect to sqlite, a small database that is default on android phones.
Some Links :
https://square.github.io/retrofit/,
https://developer.android.com/training/data-storage/room.

Android apps connect with database server

I am trying to learn to implement android apps to get news, promotion message, and calendar from server. What is the best and easy way to communicate with database server? using JDBC or other methods?
Thanks
Using JDBC?:
In the words of Commonsware:
Never never never use a database driver across an Internet connection,
for any database, for any platform, for any client, anywhere. That
goes double for mobile. Database drivers are designed for LAN
operations and are not designed for flaky/intermittent connections or
high latency.
On the client side (Android app), you can use SQLite to store data locally. It might not be necessary at all actually. For instance, it can be used for offline features, search, etc. For client-side, read up on this simple post
On the server side (whatever server side technology you know or want to learn), you can use whatever language, whatever database on whatever server OS you want. This part is commonly called the back-end, which will store your data while your app communicate with it through HTTP.
You can use json to parse data between server and the android device. In the server you can use jdbc with json if you are using servlets in the server.
To communicate between a server and an android device you can use JASON. See following links for some help.
http://www.androidhive.info/2012/01/android-json-parsing-tutorial/
https://www.learn2crack.com/2013/10/android-asynctask-json-parsing-example.html
https://www.learn2crack.com/2013/10/android-json-parsing-url-example.html
Also in the device to deal with data within the device you can use SQLite. And in the server you can use jdbc if you are using servelets.
To communicate with Database server You should use web service API such REST , soap

How to connect with sql server to develop android app?

I have a task to connect to connect to a SQL Server in the network to develop an android app using C#.NET in Visual Studio 2010.
How do I connect to SQL Server?
Where do I have to write the connection string?
How do I have to call that method?
I think u need a layer to encapsulate sql server to provide operation APIs, such as web service, WCF or Domain Serveice.
You can not access directly to DB, you would need some api to access the database server, I would recommend to use webservices, which will provide an interface between your db and your application.

Connecting Mysql with Android

I am new for Android Development. Now I want to connect Mysql with Android Application for uploading data to the server. Please send any sample code for connecting mysql with Android.
There is no MySQL connection library for Android that I'm aware of, unless you can get the MySQL java library operational under Android.
Either way, you don't want to do this - that would mean exposing your MySQL server to the world for TCP connections. There's no way to tell what IP your device will be appearing from. Each mobile carrier has their own internet gateway for devices, and it's invariably a NAT firewall to boot. This would be require you to leave MySQL wide open to TCP connections from all IPs, a major security hole.
Instead, you should build up a web service that acts as a middleman between your app and MySQL.
You can use MySql to connect to your android application through a servlet using Apache Tomcat. You will have to put your SQL syntax into the servlet you created and in your Java insert the URI path for the servlet.
i believe you need apache tomcat to run a servlet for your sql, do you have it?
The way it should work is , you use the sql-lite database to store the data that is generated in your application.Then, when you have a fixed set of data,convert into a protocol buffer, transmit the same via web-services,depacket it and store into a mysql database at the server.
If you need to manage data in a private database, use the android.database.sqlite classes.
Not sure if android supports mysql.
Go through the Notepad Tutorial for information on connecting to sqllite
http://developer.android.com/resources/tutorials/notepad/index.html
Other than sqlite we can't connect with any other database.
Using sqlite is also not a good practice, better use web service calls.
It is because, some viewers will be having less memory phones, has we are doing the application global, we should think of these things.
For small requirements you can use sqlite.

how to allow android to access/modify a remote database

I'm running a .net aspx application. I'll need my android app to access and modify/insert information into the ms sql database. is there any api ? thank you
You don't need any special API. Just use Android's HTTPCLIENT and perform POST and GET operations against your ASP.NET application to access and modify SQLServer's data.
Not that I'm aware of but you could write a server app on the client machine (or any machine with access to the DB) and connect to that via your android app and send commands.

Categories

Resources