Webservice for android ppt

14

Transcript of Webservice for android ppt

Page 1: Webservice for android ppt
Page 2: Webservice for android ppt

Web Service

• Web service used for data transferring between two language or two platform

• In other words web service is known as script code

• Firstly we create database

• For performing operation on database we use php code

• By using query we can operate database

Page 3: Webservice for android ppt

Web Service

• Query fired inside php(webservice) code so we can say that this web service code is responsible for :

1. Insert data into database

2. Delete data from database

3. Fetch data from database

4. Update data into database

Page 4: Webservice for android ppt

Web Service

• For establish connection between database and php code we use connection file

• Code of connection file is also written in php

Code of connection file:

Page 5: Webservice for android ppt

Connection file

Here

Localhost:127.0.0.1

Root: user_name of vertrigo(local server)

Vertrigo: password of vertrigo

• Connection file save with extension of php

• This connection file include inside the webservice(php) code in which query fired

Page 6: Webservice for android ppt

STEP FOR CREATE WEB SERVICE CODE

1. Call connection file for establish connection2. Create array because multiple value

insert/delete/fetch/update into database3. Check value(isset variable used for checking

value)4. Initialize Get method5. Decode field6. Fire query7. Check data operate(according to query)or not8. Lastly encode

Page 7: Webservice for android ppt

DATABASE

• Firstly create database than create table

Page 8: Webservice for android ppt

CODE FOR INSET DATA INTO DATABASE

Page 9: Webservice for android ppt

CODE FOR delete DATA from DATABASE

Page 10: Webservice for android ppt

CODE FOR update DATA INTO DATABASE

Page 11: Webservice for android ppt

CODE FOR fetch DATA from DATABASE

Page 12: Webservice for android ppt

URL FOR CHECK OPERATION

• URL for insertion of data:

(127.0.0.1/web/insert.php?u_name=santosh&

u_fname=mr.surender)

Here:

web- folder name

Insert.php-file name

• Entry of first field with “?” and entry of all other with “&”

Page 13: Webservice for android ppt

URL FOR CHECK OPERATION

• URL for deletion of data:

(127.0.0.1/web/delete.php?id=2)

Here:

Delete u_id=2 raw from table

• URL for updation of data:

(127.0.0.1/web/update.php?id=2&u_name=santu&u_fname=mr.surender)

Page 14: Webservice for android ppt

URL FOR CHECK OPERATION

• URL for fetch data from database

(127.0.0.1/web/fetch.php)

Thanku…..