• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to download captcha and displayed to user?

vimal2015

Lurker
I am developing an application which query the website(http://enquiry.indianrail.gov.in/ntes/ ) and retrieve the data and display in my application. while querying this website, the website popup captcha image and ask to verify before continuation.So I am following below startegy to hadle this scenario:

1. send access request to the ntes server(for the first time)
2. server returns java script to generate captcha(we have corresponding key and value generated by the server in this script).at this stage we can make url associated with our intended captcha image.

3. form an url based on this key and value to retrieve captcha image from server.

4.server send captcha image associated with the key and value

5.save that image locally and display it to customised way to the user(with fancy border,nice looks dialog box etc.)

I have written following code to achieve this goal but unable to download captcha image.I spend several hours try to solve this issue but failed.I am desperately looking for solution and your effort will be highly solicited.

P.S.
at the stage 3,I am able to retrieve url associated with the intended captcha...and ,for my testing If I copy this url and paste over any browser e.g. chrome/mozilla I can see the image over.the equivalent code:

byte[] b= byteImage(new BufferedInputStream(httpurlconnection1.getInputStream()));

return null however.(wonder why???)
 

Attachments

Back
Top Bottom