2013-11-24 81 views
0

我想在我的Android應用程序中創建一個彈出窗口,以向用戶投放市場投票我的應用程序。情況是,爲了做到這一點,我實際上需要'id'遊戲商店將給我的應用程序...但如果我沒有上傳它,我現在怎麼知道我正在開發它?我的Android應用程序評分

有什麼想法?謝謝!

回答

1

利用軟件包名稱,Google Play將根據您的應用的軟件包名稱生成Play商店鏈接。

Intent intent = new Intent(Intent.ACTION_VIEW); 
    //Try Google play 
    intent.setData(Uri.parse("market://details?id=[package]")); 
    if (MyStartActivity(intent) == false) { 
     //Market (Google play) app seems not installed, let's try to open a webbrowser 
     intent.setData(Uri.parse("https://play.google.com/store/apps/details?[package]")); 
     if (MyStartActivity(intent) == false) { 
      //Well if this also fails, we have run out of options, inform the user. 
      Toast.makeText(this, "Could not open Android market, please install the market app.", Toast.LENGTH_SHORT).show(); 
     } 
    } 

來源:Android: How to create a 「Rate this app」 button

+0

感謝您的聯繫! – Frion3L

相關問題