Skip to main content
Samsung Developer Program

Modify the AndroidManifest.xml File

How to change your Android app manifest file to support IAP integration

 

When integrating Samsung IAP functionality, the following privilege and activity additions must be included as annotations in the IAP Helper project within the AndroidManifest.xml file:

  • Privileges:
    • com.samsung.android.iap.permission.BILLING privilege to link to IAP functionality in Samsung Billing.
    • android.permission.INTERNET privilege, because IAP uses network communication.
       
  • Transparent activities:
    • com.samsung.android.sdk.iap.lib.activity.OwnedProductActivityto request the owned items list.
    • com.samsung.android.sdk.iap.lib.activity.ProductActivity to request in-app item details.
    • com.samsung.android.sdk.iap.lib.activity.PaymentActivity to request an in-app item purchase.
    • com.samsung.android.sdk.iap.lib.activity.ConsumePurchasedItemsActivity to request the consumption of an in-app item.
       

To add privileges and activities to the Android app manifest

Caution: Privileges and activities must not be altered. Copy and paste them the comments in the IAP Helper AndroidManifest.xml file in the SDK.

  1. In Android Studio, open the AndroidManifest.xml file.
  2. Add the following privilege code:
<uses-permission android:name="com.samsung.android.iap.permission.BILLING"/>
<uses-permission android:name="android.permission.INTERNET"/>
  1. Add the following activity code: 
    Caution: Due to the transparency requirements, the activities must be set to android:theme="@style/Theme.Empty"or these activities conceal your application.
<activity    
android:name="com.samsung.android.sdk.iap.lib.activity.PaymentActivity"     
android:theme="@style/Theme.Empty"    
android:configChanges="orientation|screenSize"/> 
 
<activity    
android:name="com.samsung.android.sdk.iap.lib.activity.ProductActivity"     
android:theme="@style/Theme.Empty"    
android:configChanges="orientation|screenSize"/> 
 
<activity     
android:name="com.samsung.android.sdk.iap.lib.activity.OwnedProductActivity"     
android:theme="@style/Theme.Empty"    
android:configChanges="orientation|screenSize"/> 
 
<activity     
android:name="com.samsung.android.sdk.iap.lib.activity.ConsumePurchasedItemsActivity"     
android:theme="@style/Theme.Empty"    
android:configChanges="orientation|screenSize"/>