App Reading From SQL Server Web Service - android

I am in the process of creating an Android application which I want to use to execute a web service on my SQL server which in turn runs a stored procedure.
Having never completed a project like this before, I would like to know what the best way to go about this is?
I.e.
Displaying the SQL results
Reading from the web service
Adding password protection
I've developed apps before, but never SQL - related.
From doing some research I noted the need for a web service and created one, it's the process of running my app to read from it which I would like guidance with. Even a link to a helpful tutorial would be great. Thanks.
EDIT
To be more specific on the display.
Currently the stored procedure is displayed through crystal reports, however I have no need for 'drill - downs' or any functionality other than to actually view.
Something similar without the functionality would be fine.

I would recommend KSOAP with a SOAP webservice for proof of concept/tech demo http://seesharpgears.blogspot.com/2010/11/basic-ksoap-android-tutorial.html
or use the built-in JSON parser with a restful/json webservice
How to call a json webservice through android

Perhaps this link can help you, it has a useful video on the subject and detailed information.
Another link Comsuming WCF Services With Android
And also maybe this could help: Android Web Service MyWeather

Related

How to connect android to python web services and MySQL database

I'm new to Android and to web services in general.
This is what i gotta do: My company has a back end website(for the client to monitor the sales) that's used to manage/monitor sales on some stores and it connects to a MySQL db to store data about sales and users(usernames and passwords).
What I want to do is to get data from that database and to add (sync operations) new rows, all of this from my android app.
I googled this many times and it came up with some similar projects but using another languages.
I would like to see some code samples if possible and some how-to theory, what theory should I follow when developing this, how and what ways of communicating between android and python web services and from the web services to the MySQL database.
Thank you in advance.
You will need a working API, that allows you to communicate to the web service from the android application. I would read into how to write an API and how to build a RESTful service using JSON as a way of communicating between server and android app. There are alternatives to JSON, but JSON is better suited for Android than perhaps AJAX and soap is being used less and less. (Can ajax call be done in Android? It can but has limitations)
(I could only post two full hyper links as i don't have enough reputation yet to do so, you may have to remove the spaces)
API:
http://sharismlab.com/blog/2012/07/21/how-to-write-an-api-for-your-web-app/
REST:
www .restapitutorial. com/lessons/whatisrest.html/
JSON:
htt p:// www.r evillweb.co m/article s/why-use-j son/
You may want to check out restjee. It allows you to define and implement RESTful data access APIs without having to write any server side code. Works with just about any database.

Creating Web Service for Android Application

I've been reading some info about Web Services for Android using SOAP or REST but I've never created a web service so I have many questions about this.
I'm developing an Android App where the users answer some questions and for each user an XML file is generated and saved in the device.
Here are my queries:
What I would like to do is to send these XML files from the devices to the Web Service and also sometimes to retrieve all the files to any
device.
Do I need to convert these files into Byte or just send the XML?
Are these actions possible with the Web Service or will you use Java Sockets? In case you prefer the Web Service, what would you use:
REST, SOAP.
I would appreciate some links to tutorials and piece of advise.
Use SQL Server to manage the data on your desktop and create a web-service in .NET on Visual Studio.
Then connect to the web-service in your application and set/get data from the DB, using web-services. You can use either XML or JSON to transfer your data between the phone and the server.
There is no need for the use of Java Socket API for this.
Links which might be useful :
How to make a web-service in .NET (does not include the implementation in Android) : http://srikanthtechnologies.com/blog/dotnet/wsdaljava.aspx
How to connect your service with Android :
http://seesharpgears.blogspot.in/2010/11/basic-ksoap-android-tutorial.html
http://www.codeproject.com/Articles/304302/Calling-Asp-Net-Webservice-ASMX-From-an-Android-Ap
http://adrianandroid.blogspot.in/2012/05/access-c-net-web-service-in.html
Note: I have never worked on RESTful services. My work has always been on SOAP and hence it remains my preference.
Your final choice of how, exactly, to architect your app, is going to be based on all sorts of things that you haven't included in your questions: your experience, the experience of the other developers in the project, so on and so on.
I will say this, however. REST is deep in the heart of Android. If you decide to go with REST and, possibly, JSON instead of XML (there is, almost certainly, no reason to use byte arrays), you will find that Android's architecture supports you. SOAP and such and you are on your own.

Consuming a .net web service returning a dataset in an ANDROID application

We have an EPOD application running on the windows mobile platform. We are now trying to port the same application to the ANDROID platform. The application uses a web service written in .net to communicate with the server and perform various functions. The web service returns a dataset, which we are unable to parse directly in the ANDROID application and view the details. We are trying KSOAP and the JSON ways. If anyone out there has done this before, please help us out. We have be trying to find a solution for a week without any success. If required, we can even modify the web service so that it returns an XML or a JSON object which we can then parse in the ANDORID application.
Any help / sample code will be much appreciated.
Thanks and Regards
Rajendran Menon
.Net services used in interoperable environments (= non .Net clients) should not use datasets. You have already find why. The best you can do is modifying the service to expose simple soap or json = use custom data objets as return values from you service operations.
.net service returning a dataset will be received as an xml document at client end, so without thinking too much about the integration, just grab some code which can call xml webservice and get data from it.
Since there are many ways to solve this, here are additional links that can help:
How to call a .NET web service from android?
http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/
http://www.slideshare.net/sullis/connecting-to-web-services-on-android
Let me know if I can help you. I have prior experience with calling .net web services from java.

Is an Android Service a good idea when backing up an app's data using a web service?

I'd like to add the ability for my android app to save changes to data (stored in its SQLite database) to a web server. The upload will be via HTTP POST, using JSON in the body of the request to describe the changes.
I'm wondering if I should use an android Service for this. I'd like the user to be able to continue interacting with the app while it's generating the JSON, making the call to the server, and waiting for the server to complete its work and return a response.
Thanks much!
Even better would be an IntentService
Edit: Now that the compatibility package is out I think the new Loader class may be the best option, possibly using the ASyncTask version or a variation of it.
Yes it is a very good idea to move all the webservice code into a service. The Google IO talk Developing Android REST client applications talks about many reasons why this is a good idea. It also covers other important considerations which relate to your problem which is effectively syncing your database to the cloud.

Accessing a .NET web service via Android using JSON

I am a seasoned ASP.NET developer but a novice Android developer who is just getting started.
The first page in my new app is a login page. I would like to pass a username and password to my web service authentication method from my android app. I would like to employ JSON since, from what I've read, would be the most simple and clean method of transmitting data to a mobile device.
I've been searching around and trying to find sample code or syntax that would show me how to accomplish this but it's been difficult.
Here is a nice example exactly how to do it: http://www.geekmind.net/2009/11/android-simple-httpclient-to.html
It is an easy solution and it works.
Here is the thing you need to know
http://android.programmerguru.com/android-json-web-service-tutorial/
and try this also
http://android.programmerguru.com/how-to-call-asp-net-web-service-in-android/
Hope this will help you :)

Categories

Resources