File tree Expand file tree Collapse file tree 5 files changed +12
-10
lines changed
Library/src/main/java/net/sjava/appstore Expand file tree Collapse file tree 5 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1212 * @version 1.0.0
1313 */
1414public 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 ();
Original file line number Diff line number Diff line change 55import android .content .pm .ApplicationInfo ;
66import android .content .pm .PackageManager ;
77
8- import java .util .Iterator ;
98import 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
Original file line number Diff line number Diff line change 1212 * @version 1.0.0
1313 */
1414public 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 ();
Original file line number Diff line number Diff line change 1212 * @version 1.0.0
1313 */
1414public 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 ();
Original file line number Diff line number Diff line change 1212 * @version 1.0.0
1313 */
1414public 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 ();
You can’t perform that action at this time.
0 commit comments