Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services

Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services - Hello friends Android tutorial and tips trik, The article you are reading this time with the title Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services, we have prepared this article for you to read and download the information therein. hopefully fill posts article -, article and, article android, article Async, article from, article Google, article HINDI, article JSON, article Parsing, article Services, article Task, article Tutorial, article url, article Volley, article Web, we can write this you understand. Well, happy reading.

Title : Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services
link : Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services

Baca juga


Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services

Hello friend's this is easy techi and in this video I am going to teach you how you can parse json file from URL This is an essential part of web services for Android apps I am going to show you two methods for the purpose First without using library and second using a library Without using library will have its own pros and cons which I will tell you in this video But I should tell you that it would be great if you subscribe to this channel because Tutorials for Basic Android app development, SQL were already added to this channel In future I will be adding video tutorials for "Android Material Design" apart from "Web Services" So do subscribe to this channel.

I am trying to help people learn these important concepts.

Coming back to the topic, What is a JSON file? What does JSON stand for? JSON is primarily used in web services for database manipulation and retrieval.

JSON stands for Javascript Object Notation.

Its mostly used to serialize and transmit data over network.

If you want to display data from database, you can either directly get data from database with PHP and MySQL or use Web Services.

The first method is not recommended because its rather less secure and not platform independent.

However, you can achieve platform independence and better security using Web Services.

Be it IOS, Android or Windows all applications can synchronize and work with Web Services.

Thus, JSON parsing is available in all platforms.

If you want to learn more about Web Services, do watch my other tutorial videos on this channel.

Lets now understand JSON data format.

It consists of a JSON Object name and this is its value next to it.

Here "fuel" is object and its value is "diesel".

A JSON Object can store an array of data too.

Basically using SQL and PHP/JSP you try to get JSON formatted data.

If you do not understand what SQL is and want to learn about SQL commands, please watch my previous video on this channel.

In any platform, we parse the JSON formatted data to display We need to apply GET or POST paramters to get the JSON format data using web services.

First method is HTTPClient method in which we use Async Task I will also explain what AsyncTask is in this video.

AsyncTask is not just used for web services but also finds use in various other types of applications.

For example if a particular page takes more time than usual you can use AsyncTask to load it in background while displaying Progress bar.

After its loaded you can remove progress bar.

Lets study what methods does a typical AsyncTask has.

We extend AsyncTask class to use its methods.

We have three methods in AsyncTask essentially.

First is onPreExecute() then we have onPostExecute() and finally doInBackground().

onPreExecute basically has the tasks to do before the background task begins.

Example start progress dialog.

Then comes doInBackground() where tasks which need to be completed in background are executed.

Tasks like getting Json data and parsing it takes place here.

Once the backgroud tasks are complete, then onPostExecute() carries out its task.

We close the progress bar here.

If you want more details regarding this, you can go to my blog and study this.

There is lot of content in my blog which can help you in Job Interviews too.

Let me tell you the problem with HTTPClient method.

These methods such as DefaultHTTPClient and HTTPClient are deprecated already in Android API level 23.

If you use this method, you will find HTTPClient cannot be resolved error.

This method doesn't work in Marshmallow.

Second method however, which uses library doesn't use asyncTask and does JSON parsing by itself.

The simpler solution is the library named "Google Volley" Google volley also caches the data which helps in faster loading.

First of all Google Volley's jar file needs to be dowloaded and included in libs folder of project.

To find the link to download it is avalailable in the description.

This is my URL with all the GET parameters which if you open will show JSON formatted data.

You can use any programming language and any framework to get JSON from database.

Its not necessary that you need to use JSON formatted data for using Google Volley.

You can also have plain text and parse the string to get substring of importance.

However, I will recommend using JSON format because it is more professional.

GET parameters are given in the URL as you may be able to see.

I am using PHP here to get the JSON fromatted data from database with those GET parameters.

I have written the code in PHP such that no new users data will be added.

I first have "status" object whose value tells me whether the entry was a success or not.

Msg is another object which has a parameter msg again with value "Error adding user".

Let me tell you how I fetch this data.

You can change the GET parameters in the string using concatenation.

I have textView here which needs to be changed.

This request is added to Volley request queue.

Please like, subscribe and share.

;).



Thus Article Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services

That article Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services This time, hopefully we can give you all of the benefits. Well, I'll see you in another article post.

You now read the article Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services the link address http://svedda79.blogspot.com/2016/05/parsing-json-from-url-android-hindi.html

0 Response to "Parsing JSON from URL Android HINDI - Google Volley and Async Task Tutorial Web Services"

Post a Comment