How to clear data in android application programatically?

How do I get data from external SQL Database into Android application?

  • I am working on an app that needs to pull some data that is stored on a MS SQL 2008 Server. Basically a front end PC application submits data to this database and I want to share this data through my mobile application. I created a few stored procedures on the server that returns the data that I would like to reference in my app. Please note that I am only recieving data to the app and not trying to modify the database tables in anyway. The data I need to send to the app requires NO CONDITIONS so it is a simple call without passing any parameters to the DB Server. I also created a WCF REST service to handle that has a class that returns basically the data from the stored procs I want to use. Here is my question, what is the best way to retrieve this data from the database and can someone provide me with an example? I believe there are a few different ways to handle this such as; Copying the records into a SQLite DB and then transfering it to the device; Interacting with the REST service through the application; Creating a class that connects directly to the database; I've been trying method #2 but haven't had much luck in getting the application to consume the service. If this is the best way to handle it maybe you can point me to a tutorial on the subject that would be useful as every tutorial I've looked at so far hasn't really helped. I would think there would be some pretty simple methods on handling a datasource from an external database. Thank you and best regards

  • Answer:

    As rest service is already there I would continue same. In my case I have php script as rest service which returns json response. In app I made httpclient call and json parsing with buitin api. No issues so far. Out of 3 methods listed, I think this is simple and best approaches.

Shawn at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.