How to connect with sql server to develop android app? - android

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.

Related

Android using mssql server [duplicate]

I'm currently developing a Field-Service application that stores data in the local sqlite database on an android device. At some point, usually after completing the data collection rounds, the local sqlite db is to be synchronized to a remote sql server db on the server, also i need to update some local table from sql server db.
Any suggestions as to how this could be achieved or engineered as a solution? Or even better, are there alternatives to synchronizing data in such an application?
I think that the best is using a intermediary like web services or your own TCP based logic layer for your application which would connect to SQL server and execute requests of your applicatation. Don't try to connect to your SQL server directly from Android. You can write
some backend code on your server (or webservice) and then call those code methods from your android device using Http.
And also there are many themes in stackoverflow like your:
How to connect Android to a database server
Connecting android with MS SQL SERVER 2008
About how to write web services. It's a big question, and you must choose technology, there are very many libraries, frameworks and platforms that help you to simply write a web service. You must choose communicating protocol, it may be SOAP, WSDL or maybe remove calling procedure, it may be rest application. If you use java stack, there are some popular frameworks at the moment:
Apache CXF
Spring Web Services
Axis2
You can start from reading what a web service is:
http://en.wikipedia.org/wiki/Web_service
Also some links which provide example of accessing web services from android:
Step by step to access web service from android
Android and soap web services
Accessing restfull web service with android
Another and much easier approach is to use a Virtual JDBC Driver that relys on a secured three-tier architecture: your JDBC code is sent through HTTP to a remote Servlet that filters the JDBC code (configuration & security) before passing it to the MySql JDBC Driver. The result is sent you back through HTTP.
There are some free software that use this technique. Just Google "Android JDBC Driver over HTTP".
You would have to keep a middle tier online server.Which may communicate to and fro between your application and MSSQL db.May be servlet or a request handler which synchronises between the SQLite and SQL Server db.

Connection between Oracle 10g and Android

i have a database in my laptop. i want to access it from an android application. since i am new in this field, i don't have a least idea about connection android with oracle. please suggest me how to do it?
i am using oracle 10g express edition. i want to retrieve a table data to my android app from my database.
please give me the codes that i will need to perform this task.
what files do i need to perform the connection.
Thank you
You should put a rest or soap service in front of your rdbms and let your mobile app communicate with it.
For php webservice (on a windows based machine) you can setup xampp with php oci8 drivers and oracle instant client.
You can use http post or get method from your android app to transfer data from your app to your webservice and vice versa. You can execute your sql queries from your php script(webservice).
If you don't want to build up you're own web service, then you can use oracle database mobile server
http://www.oracle.com/technetwork/products/database-mobile-server/overview/index.html
You need simple java util see attach
https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html

FireMonkey access SQL Server on Android or iOS

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

How to connect android to MySql database server?

In my project, I have to connect an Android mobile phone to a remote MySQL database server, to insert data to the database and get the data back later.
However, it seems that Android OS only supports the SQLLite database that works LOCALLY inside the phone.
Does anyone know how to connect an Android phone to a remote MySQL (or MSSQL, or Oracle) database server ?
Thank you!
You will have to access the database using some sort of Remote Method Invocation (RMI).
My personal recommendation is to create a RESTful HTTP interface to your MySQL database on the server. This may be a bit more work, but is preferred for its ease of use and compatibility with any system (that can make an HTTP request that is).
Essentially, you should create HTTP endpoints to Create, Read, Update, Delete (CRUD) data from your MySQL database on your server. Your Android client would then make calls to these HTTP endpoints to perform the corresponding CRUD operations. Of course you do not need to do the typical CRUD operations, you can make your endpoints interact with the database however you wish.
Like I said, a big advantage to this is how extensible it is. You can create another client, on another system, in another language, and all you need to do is make the proper HTTP call.
try using Jdbc... for more read this http://developer.android.com/reference/java/sql/package-summary.html

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