Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question

This question has an open bounty worth +50 reputation from userX ending in 2 days.

This question has not received enough attention.

1 Answer 1

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.

share|improve this answer
    
Hi Robert, what exactly does that mean, having no experience whatsoever in this type of environment the more details the better. –  JonH Jul 8 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. –  Robert Harvey Jul 8 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. –  JonH Jul 8 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. –  Allan Nov 17 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. –  Andrew Hoffman Nov 18 at 19:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.