Android : How do I simulate a desktop browser request from an Android phone

on Monday, March 23, 2015


I need to download a file from a website. The website has blocked download requests that don't originate from browsers. I had earlier developed a terminal based java program that was able to download this file by adding the following line of code.



URLConnection uc = url.openConnection();

uc.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) \" +\n" +
" \"Gecko/20100316 Firefox/3.6.2");


However, I am unable to download the same file from an Android device. Also, I am unable to manually download the file from my phone's browser. This leads me to believe that maybe requests from mobile browsers are restricted too. So is there any way to mimic a desktop browser's request from an Android device?


Thank you for your help in advance.


0 comments:

Post a Comment