简体   繁体   中英

[Android]How to extract in-app screenshots of available apps from Google PlayStore App pages?

I want to create an Android App that can download all available images of in-game screenshots posted on Angry Birds or any app's Google Play Store page. How can I go about it?

I have tried using this API ( https://code.google.com/p/android-market-api/ ), but I was hoping for better alternatives(the creator of the API had warned that with each new release of Google's SDK, the API may not work properly).

If there is no API readily available, then maybe some broad guidelines?

Do I use a Java based web page crawler and adapt it to Android code or an API like JavaHTMLEditor? In this example ( http://www.compiletimeerror.com/2013/08/java-downloadextract-all-images-from.html#.VFPe3_nF8WI ) the program uses JavaHTMLEditor to pull all images from an HTML webpage, but I'm not sure it will work in Google Play store app pages.

Any kind of advice would be greatly appreciated!!

I'd go with quite straight forward solution.

1) load the actual google play game webpage with normal http request in your application code

Good examples: (StringRequest should do the trick):

http://developer.android.com/training/volley/requestqueue.html https://developer.android.com/training/volley/simple.html

2) create a simple analysis logic that knows what to look for in the response html structure

For example in your case, the image links you are looking for are currently wrapped like this:

(I took this code from a sample game google play html source and modified a bit)

<div class="expand-page" style="width: 100%; opacity: 0;">
  <div class="screenshot-container" style="display: inline-block;"> 
    <div class="screenshot-align"> 
       <div class="screenshot-align-inner"> 
          <img class="full-screenshot clickable" alt="Alt" 
               data-expand-fit-screen="true" data-expand-scroll="true" 
               data-expand-target="full-screenshot-0" data-expand-to="full-screenshot-1" 
               src="https://this.is.the.interesting/url.part"> 
       </div> 
    </div> 
  </div>
</div>

You are interested in finding all of the class="full-screenshot clickable" img tags and their src values. You can go about this for example with regular expression style or indexOf/substring combination to find what you want in the String response.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM