-2

I want to ask, I have a website(HTML and javascript) that allows user to login, maintain thier account. Now I want to create an android application that allows user to login and then pulls thier account details from the website and display on the android app. I have no idea where to start? After user logged in how to pull that user's account details from website? Any suggestion where to start and what to look for???

Can I simply load the url of website for login? Would the website work fine on android?

2 Answers2

0

You should try with WebView which allows you to embed HTML page in your Android application.

Check this out: Building Web Apps in WebView

hsz
  • 148,279
  • 62
  • 259
  • 315
  • thanks a lot for the reply! Actually I was thinking of doing that but as every user has got their own account details, like user id, name, etc, how to pull separate information for each user using WebView? – user1219484 Jul 24 '12 at 11:40
0

The best approach is to create a webservice to return a JSON or XML string with the information you need.

www.example.com/userDetails.php?userID=23&encryptedPassword=ACD23423FFFF23

If you need more security you can create a mechanism that generates expirable hashes that can be used for a specified period of time.

www.example.com/userDetails.php?userID=23&expirableHash=FFFF234234234DDCCCEEEE22
Vame
  • 2,033
  • 2
  • 18
  • 29
  • Thanks a lot for the reply! This sounds good, Now I will have to look how to create webservice to return a JSON or XML string, can you suggest me any tutorial or resource for that? Will be really great full! – user1219484 Jul 24 '12 at 11:42
  • or is it a good practise if I simply load URL of website for login as WebView? Would the website work fine on android? – user1219484 Jul 24 '12 at 11:54
  • it will show fine in the webview, if your website is optimized for mobile. As for the webservice approach you can begin with that. http://davidwalsh.name/web-service-php-mysql-xml-json . Please mark the reply as answer if it answers your question. Thanks – Vame Jul 24 '12 at 12:11
  • Hey, If I use WebView, Can I store user's credentials's on the android application so that user does not has to enter login details each time? – user1219484 Jul 24 '12 at 13:07
  • This should do the trick: http://stackoverflow.com/questions/7961568/fill-fields-in-webview-automatically – Vame Jul 24 '12 at 13:20