2016-08-12 91 views
0

是否有類似的應用程序商店的解決方案,Android的StoreKit框架

就像iOS提供的StoreKit框架?

*我看到YouTube有時會在彈出窗口中打開Playstore。

回答

0

你可能要檢查In-app Billing

應用內結算是谷歌播放服務,讓您從您的應用程序內銷售的數字內容。您可以使用該服務銷售各種內容,包括可下載內容(如媒體文件或照片),虛擬內容(如遊戲關卡或藥水),優質服務和功能等。


實現應用內結算

應用程式在谷歌Play結算提供了一個簡單的,簡單的界面,發送應用內結算請求以及管理應用內結算交易中使用谷歌播放。以下信息涵蓋了如何使用Version 3 API從應用程序撥打應用程序內結賬服務的基本知識。

要在您的應用程序應用內結算,你需要做到以下幾點:

  1. 的應用內結算庫添加到您的項目。
  2. 更新您的AndroidManifest.xml文件。
  3. 創建一個ServiceConnection並將其綁定到IInAppBillingService
  4. 從應用程序發送應用內結算請求至IInAppBillingService
  5. 處理來自Google Play的應用內結算回覆。

應用程序的清單

<uses-permission android:name="com.android.vending.BILLING" /> 

創建ServiceConnection

IInAppBillingService mService; 

ServiceConnection mServiceConn = new ServiceConnection() { 
@Override 
public void onServiceDisconnected(ComponentName name) { 
mService = null; 
} 

@Override 
public void onServiceConnected(ComponentName name, 
IBinder service) { 
mService = IInAppBillingService.Stub.asInterface(service); 
} 
}; 

有關完整的實施遵循tutorial爲實施API。

希望它有幫助!

+0

嗨,感謝您的評論。它會打開一個免費的應用程序頁面,如:http://i.stack.imgur.com/ow1dt.jpg – Dizzy