How to connect sql database to android application using wcf? - android

I currently use xmlstring to pass values between android application and sql server. But now i need to make this connection through wcf. so how can i do this one.

If your buliding the service, you might want to consider using Web api instead of wcf as it more simple to configure.
The basics of building an HTTP service using ASP.NET Web API
You can use a library as retrofit to get the data from the server.
Ater you fetch the data, in Json format, you can parse it using Gson

Related

How I can send data using laravel connected Postgresql to received data from android application?

I'm currently working on an android project. And I want to upload some data from android app to (web(using bootstrap)+API)_(Laravel). My lecturor said that now I have to write code API to manage datas but I don't know how to do that. I searched so much but my results that build GET, POST, EDIT, DELETE and build Controller for Laravel project. How should I do? Thanks in advance.
You can use Volley to manage Http requests and responses to the laravel server. And use Gson for managing JSON objects from the android application.
Make a JSON object containing the data you want to send and return the JSON string from the Laravel application.

Store WSDL file in Android Project and Parse this to create Retrofit API

i only have a .wsdl file locally and i only find examples for android to create a soap service with retrofit2 with an url. Now my question is what is best practice to store the .wsdl file in the project (is this a raw file?) and parse this for example with ksoap to create my api with retrofit? Any body some ideas?
The WSDL file is a webservice file, therefore it should seat on your server, you can deploy such webservices using Tomcat or JBoss applications. So you don't want to 'store' the wsdl file in your application, it should seat on your server. And you shouldn't 'parse' a wsdl file, its function is moving data from your client to server and viceversa. If doing what you are suggesting was possible(parsing with ksoap to create my api with retrofit), then it would be a bad programming practise due to redudancy. Retrofit works similarly to soap difference being retrofit makes use of JSON while SOAP makes use of XML. Try looking at my answer here Call a soap webservice in android to understand how android interacts with soap webservice

Android - Retrieve data from server database through web service (JSON v/s Servlet)

I need to retrieve huge amounts of data from a database through a web service from an Android app. I have two different ways to do this, and I wanted some advice on it:
1. The first option is to create a .php file on the server side that managed any POST coming from the client (Android app). The server would then create a JSON response. Finally we would parse this response using a JSON parser in Android. This is also known as the REST scheme.
2. The second option is to create a SERVLET, execute it from the client (Android), have the servlet send the request to the database for us, and finally parse that data from Android. Obviously the servlet would be written so that it could easily interact with the database.
Points to note (so as to decide which option is better):
1. I won't be storing anything in the database from the client. That is, my Android app is read-only.
2. I will be reading from a huge database, so it is a priority here the performance of the Client-Server interaction, with a special mention for data parsing and for servlet vs php performance.
Any help would be greatly appreciated.
Android has built-in support for parsing JSON data with the use of JSONObjects and JSONArrays, so it would be a lot easier to handle data in that form, rather than handling servlets. Its even possible to directly receive the web service response as a JSONObject or JSONArray.
In general, web services in Android should be of the RESTful type. That's how Google seems to prefer it. That's why there's built-in support for JSON, but not for SOA or Servlets.
References:
1. Reasons for not directly write Servlets for creating a REST API.
2. Servlet vs REST.

Is it possible to connect an Android device to a WCF or any other .NET web service?

I want to create an Android app to connect with a server and it's DB. In order to communicate with the server can I use a .NET web service? and what sort of a service should I use?
Webservices is the bridge between the server and your android app.For accessing the DB from the server you have to write the webservices that returns the data in json format or other.
For JSON you have to use JSON Parsing that will parse the data coming from the server and get it on to your app. And for sopa webservices you have to use KSOAP library and parse the data.
FOr JSON Parsing refer this:-http://www.androidhive.info/2012/01/android-json-parsing-tutorial/
For soap webservices:-http://seesharpgears.blogspot.in/2010/11/basic-ksoap-android-tutorial.html
Hope it helps you a lot.

how create a webservice with a database connection?

I want create a android application and i need to connect to a webservice and this web service should have connection to a database.
How is the simple way and free to implement this solution?
How about a PHP server which is (managing a database and) handling HTML POST requests? You could use JSON as communication format. On client side you could even use GSON to hide the JSON handling.

Categories

Resources