I would choose two solutions for applications. One "real" application that contains all the functionality. The second "key" , which only checks the license.
The first application checks if the key application is installed . If the check is positive, then display the full content, enable all functions. If the key application is missing, the application behaves like a free version.
It is also very important to check whether the private key that signed both applications is the same. Without this check, someone can create their own application. . , : http://www.yoki.org/2010/07/31/creating-a-freepaid-app-pair-for-the-android-market/
protected boolean isProInstalled(Context context) {
String proPackage = "org.yoki.android.pkgname";
final PackageManager pm = context.getPackageManager();
List<PackageInfo> list =
pm.getInstalledPackages(PackageManager.GET_DISABLED_COMPONENTS);
Iterator<PackageInfo> i = list.iterator();
while(i.hasNext()) {
PackageInfo p = i.next();
if((p.packageName.equals(proPackage)) &&
(pm.checkSignatures(context.getPackageName(), p.packageName) == PackageManager.SIGNATURE_MATCH))
return true;
}
return false;
}
:
- . . . key1 a1, a2, a3 2 b1, b2
- - . , , . , .