├── .gitignore
├── .idea
├── .name
├── codeStyles
│ └── Project.xml
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── jarRepositories.xml
├── misc.xml
├── modules.xml
├── modules
│ ├── Demo
│ │ └── AppStoreLibrary.Demo.iml
│ └── Library
│ │ └── AppStoreLibrary.Library.iml
└── vcs.xml
├── AppStoreLibrary.iml
├── Demo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── net
│ │ └── sjava
│ │ └── appstore
│ │ └── demo
│ │ └── MainActivity.java
│ └── res
│ ├── layout
│ └── activity_main.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── Library
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── net
│ │ └── sjava
│ │ └── appstore
│ │ ├── AmazonStoreApp.java
│ │ ├── AppStore.java
│ │ ├── OneStoreApp.java
│ │ ├── PlayAppStore.java
│ │ └── PublisherAppOpenable.java
│ └── res
│ └── values
│ └── strings.xml
├── README.md
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
8 | # Built application files
9 | *.apk
10 | *.ap_
11 |
12 | # Files for the Dalvik VM
13 | *.dex
14 |
15 | # Java class files
16 | *.class
17 |
18 | # Generated files
19 | bin/
20 | gen/
21 |
22 | # Gradle files
23 | .gradle/
24 | build/
25 | /*/build/
26 |
27 | # Local configuration file (sdk path, etc)
28 | local.properties
29 |
30 | # Proguard folder generated by Eclipse
31 | proguard/
32 |
33 | # Log Files
34 | *.log
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | AppStoreLibrary
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/modules/Demo/AppStoreLibrary.Demo.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | generateDebugSources
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/.idea/modules/Library/AppStoreLibrary.Library.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | generateDebugSources
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AppStoreLibrary.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Demo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Demo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 31
5 |
6 | defaultConfig {
7 | applicationId "net.sjava.appstore.demo"
8 | minSdkVersion 15
9 | targetSdkVersion 31
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 |
20 | lintOptions {
21 | abortOnError false
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: 'libs', include: ['*.jar'])
27 | implementation project(':Library')
28 | implementation 'androidx.appcompat:appcompat:1.4.1'
29 | }
30 |
--------------------------------------------------------------------------------
/Demo/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:/Program Files/Android/android-sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Demo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Demo/src/main/java/net/sjava/appstore/demo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package net.sjava.appstore.demo;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import androidx.appcompat.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.Toast;
9 |
10 | import net.sjava.appstore.AmazonStoreApp;
11 | import net.sjava.appstore.AppStore;
12 | import net.sjava.appstore.OneStoreApp;
13 | import net.sjava.appstore.PlayAppStore;
14 | import net.sjava.appstore.PublisherAppOpenable;
15 |
16 | public class MainActivity extends AppCompatActivity {
17 | private Context ctx;
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | super.setContentView(R.layout.activity_main);
23 | ctx = this;
24 |
25 | initPlayAppStore();
26 | initAmazonAppStore();
27 | initOneStore();
28 | }
29 |
30 | private AppStore appStore;
31 | private PublisherAppOpenable publisherAppOpener;
32 |
33 | //https://play.google.com/store/apps/details?id=com.google.android.gm
34 | private void initPlayAppStore() {
35 | Button btn01 = findViewById(R.id.play_button_01);
36 | Button btn02 = findViewById(R.id.play_button_02);
37 | Button btn03 = findViewById(R.id.play_button_03);
38 | Button btn04 = findViewById(R.id.play_button_04);
39 |
40 | Button btn05 = findViewById(R.id.play_button_05);
41 | Button btn06 = findViewById(R.id.play_button_06);
42 |
43 | btn01.setOnClickListener(new View.OnClickListener() {
44 | @Override
45 | public void onClick(View v) {
46 | appStore = PlayAppStore.newInstance();
47 | Toast.makeText(ctx, "Play store app is installed: " + appStore.isInstalled(ctx), Toast.LENGTH_SHORT).show();
48 | }
49 | });
50 |
51 | btn02.setOnClickListener(new View.OnClickListener() {
52 | @Override
53 | public void onClick(View v) {
54 | appStore = PlayAppStore.newInstance();
55 | appStore.openApp(ctx, "com.google.android.gm");
56 | }
57 | });
58 |
59 | btn03.setOnClickListener(new View.OnClickListener() {
60 | @Override
61 | public void onClick(View v) {
62 | publisherAppOpener = PlayAppStore.newInstance();
63 | publisherAppOpener.openPublisherApps(ctx, "Google Inc.");
64 | }
65 | });
66 |
67 | btn04.setOnClickListener(new View.OnClickListener() {
68 | @Override
69 | public void onClick(View v) {
70 | appStore = PlayAppStore.newInstance();
71 | appStore.searchApp(ctx, "gmail");
72 | }
73 | });
74 |
75 | btn05.setOnClickListener(new View.OnClickListener() {
76 | @Override
77 | public void onClick(View v) {
78 | appStore = PlayAppStore.newInstance();
79 | ((PlayAppStore) appStore).openDeveloperPage(ctx, "nTools");
80 |
81 | }
82 | });
83 |
84 | btn06.setOnClickListener(new View.OnClickListener() {
85 | @Override
86 | public void onClick(View v) {
87 | appStore = PlayAppStore.newInstance();
88 | //Staff Picks (Featured)
89 | /*
90 | Collection collection_name
91 | Staff Picks (Featured) featured
92 | Top Paid topselling_paid
93 | Top Free topselling_free
94 | Top New Free topselling_new_free
95 | Top New Paid topselling_new_paid
96 | Top Grossing topgrossing
97 | Trending movers_shakers
98 | */
99 | //((PlayAppStore)appStore).openCollectionApps(ctx, "featured");
100 | ((PlayAppStore) appStore).openCollectionApps(ctx, "topgrossing");
101 |
102 | }
103 | });
104 |
105 | }
106 |
107 | private void initAmazonAppStore() {
108 | Button btn01 = findViewById(R.id.amazon_button_01);
109 | Button btn02 = findViewById(R.id.amazon_button_02);
110 | Button btn03 = findViewById(R.id.amazon_button_03);
111 | Button btn04 = findViewById(R.id.amazon_button_04);
112 |
113 | btn01.setOnClickListener(new View.OnClickListener() {
114 | @Override
115 | public void onClick(View v) {
116 | appStore = AmazonStoreApp.newInstance();
117 | Toast.makeText(ctx, "Amazon store app is installed: " + appStore.isInstalled(ctx), Toast.LENGTH_SHORT).show();
118 | }
119 | });
120 |
121 | btn02.setOnClickListener(new View.OnClickListener() {
122 | @Override
123 | public void onClick(View v) {
124 | appStore = AmazonStoreApp.newInstance();
125 | appStore.openApp(ctx, "com.amazon.mp3");
126 | }
127 | });
128 |
129 | btn03.setOnClickListener(new View.OnClickListener() {
130 | @Override
131 | public void onClick(View v) {
132 | publisherAppOpener = AmazonStoreApp.newInstance();
133 | publisherAppOpener.openPublisherApps(ctx, "com.amazon.mp3");
134 | }
135 | });
136 |
137 | btn04.setOnClickListener(new View.OnClickListener() {
138 | @Override
139 | public void onClick(View v) {
140 | appStore = AmazonStoreApp.newInstance();
141 | appStore.searchApp(ctx, "mp3");
142 | }
143 | });
144 | }
145 |
146 | private void initOneStore() {
147 | Button btn01 = findViewById(R.id.tstore_button_01);
148 | Button btn02 = findViewById(R.id.tstore_button_02);
149 | Button btn03 = findViewById(R.id.tstore_button_03);
150 | Button btn04 = findViewById(R.id.tstore_button_04);
151 |
152 | btn01.setOnClickListener(new View.OnClickListener() {
153 | @Override
154 | public void onClick(View v) {
155 | appStore = OneStoreApp.newInstance();
156 | Toast.makeText(ctx, "OneStore app is installed: " + appStore.isInstalled(ctx), Toast.LENGTH_SHORT).show();
157 | }
158 | });
159 |
160 |
161 | btn02.setOnClickListener(new View.OnClickListener() {
162 | @Override
163 | public void onClick(View v) {
164 | appStore = OneStoreApp.newInstance();
165 | appStore.openApp(ctx, "0000035733");
166 | }
167 | });
168 |
169 | btn03.setVisibility(View.INVISIBLE);
170 | /*
171 | btn03.setOnClickListener(new View.OnClickListener() {
172 | @Override
173 | public void onClick(View v) {
174 | publisherAppOpener = PlayAppStore.newInstance();
175 | publisherAppOpener.openPublisherApps(ctx, "Google Inc.");
176 | }
177 | }); */
178 |
179 | btn04.setVisibility(View.INVISIBLE);
180 | /*
181 | btn04.setOnClickListener(new View.OnClickListener() {
182 | @Override
183 | public void onClick(View v) {
184 | appStore = OneStoreApp.newInstance();
185 | appStore.searchApp(ctx, "T map");
186 | }
187 | }); */
188 | }
189 |
190 | }
191 |
--------------------------------------------------------------------------------
/Demo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
17 |
18 |
24 |
25 |
30 |
31 |
39 |
40 |
48 |
49 |
57 |
58 |
66 |
67 |
68 |
69 |
74 |
82 |
83 |
91 |
92 |
93 |
99 |
100 |
105 |
113 |
114 |
122 |
123 |
131 |
132 |
140 |
141 |
142 |
143 |
148 |
153 |
161 |
162 |
170 |
171 |
179 |
180 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
--------------------------------------------------------------------------------
/Demo/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/Demo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcsong/AppStoreLibrary/e1b2bba45f014ac6ffe1ad86379c7ebb5c12509b/Demo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcsong/AppStoreLibrary/e1b2bba45f014ac6ffe1ad86379c7ebb5c12509b/Demo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcsong/AppStoreLibrary/e1b2bba45f014ac6ffe1ad86379c7ebb5c12509b/Demo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcsong/AppStoreLibrary/e1b2bba45f014ac6ffe1ad86379c7ebb5c12509b/Demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/Demo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/Demo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AppStoreLibrary Demo
3 |
4 | Hello world!
5 | Settings
6 |
7 | is App installed
8 |
9 | Open app
10 | Open publisher
11 | search App
12 |
13 | Open developer page
14 | Open collection
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Demo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | //classpath 'com.novoda:bintray-release:0.9.1'
9 | //classpath 'com.novoda:bintray-release:0.9.2'
10 | }
11 | }
12 |
13 | android {
14 | compileSdkVersion 31
15 | defaultConfig {
16 | minSdkVersion 15
17 | targetSdkVersion 31
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | lintOptions {
28 | abortOnError false
29 | }
30 |
31 | allprojects {
32 | tasks.withType(Javadoc).all { enabled = false }
33 | }
34 |
35 | if (JavaVersion.current().isJava8Compatible()) {
36 | allprojects {
37 | tasks.withType(Javadoc) {
38 | options.addStringOption('Xdoclint:none', '-quiet')
39 | }
40 | }
41 | }
42 | }
43 |
44 | dependencies {
45 | implementation fileTree(dir: 'libs', include: ['*.jar'])
46 | }
--------------------------------------------------------------------------------
/Library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:/Program Files/Android/android-sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Library/src/main/java/net/sjava/appstore/AmazonStoreApp.java:
--------------------------------------------------------------------------------
1 | package net.sjava.appstore;
2 |
3 | import android.content.ActivityNotFoundException;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.Uri;
7 |
8 | /**
9 | * Amazon Store class
10 | *
11 | * @author mcsong@gmail.com
12 | * @date Dec 10, 2014 2:04:02 PM
13 | * @version 1.0.0
14 | */
15 | public class AmazonStoreApp extends AppStore implements PublisherAppOpenable {
16 | private static final String APPSTORE_URI = "amzn://apps/android?";
17 | private static final String APP_URL = "https://www.amazon.com/gp/mas/dl/android?";
18 |
19 | public static AmazonStoreApp newInstance() {
20 | return new AmazonStoreApp();
21 | }
22 |
23 | @Override
24 | public boolean isInstalled(Context ctx) {
25 | return isAppInstalled(ctx, PACKAGE_NAME_AMAZON);
26 | }
27 |
28 | @Override
29 | public void openApp(Context ctx, String uniqueId) {
30 | if(isInstalled(ctx)) {
31 | try {
32 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APPSTORE_URI + "p=" + uniqueId));
33 | ctx.startActivity(intent);
34 | return;
35 | } catch (ActivityNotFoundException e) { // ignore
36 | }
37 | }
38 |
39 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_URL + "p=" + uniqueId));
40 | ctx.startActivity(intent);
41 | }
42 |
43 | @Override
44 | public void searchApp(Context ctx, String keyword) {
45 | if(isInstalled(ctx)) {
46 | try {
47 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APPSTORE_URI +"s=" + keyword));
48 | ctx.startActivity(intent);
49 | return;
50 | } catch (ActivityNotFoundException e) { // ignore
51 | }
52 | }
53 |
54 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_URL + "s="+ keyword));
55 | ctx.startActivity(intent);
56 | }
57 |
58 | @Override
59 | public void openPublisherApps(Context ctx, String key) {
60 | if(isInstalled(ctx)) {
61 | try {
62 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APPSTORE_URI + "p=" + key +"&showAll=1"));
63 | ctx.startActivity(intent);
64 | return;
65 | } catch (ActivityNotFoundException e) { // ignore
66 | }
67 | }
68 |
69 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_URL + "p=" + key +"&showAll=1"));
70 | ctx.startActivity(intent);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/Library/src/main/java/net/sjava/appstore/AppStore.java:
--------------------------------------------------------------------------------
1 | package net.sjava.appstore;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.pm.ApplicationInfo;
7 | import android.content.pm.PackageManager;
8 |
9 | import java.util.List;
10 | /**
11 | * AppStore abstract class
12 | *
13 | * @author mcsong@gmail.com
14 | * @date Dec 10, 2014 2:03:53 PM
15 | * @version 1.0.0
16 | */
17 | public abstract class AppStore {
18 | protected static final String PACKAGE_NAME_PLAY = "com.android.vending";
19 | protected static final String PACKAGE_NAME_AMAZON = "com.amazon.venezia";
20 | protected static final String PACKAGE_NAME_TSTORE = "com.skt.skaf.A000Z00040";
21 |
22 | protected Intent intent;
23 |
24 | @SuppressLint("WrongConstant")
25 | private List getApplications(Context ctx) {
26 | return ctx.getPackageManager().getInstalledApplications(
27 | PackageManager.COMPONENT_ENABLED_STATE_DEFAULT);
28 | }
29 |
30 | protected boolean isAppInstalled(Context ctx, String packageName) {
31 | List apps = getApplications(ctx);
32 | if(apps.size() == 0) {
33 | return false;
34 | }
35 |
36 | for(ApplicationInfo appinfo : apps) {
37 | if(appinfo.packageName.contains(packageName)) {
38 | return true;
39 | }
40 | }
41 |
42 | return false;
43 | }
44 |
45 | /**
46 | * Check store app is installed.
47 | *
48 | * @param ctx
49 | * @return
50 | */
51 | public abstract boolean isInstalled(Context ctx);
52 |
53 | /**
54 | * Open app with store app.
55 | *
56 | * @param ctx
57 | * @param uniqueId
58 | */
59 | public abstract void openApp(Context ctx, String uniqueId);
60 |
61 | /**
62 | * Search app with store app.
63 | *
64 | * @param ctx
65 | * @param keyword
66 | */
67 | public abstract void searchApp(Context ctx, String keyword);
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Library/src/main/java/net/sjava/appstore/OneStoreApp.java:
--------------------------------------------------------------------------------
1 | package net.sjava.appstore;
2 |
3 | import android.content.ActivityNotFoundException;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.Uri;
7 |
8 | /**
9 | * T Store class
10 | *
11 | * @author mcsong@gmail.com
12 | * @date Dec 10, 2014 2:04:18 PM
13 | * @version 1.0.0
14 | */
15 | public class OneStoreApp extends AppStore {
16 | private static final String APP_URL = "https://onestore.co.kr/userpoc/apps/view?pid=";
17 |
18 | public static OneStoreApp newInstance() {
19 | return new OneStoreApp();
20 | }
21 |
22 | @Override
23 | public boolean isInstalled(Context ctx) {
24 | return isAppInstalled(ctx, PACKAGE_NAME_TSTORE);
25 | }
26 |
27 | @Override
28 | public void openApp(Context ctx, String uniqueId) {
29 | if(isInstalled(ctx)) {
30 | try {
31 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("tstore://PRODUCT_VIEW/" + uniqueId + "/0"));
32 | ctx.startActivity(intent);
33 | return;
34 | } catch (ActivityNotFoundException e) { // ignore
35 | }
36 | }
37 |
38 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_URL + uniqueId));
39 | ctx.startActivity(intent);
40 | }
41 |
42 | @Override
43 | public void searchApp(Context ctx, String keyword) {
44 | String url = "https://onestore.co.kr/userpoc/search?query="+ keyword;
45 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
46 | ctx.startActivity(intent);
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/Library/src/main/java/net/sjava/appstore/PlayAppStore.java:
--------------------------------------------------------------------------------
1 | package net.sjava.appstore;
2 |
3 | import android.content.ActivityNotFoundException;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.net.Uri;
7 |
8 | /**
9 | * PlayStore class
10 | *
11 | * @author mcsong@gmail.com
12 | * @version 1.0.0
13 | * @date Dec 10, 2014 2:04:13 PM
14 | */
15 | public class PlayAppStore extends AppStore implements PublisherAppOpenable {
16 | private static final String APP_URL = "https://play.google.com/store/apps/details?id=";
17 | private static final String APP_SEARCH_URL = "https://play.google.com/store/search?q=";
18 | private static final String APP_DEVELOPER_PAGE = "https://play.google.com/store/apps/developer?id=";
19 | private static final String APP_COLLECTION_URL = "https://play.google.com/store/apps/collection/";
20 |
21 | public static PlayAppStore newInstance() {
22 | return new PlayAppStore();
23 | }
24 |
25 | @Override
26 | public boolean isInstalled(Context ctx) {
27 | return isAppInstalled(ctx, PACKAGE_NAME_PLAY);
28 | }
29 |
30 | @Override
31 | public void openApp(Context ctx, String uniqueId) {
32 | if (isInstalled(ctx)) {
33 | try {
34 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + uniqueId));
35 | ctx.startActivity(intent);
36 | return;
37 | } catch (ActivityNotFoundException e) { // ignore
38 | }
39 | }
40 |
41 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_URL + uniqueId));
42 | ctx.startActivity(intent);
43 | }
44 |
45 | @Override
46 | public void searchApp(Context ctx, String keyword) {
47 | if (isInstalled(ctx)) {
48 | try {
49 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=" + keyword));
50 | ctx.startActivity(intent);
51 | return;
52 | } catch (ActivityNotFoundException e) { // ignore
53 | }
54 | }
55 |
56 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_SEARCH_URL + keyword));
57 | ctx.startActivity(intent);
58 | }
59 |
60 | @Override
61 | public void openPublisherApps(Context ctx, String key) {
62 | if (isInstalled(ctx)) {
63 | try {
64 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:" + key));
65 | ctx.startActivity(intent);
66 | return;
67 | } catch (ActivityNotFoundException e) {
68 | // ignore
69 | }
70 | }
71 |
72 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_SEARCH_URL + "pub:" + key));
73 | ctx.startActivity(intent);
74 | }
75 |
76 | public void openDeveloperPage(Context ctx, String developerId) {
77 | if (isInstalled(ctx)) {
78 | try {
79 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://dev?id=" + developerId));
80 | ctx.startActivity(intent);
81 | return;
82 | } catch (ActivityNotFoundException e) {
83 | // ignore
84 | }
85 | }
86 |
87 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_DEVELOPER_PAGE + developerId));
88 | ctx.startActivity(intent);
89 | }
90 |
91 | public void openCollectionApps(Context ctx, String collectonName) {
92 | if (isInstalled(ctx)) {
93 | try {
94 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://apps/collection/" + collectonName));
95 | ctx.startActivity(intent);
96 | return;
97 | } catch (ActivityNotFoundException e) {
98 | // ignore
99 | }
100 | }
101 |
102 | intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_COLLECTION_URL + collectonName));
103 | ctx.startActivity(intent);
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/Library/src/main/java/net/sjava/appstore/PublisherAppOpenable.java:
--------------------------------------------------------------------------------
1 | package net.sjava.appstore;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Interface to display publisher's apps
7 | *
8 | * @author mcsong@gmail.com
9 | * @version 1.0.0
10 | * @date Dec 10, 2014 2:04:13 PM
11 | */
12 | public interface PublisherAppOpenable {
13 | /**
14 | * Open publisher's apps
15 | *
16 | * @param ctx
17 | * @param key
18 | */
19 | public void openPublisherApps(Context ctx, String key);
20 | }
21 |
--------------------------------------------------------------------------------
/Library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Library
3 |
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## AppStore Library
2 | [](https://bintray.com/mcsong/maven/appstore) [](https://android-arsenal.com/details/1/1772)
3 |
4 |
5 |
6 |
7 |
8 | ## Overview
9 | This library makes easy to use the AppStore app's features.
10 |
11 | ### Features
12 | - Detect a store app is installed or not.
13 | - Open app via store app.
14 | - Search apps with publisher via store app.
15 | - Search apps within store app.
16 |
17 | ### Supported AppStore apps
18 | - Play Store
19 | - Amazon AppStore
20 | - OneStore
21 |
22 | ## Gradle & Maven
23 | Gradle
24 | ```groovy
25 | dependencies {
26 | implementation 'net.sjava:appstore:1.1.0'
27 | }
28 | ```
29 |
30 | Maven
31 | ```xml
32 |
33 | net.sjava
34 | appstore
35 | 1.1.0
36 |
37 | ```
38 | ## Usage
39 |
40 | ``` java
41 | private void initPlayAppStore() {
42 | Button btn01 = findViewById(R.id.play_button_01);
43 | Button btn02 = findViewById(R.id.play_button_02);
44 | Button btn03 = findViewById(R.id.play_button_03);
45 | Button btn04 = findViewById(R.id.play_button_04);
46 |
47 | btn01.setOnClickListener(new View.OnClickListener() {
48 | @Override
49 | public void onClick(View v) {
50 | appStore = PlayAppStore.newInstance();
51 | Toast.makeText(ctx, "isInstalled : " + appStore.isInstalled(ctx), Toast.LENGTH_SHORT).show();
52 | }
53 | });
54 |
55 | btn02.setOnClickListener(new View.OnClickListener() {
56 | @Override
57 | public void onClick(View v) {
58 | appStore = PlayAppStore.newInstance();
59 | appStore.openApp(ctx, "com.google.android.gm");
60 | }
61 | });
62 |
63 | btn03.setOnClickListener(new View.OnClickListener() {
64 | @Override
65 | public void onClick(View v) {
66 | publisherAppOpener = PlayAppStore.newInstance();
67 | publisherAppOpener.openPublisherApps(ctx, "Google Inc.");
68 | }
69 | });
70 |
71 | btn04.setOnClickListener(new View.OnClickListener() {
72 | @Override
73 | public void onClick(View v) {
74 | appStore = PlayAppStore.newInstance();
75 | appStore.searchApp(ctx, "gmail");
76 | }
77 | });
78 | }
79 | ```
80 |
81 | ## License
82 |
83 | Copyright 2020 MooChan(Justin) Song
84 |
85 | Licensed under the Apache License, Version 2.0 (the "License");
86 | you may not use this file except in compliance with the License.
87 | You may obtain a copy of the License at
88 |
89 | http://www.apache.org/licenses/LICENSE-2.0
90 |
91 | Unless required by applicable law or agreed to in writing, software
92 | distributed under the License is distributed on an "AS IS" BASIS,
93 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
94 | See the License for the specific language governing permissions and
95 | limitations under the License.
96 |
97 |
98 | ### Follow me
99 |
100 | [](https://twitter.com/mcsong)
101 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 |
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:7.1.3'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | jcenter()
20 | google()
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | android.enableJetifier=true
14 | android.useAndroidX=true
15 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
16 |
17 | # When configured, Gradle will run in incubating parallel mode.
18 | # This option should only be used with decoupled projects. More details, visit
19 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
20 | # org.gradle.parallel=true
21 |
22 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcsong/AppStoreLibrary/e1b2bba45f014ac6ffe1ad86379c7ebb5c12509b/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri May 01 17:07:48 PDT 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include 'Library', 'Demo'
2 |
--------------------------------------------------------------------------------