I created a web site of travel with symfony2, I want to create mobile application using web services created in the web site, I get the data using jsonarry and jsonobject ,how I can insert data using my mobile application.
if there is good library.
thanks.
You can use Retrofit library, see below,
https://square.github.io/retrofit/
https://developer.android.com/reference/java/net/HttpURLConnection.html
you need to use httpurlconnection . you need not use libray for further use but if you want to deserialize and serialize json use GSON .
You can establish connection with web API's using okhttp and can parse json data using Gson library just add compile 'com.google.code.gson:gson:2.2.4' in your build.gradle and parse necessary using MVC method
Check this tutorial https://kylewbanks.com/blog/Tutorial-Android-Parsing-JSON-with-GSON
Related
The website is already hosting on the server. I am trying to access data which is in PhpMyAdmin, into my android application.
you need to use any of networking libraries in android like Volley , retrofit , okHttp ... etc and learn how to decode JSON format then use this decode by any of networking libraries ,
you can use this library https://square.github.io/retrofit/
or use this library https://developer.android.com/training/volley
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.
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
I need to get some simple data (actual currency values) to my android application. I'm not sure what is the best way to achieve it. Do I have to make some database and put it on server and than update it manually or there is some better way?
You can use an API Service and access to this service from you android device. You donot need to do a server implementation for this.
e.g. for exchange rates check https://openexchangerates.org/
Yes.
Please make a server and a PHP which going to print out the values in JSON. You can validate your json with http://jsonlint.com/. After it you can download and parse the json with yourself or a 3rd part library (like retrofit).
You can use this website to generate POJO, so retrofit can parse the json for you by it`s own.
http://www.jsonschema2pojo.org/
select: JSON instead of scheme and select GSON instead of JSON, if you are using retrofit.
sources:
https://en.wikipedia.org/wiki/Gson
https://github.com/square/retrofit
http://blog.robinchutaux.com/blog/a-smart-way-to-use-retrofit/
What would be best and simplest way to call Yahoo weather webservice/any json webservice in android?
Some people suggest not to use Ksoap for mobile application instead use Restful or Json webservice.
TIA
Bhaskar
In short, use HttpClient, HttpGet, and JSONObject
Without any more details, this is probably similar to what you are attempting: http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/
Here's another post where this is discussed:
How to call a SOAP web service on Android
If you really want to be simple, just embed the content of the message in a HttpClient (included with Android by default) and manually parse the result.
Here (http://breaking-catch22.com/?p=127) is a link to an example of calling a REST web service.
Have a look at how Google APIs Client Library for Java does it, for example in this YouTube sample using HttpTransport and JSON:
http://code.google.com/p/google-api-java-client/source/browse?repo=samples#hg%2Fyoutube-jsonc-sample%2Fsrc%2Fcom%2Fgoogle%2Fapi%2Fclient%2Fsample%2Fyoutube