4

Excuse my ignorance but we've got an application that we'd like to sample out on a mobile app The app is a C#/asp.net application connected to our sql server database. If we are going to write an android application for this app how exactly does one connect to the sql server instance? I've tried to find many articles, some say via a web service others say jdbc drivers, etc. I don't know too much about this because we've never done mobile development.

If we were to write up a web service, is the web service simply responsible for connecting to the database layer and fetching records? Any examples would be greatly appreciated.

asked Jul 8, 2014 at 19:00
1

1 Answer 1

5

You need to write and deploy a REST service which your Android app can communicate with. There are a number of ways you can accomplish that: ASP.NET MVC, Web API, WCF, etc. The REST service connects with the SQL Server instance.

The web service is responsible for what you want it to be responsible for. It can contain business logic, transactions, data lookup, whatever.

answered Jul 8, 2014 at 19:09
5
  • Hi Robert, what exactly does that mean, having no experience whatsoever in this type of environment the more details the better. Commented Jul 8, 2014 at 19:11
  • It means that your Android App will communicate over the internet with your web service, and your web service will communicate with the SQL Server locally. You'll have to figure out the details, as explaining how to do it here would fill a book. Have a look at the Web API articles on ASP.NET for a decent primer. Commented Jul 8, 2014 at 19:12
  • Ok I am on the web api link you posted I'll look into it. One issue we have is this application is a private application basically an intranet. Commented Jul 8, 2014 at 19:13
  • You'll probably want to secure your REST API somehow as well, e.g. OAuth or some other token solution. Although it is possible that an Android app could communicate directly to a a SQL Server DB, that would require making the DB publicly accessible to traffic and you'd likely have to hard-code credentials into the app. Both of those are key ingredients to the "get your database hacked" recipe. Commented Nov 17, 2014 at 15:51
  • @JonH hire a web developer if this lingo is foreign. They will know how to communicate with a webservice. A mobile app is different than a website however, so you'll either need an app developer as well or somebody with both skillsets. Commented Nov 18, 2014 at 19:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.