开发者

Authenticating user by parsing the JSON returned by the WebService

i have a login page and wanted to get authenticated using web server and after anthenticated user will be able to see h开发者_运维百科ome page how to do this in android using json parser please guide me...

Thanks in advance


Communications between a webserver and a mobile device are mostly stateless.

You send your login credentials to the webserver, It validates you and if you're an authenticated user, it sends you a token/pin. you use this pin for every further communication.

This is how most of the RESTful services work.

Later, you request server for particular information, it returns JSON, you parse that JSON and display the parsed data.

Use JSONObject for parsing JSON Data. its nice.


You need to send the username and password using get or post methods to the webserver using the url.

At the server, you need to validate the username and password by retrieving the details from the database and return the validation status..

No JSON parsing is required for the user validation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜