Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.asolfre:android-market-api:'
}
dependencies {
implementation("com.github.asolfre:android-market-api:")
}
<dependency>
<groupId>com.github.asolfre</groupId>
<artifactId>android-market-api</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.asolfre" % "android-market-api" % ""
:dependencies [[com.github.asolfre/android-market-api ""]]
Automatically exported from code.google.com/p/android-market-api
<h1><a name="An_open-source_API_for_the_Android_Market"></a>An open-source API for the Android Market<a href="#An_open-source_API_for_the_Android_Market" class="section_anchor"></a></h1><p><strong>This is not an official api. I'm not afiliated to google in any way.</strong> </p><p>This library allow you to ask directly google's official android market servers for information, search for apps, ... </p><p>Main target is java but it can be easily adapted to other languages since it's <a href="https://code.google.com/p/protobuf/" rel="nofollow">Google ProtoBuf</a> based. </p><p>There is a Ruby port by jberkel <a href="http://github.com/jberkel/supermarket" rel="nofollow">here</a> and a PHP port by splitfeed <a href="http://code.google.com/p/android-market-api-php/" rel="nofollow">here</a>. These is also a crawler on top of this library by Raunak Gupta <a href="https://code.google.com/p/android-marketplace-crawler/" rel="nofollow">here</a>. </p><p>For any help using this API please use the google group <a href="http://groups.google.com/group/android-market-api" rel="nofollow">HERE</a>, no direct help request please, i won't answer. </p><h2><a name="Requirement"></a>Requirement<a href="#Requirement" class="section_anchor"></a></h2><p>No specific requirement, it use java.net.URL for communication with the google market server, that's all. So it should run without problem on Google App Engine or in an Android app. Include androidmarketapi-X.Y.jar and protobuf-java-X.Y.Z.jar in your classpath and you're good to go. </p><h2><a name="Current_progress"></a>Current progress<a href="#Current_progress" class="section_anchor"></a></h2><ul><li>You can browse market with any carrier or locale you want. </li><li>Search for apps using keywords or package name. </li><li>Retrieve an app info using an app ID. </li><li>Retrieve comments using an app ID. </li><li>Get PNG screenshots and icon </li></ul><h2><a name="Version_History"></a>Version History<a href="#Version_History" class="section_anchor"></a></h2><ul><li>Version 0.6 : Fix corrupted session when exception occur. Change default android id and default sdk version </li><li>Version 0.5 : Fix random 400 errors, fields recentChanges and promotionalVideo added </li><li>Version 0.4 : Better error handling at login, default to android 2.2 (passion:8) </li><li>Version 0.3 : GetImage api added, now searching for android 2.0 apps </li></ul><h2><a name="About_authentication"></a>About authentication<a href="#About_authentication" class="section_anchor"></a></h2><p>A google account is required. You can use the login method with a valid login/password pair or provide an authsub token for service "android". </p><p>See <a href="http://code.google.com/intl/fr/apis/accounts/docs/AuthForInstalledApps.html" rel="nofollow">Auth for installed apps</a> for more info about authsub. You can also get a valid authsub token from an android device using the unofficial google clientlogin api for android (client.jar), see details <a href="/p/android-market-api/wiki/WithAndroid">here</a>. </p><h2><a name="Basic_Command-line_usage"></a>Basic Command-line usage<a href="#Basic_Command-line_usage" class="section_anchor"></a></h2><p>put the 2 jars in a folder and type : java -jar androidmarketapi-X.Y.jar myemail mypassword myquery </p><h2><a name="Basic_Java_Example"></a>Basic Java Example<a href="#Basic_Java_Example" class="section_anchor"></a></h2><pre class="prettyprint">MarketSession session = new MarketSession(); session.login(email,password); session.getContext.setAndroidId(myAndroidId);String query = "maps"; AppsRequest appsRequest = AppsRequest.newBuilder() .setQuery(query) .setStartIndex(0).setEntriesCount(10) .setWithExtendedInfo(true) .build();
session.append(appsRequest, new Callback<AppsResponse>() { @Override public void onResult(ResponseContext context, AppsResponse response) { // Your code here // response.getApp(0).getCreator() ... // see AppsResponse class definition for more infos } }); session.flush();</pre><p>Check out how to : <ul><li><a href="/p/android-market-api/wiki/HowToSearchApps">HowToSearchApps</a> </li><li><a href="/p/android-market-api/wiki/HowToGetAppComments">HowToGetAppComments</a> </li><li><a href="/p/android-market-api/wiki/HowToGetAppScreenshot">HowToGetAppScreenshot</a> </li></ul></p><h2><a name="How_can_i_help_?"></a>How can i help ?<a href="#How_can_i_help_?" class="section_anchor"></a></h2><ul><li>Contributions are welcome ! The project is mainly missing documentation and examples... </li><li>You can buy me a beer using this button : <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YGPKQZT563WZU&lc=US&item_name=Android%20Market%20Api&item_number=androidmarketapi&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted" rel="nofollow"><img src="http://www.paypal.com/en_US/i/btn/x-click-but04.gif" /></a> </li></ul>