tags:

views:

175

answers:

1

Hey guys,

I am new to android programming and i am trying to make an app that will interface with a website i have. It is a movie website with all of its information stored in SQL database. I know how to write the requests and queries in .asp but dont know how to get information from the database in my app. I want the user to be able to enter a movie title, and through a couple of stored procedures that are in my SQL database, return the info on that movie(actor, budget, genre....). I would like to have little info stored on the device, have all of the queries being sent to my SQL server and just have the info being returned.

So my question boils down to, how do i link my existing SQL database with an android app.

Any help would be great.

Thanks Basketball4567

A: 

You would have to expose an interface for your existing database that an application on the device could access.. Now how you do that is up to you, there are a ton of possibilities. The main thing to keep in mind is that you are not likely going to do any direct database connections to a public database through the device and expect to query natively. You can alternatively look on http://groups.google.com/group/android-developers for JDBC or the like if you really would like to remotely connect to the db directly, although this is generally not recommended and most of what you will find is more hacked together works than full solutions.

Quintin Robinson
So what method would you recommend doing, i have seen a couple but nothing really stood out, or could you link me to a website which you found helpful.Thanks
If you are already familiar with querying through ASP then I would go that route and just create and expose some sort of service to your application. I don't have any particular links on the matter, it's a fairly major portion of "cloud" design. I would just recommend looking along the lines of designing a webservice to get you started. That way you could consume through HTTP and if you are beginning that is probably one of the more simple approaches.
Quintin Robinson
Like i said before, im really new to this stuff. Im a college student so im still learning this stuff. could you explain your paragraph about a little more. Im sorry, but its still a little over my head.Thanks
Yes I can but I'll need some time to properly articulate my thoughts.
Quintin Robinson
Thats fine, if you wouldnt mind, i would like to post the asp code i would like to use to contact my sql server
thats how i did it in asp on my website and was wondering how i would do that on android
I realize that I won't be able write an answer in a comment and the details will probably go outside the scope of the question because this breaks down into some fundamentals rather then just raw code. What I would recommend is searching something to the effect of "Exposing a database through a webservice" of course on the counter you would have to be able to consume so you might also want to search for "Consuming a webservice with android". Basically this will likely go well beyond classic asp without a complete custom solution and I don't know of any existing boilerplate you can use.
Quintin Robinson