Is there any way to connect to a SQL Server from an Android application and execute/query SQL statements using Web Service?
Thanks.
Is there any way to connect to a SQL Server from an Android application and execute/query SQL statements using Web Service?
Thanks.
You will simply have to access the server via a web connection. I would strongly suggest you write server-side scripts for sql statements. Then you can access the information those serverside scripts provide with a HttpClient. Sample code below.
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(new URI("www.example.com"));
HttpResponse response = client.execute(request);
BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
Make sure you do all networking in a Async Task.
Also you will need modify your manifest file for Internet permission
<uses-permission android:name="android.permission.INTERNET" />