android


How can I interface an Android app with SQL Server?


This is my problem:
I have to make an Android app that recover some data from an existing database situated on a Microsoft SQL Server installation on Windows Server 2003. I don't know so much about server-side programming languages, so I'm searching on the Internet, and I've found that I have to use a Web Service between my app and the ASP Classic page that connect to the database.
I also found that I have to use SOAP to send data to the server with my app, using the ksoap2 library on Android, and I found how to configure it on the client side. But I can't find how to configure the WebService and which format is better for interfacing my app and the ASP Classic page.
It's very easy, actually. All what you need is to create a webservice which will display the results in JSON format. Then you need to run an HTTP request from your Android app in order the get a JSON array containing JSON objects and then you will have your data from your database.
For example: the webservice will have a function written in ASP with a SELECT statement. Before your return the result, you need to encode it in JSON. Check out JSON Encode (MSDN).
The Android app will connect to the web service link and simply retrieve the JSON encoded data. I'll put you in the right way. You just use a snippet like this one to get data from the web service:
AsyncHttpClient client = new AsyncHttpClient();
client.get("http://yourwebservice.aspx", new AsyncHttpResponseHandler() {
#Override
public void onSuccess(String response) {
JSONArray jarr = new JSONArray(response);
for(int i = 0; i < jarr.length(); ++i) {
JSONObject jobj = jarr.getJSONObject(i);
// Do your things...
}
}
});
Create a RESTful web service in Web API or WCF. Web API will communicate with the database and your Android application with communicate with the web service.

Related Links

How to find the hour and text place from Google places api?
Unity Output Android VR APP not working on my new phone but old phone
Create Android project from the command line
COMODO SSL Certificate on apache CentOS
Recyclerview StaggeredGridLayoutManager - Find last visible item
Firebase retrieving data from two tables null error
unable to run standalone android sdk manager
Android ProgressDialog ends too early
Webview get focus automatically when removing URL from Edit Text
Using JobScheduler with FusedLocationApi
Change all Color on Text Controller
Location Updates using JobScheduler API
Floating Action Button show on keypad
navigator.geolocation.getCurrentPosition not working on Android 7.0
Social network integration in Android app, and should i keep user info in table in SQLite?
How to check existed data in firebase?

Categories

HOME
formal-languages
jax-rs
angular-formly
swt
interface
error-handling
pdfbox
soa
cq5
hugo
code-coverage
elasticsearch-5
powershell-v5.0
nim
swagger-2.0
windows-xp
google-maps-autocomplete
microsoft-ocr
breadth-first-search
libigl
href
string-concatenation
imageresizer
short-url
xunit
surveymonkey
appirater
ms-access-web-app
mat
exchangewebservices
finagle
glib
simplecv
dsx-desktop
python-import
browser-extension
batching
roblox
sim-toolkit
openproject
cd
c9.io
visa
tcc
placeholder
show-hide
flask-login
stylecop
httr
reportservice2010
vugen
geotiff
rserve
video-conferencing
ngmaterial
trigger.io
rxtx
structuremap4
cvxpy
change-tracking
grails-plugin
lrs
neon
mapinfo
hclust
dup
expectations
jclouds
kango-framework
realsense
highland.js
linklabel
tfs-workitem
vigenere
extjs-grid
dronekit-android
avahi
diff3
document-repository
beatsmusic
structuremap3
rickshaw
malformedurlexception
gnumeric
radiant
getopt
windows-embedded-standard
windows-phone-8-sdk
dtmf
ebay-lms
poker
facebook-timeline
abstract-data-type
pclzip
wimax
booksleeve
frameworkelementfactory
qtconcurrent
pyunit
paginator
thttpd
urlrewriter
pinch
htdocs
u2netdk
cac
globals
drupal-fivestar
skype4java
xpsdocument

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App