2

I am new to the .NET Framework. I am using Visual Studio 2008 in which I need to create a simple SQL database with say 2 columns "name" and "address" . After that I need to create a web service (REST or SOAP) that will expose my database . Also I need to develop an Android application using which I can insert ,delete , update and view the contents of my database at any point of time via the webservice using respective buttons . As I would be developing it on my machine itself , I would use localhost and not any remote server.

can anyone suggest me how should i go about doing this?

2
  • To an android device, your PC is a remote server . Commented Jul 23, 2011 at 16:04
  • Ok agreed so then would I have to provide the ip address of my pc as a String in my Android code to connect to my pc/remote server ? Commented Jul 23, 2011 at 16:13

1 Answer 1

2

Your task is not actually simple and you might need to do some learning here. The question is very broad and this is why the answer is a bit abstract.

As I see it you may need

Database
Create a database with a table that satisfies your task. You can use ORM frameworks for simplicity (if you know how to use them) or can write it manually in SQL.

Service
It's better to use WCF REST here as you need it to work with Android. Data shall be returned in XML, JSON or ATOM. Design an interface with the specified action (CRUD). You will be able to test it in your browser or via traffic sniffer (like Fiddler). Your service will need some infrastructure plumbing code to access db.

See this blog, msdn article or just google.

Android
You need to learn how to consume REST service from Android (which, I assume, will use Java). Once the service is consumed, you just wire the remote method calls to the button clicks, and assign the return values to the Android GUI.

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

4 Comments

database : well I am aware of how to create a SQL database using Visual Studio 2008 ..so that seems manageable service : Here's where I am having doubts..how do I create a REST web service in .net ? android : consuming the web service is also manageable as I have gone through many tutorials on the net .. I just need to learn how to expose my SQL database via that REST web service...Thanks a lot for the reply !! :-)
@Parth_90, well good luck with the project, I tried to pull the highly abstract view, hope it make sense. I am sure if you don't know how to implement one part, you will find multiple tutorials on the topic (well, I don't know how to do the Android bit, but I am sure it is easy to google).
@Parth_90 I have added a few links that might be helpful. Basically start with a simple console project (or better unit tests if you will) and get your db plumbing working - CreateReadUpdateDelete. Once that done, wire it to the WCF REST
Hey it's not that I didn't get ur highly abstract view , it has just made me think a bit more on my project in terms of it's feasibility. yes I do feel the thing's complex but as they say "where there is a will there is a way " :-)

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.