0

I am looking to develop an app that will take login details from the user, go to a website, login, return values on the web page and then display them to the user on the phone.

Does java have this functionallity? Will I need to use javascript instead maybe? do these answers depend on the website that I am trying to access?

In my head I figure that I could just read in the paramaters as strings or chars, parse the webpage for the appropriate form and "paste" the appropriate value into the form "box". However, I have never attempted anything like this with coding so I am completely new to the idea and dont really know where to start. I tried googling around but any information that I found was either irrelevant or conflicting.

I'm not looking for the code to do it because I will not really learn anythig from that but a finger in the right direction would be great. I really do want to try get better at programming so that's why I've started to give myself these little side projects

Any help that can be offered would be great

Ian
  • 1,490
  • 6
  • 24
  • 39

2 Answers2

1

You would need a script which accesses the webpage and enters the data, but in my opinion this is illegal. Because you are accessing a secured area and are able to look into sensitive data. Also accessing the page via a script is "botting" - most pages have safety precautions to prevent the execution of scripts, because most of them are harmful. In my opinion there is no legal and easy solution to this.

SamiSalami
  • 667
  • 2
  • 10
  • 22
  • Well what I am trying to do is definitely not illegal, I want to write the app to access my bank details. There are apps from other banks in my country that do this for their customers but just not one for my bank, If I get it working I was going to try even sell them the app (A guy in my college actually did this for his bank, he approched them with a proof of concept and they gave him cash for the rights). I do agree that it COULD be used illegally, but I am only looking to make the app able to check one account at a time. Basically I want to be able to check my bank balance with an app. – Ian Jul 15 '11 at 09:54
  • but thank's for your concern either way and thanks for expressing it in a polite and non judgmental or accusive way :) – Ian Jul 15 '11 at 09:57
  • Well Yes, but these apps work differently, they are not accessing the data via the websiote, these are aiming at the database. That means if you get access to the database behind the website you can check and get the data directly. But this only works if you get access from the owners. – SamiSalami Jul 15 '11 at 12:01
1

Ian, You can try using http-client (http://hc.apache.org/httpclient-3.x/) lib from apache. It lets to pro grammatically access a website (from a Java code). You will need to do the following things

  1. Use the http-client lib to POST the data to the web site.
  2. Receive the html response.
  3. Use some html parser or xpath to retrieve the values from the response html.
Santosh
  • 17,667
  • 4
  • 54
  • 79
  • check this for documentation http://developer.android.com/reference/org/apache/http/client/HttpClient.html – Santosh Jul 15 '11 at 13:44
  • Thank you! I will give this a go and post back here to say how it goes – Ian Jul 15 '11 at 14:42