how to allow android to access/modify a remote database - android

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.

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

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.

how to connect android to online database?

MySQL
Server: db4free.net via TCP/IP
Server version: 5.5.12-log
Protocol version: 10
User: alan89#88.198.43.24
MySQL charset: UTF-8 Unicode (utf8)
Web server
Apache/2.2.14 (Ubuntu)
MySQL client version: 5.1.41
PHP extension: mysqli Documentation
This is my online database and the name is imammuda. In the database there is a table named "Testing".
Now, I have 2 applications which are admin and user. Admin needs to login into the database server then update data, while user just retrieves data or tables from the server.
I was stuck here at how to code the bridge between Android and server.
Well, if you need to communicate directly with the database you can use the MySQL JDBC drivers: there are many many many security problems with embedding direct database access into your app, but that WOULD work (longer dialog at Is it sensible to connect a desktop client directly to MySQL?). You would need to pass the username/password into the app and then you can just use regular JDBC code to talk to the database.
Alternatively you will want to implement some form of HTTP web service to mediate access, perform the necessary data verification and do access control. That is honestly a longer discussion than can be performed in a single answer. As a number of other potential answers describe you will need to look at using HTTP client. Also, you will need to implement a web service in a convenient language: you can see a detailed discussion about writing a database access web service at Writing data into a database using a fully REST web service.
EDIT: interesting option might be http://htsql.org/

Categories

Resources