Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your main game app could look for installed extensions using PackageManager:</p> <pre><code>PackageManager pm = activity.getPackageManager(); try { pm.getPackageInfo(EXT_PACKAGE_NAME, 0); extExists = true } catch(NameNotFoundException e) { log.info("Extension not present."); } </code></pre> <p>On top of that you should also validate the package signature of the extension. Otherwise somebody could just create an app with the extension package name and unlock that feature in your game.</p> <pre><code>PackageInfo pi = pm.getPackageInfo(EXT_PACKAGE_NAME, PackageManager.GET_SIGNATURES); // There will be practically only 1 signature unless you compile the APK with // multiple signatures Signature s = pi.signatures[0]; extExists = s.hashCode() == EXT_HASHCODE; </code></pre> <p><a href="https://stackoverflow.com/questions/16802786/remove-app-icon-from-drawer-not-working-in-android-4-1">This SO question</a> answers how to hide the extension app icon from the drawer.</p> <p>You also need to check regularly if your extensions are still present. Just imagine that someone purchases an extension, runs your game once and unlocks the extension and then asks for a refund for the extension.</p> <p>My 2 cents about following this approach: I guess that quite a few customers will confuse these extensions with your game. Most people do not read app description texts anyway. So you need to make it absolutely clear that they are about to buy an extension.</p> <p>Furthermore you will make it very hard for your customers to keep everything in place. Imagine a customer purchased your main game and 20 extensions. When she switches devices or does a factory reset it will be a PITA to download all of these extensions again. In app purchases make life easier here.</p> <p>Last but not least, you cannot have consumable in-app items. You cannot repeatedly buy the same extension.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload