1

I wanna to connect android app to SQL server 2012. I have a database in SQL server and need to insert and retrieve data from it. And I need step by step procedure because am new to SQL server and android database connectivity. Any help would be welcome and appreciated

4
  • 1
    Don't, at least not directly. This is for two reasons. First off, that would require you to expose your database to the internet, that's an unnecessary security risk. Secondly, it would require you to put your password in the app, and that would make it trivial to directly connect to your database and screw with your data. Instead you need to use a webservice to separate the two. But a step by step guide is WAY to broad for this website. Commented Mar 8, 2015 at 9:08
  • Can you explain how to connect web service and database?? Commented Mar 8, 2015 at 9:10
  • Your database will provide a library to do so, or your programming language will. The exact answer depends on language and database implementation. Commented Mar 8, 2015 at 9:12
  • How do i find that library in database and how to connect web service and database... If any possible give samples library in sql server and references Commented Mar 8, 2015 at 9:36

1 Answer 1

3

One possible solution might be using a .php file on your server that handles the database operations (i.e. SELECT, INSERT, UPDATE etc.). In your app you only have to call this .php file via URL with the right parameters using a ServiceHandler:

ServiceHandler serviceClient = new ServiceHandler(); String json = serviceClient.makeServiceCall(YOUR_PHP_URL, ServiceHandler.POST, params);

Here are two good tutorials that I used myself:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.