Skip to content

Commit 8dbced6

Browse files
committed
Inspect & fixs some code
1 parent 137e0a7 commit 8dbced6

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

Library/src/main/java/net/sjava/appstore/AmazonAppStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* @version 1.0.0
1313
*/
1414
public class AmazonAppStore extends AppStore implements PublisherAppOpenable {
15-
static String APPSTORE_URI = "amzn://apps/android?";
16-
static String APP_URL = "http://www.amazon.com/gp/mas/dl/android?";
15+
private static final String APPSTORE_URI = "amzn://apps/android?";
16+
private static final String APP_URL = "http://www.amazon.com/gp/mas/dl/android?";
1717

1818
public static AmazonAppStore newInstance() {
1919
return new AmazonAppStore();

Library/src/main/java/net/sjava/appstore/AppStore.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import android.content.pm.ApplicationInfo;
66
import android.content.pm.PackageManager;
77

8-
import java.util.Iterator;
98
import java.util.List;
109
/**
1110
* AppStore abstract class
@@ -30,9 +29,12 @@ private List<ApplicationInfo> getApplications(Context ctx) {
3029
}
3130

3231
protected boolean isAppInstalled(Context ctx, String packageName) {
33-
Iterator<ApplicationInfo> itr = getApplications(ctx).iterator();
34-
while (itr.hasNext()) {
35-
if (itr.next().packageName.indexOf(packageName) != -1)
32+
List<ApplicationInfo> apps = getApplications(ctx);
33+
if(apps == null || apps.size() == 0)
34+
return false;
35+
36+
for(ApplicationInfo appinfo : apps) {
37+
if(appinfo.packageName.contains(packageName))
3638
return true;
3739
}
3840

Library/src/main/java/net/sjava/appstore/NaverAppStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @version 1.0.0
1313
*/
1414
public class NaverAppStore extends AppStore {
15-
static String APP_URL ="http://nstore.naver.com/appstore/web/detail.nhn?productNo=";
15+
private static final String APP_URL ="http://nstore.naver.com/appstore/web/detail.nhn?productNo=";
1616

1717
public static NaverAppStore newInstance() {
1818
return new NaverAppStore();

Library/src/main/java/net/sjava/appstore/PlayAppStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* @version 1.0.0
1313
*/
1414
public class PlayAppStore extends AppStore implements PublisherAppOpenable {
15-
static String APP_URL = "http://play.google.com/store/apps/deails?id=";
16-
static String APP_SEARCH_URL = "http://play.google.com/store/search?q=";
15+
private static final String APP_URL = "http://play.google.com/store/apps/deails?id=";
16+
private static final String APP_SEARCH_URL = "http://play.google.com/store/search?q=";
1717

1818
public static PlayAppStore newInstance() {
1919
return new PlayAppStore();

Library/src/main/java/net/sjava/appstore/TAppStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @version 1.0.0
1313
*/
1414
public class TAppStore extends AppStore {
15-
private static String APP_URL = "http://m.tstore.co.kr/mobilepoc/apps/appsDetail.omp?prodId=";
15+
private static final String APP_URL = "http://m.tstore.co.kr/mobilepoc/apps/appsDetail.omp?prodId=";
1616

1717
public static TAppStore newInstance() {
1818
return new TAppStore();

0 commit comments

Comments
 (0)