I would like to distribute my app for free, and then sell extra features that can be ad开发者_C百科ded-on later. Is it possible to do this?
If you're talking about in-app payment, you should take a look at PayPal, which offers In-App-Payment for Android:
http://www.x.com
https://www.x.com/community/ppx/sdks
If you want to distribute your app via Android Market, you would need to offer each add-on as an invididual app. Probably not a convenient way.
Yes you can do it. There are addons all over the market for the better keyboard app.
You have different ways you can do this, here are two ways I already tried.
1) You could implement all the features in the app and a key app that unlocks this features. Here is a simple and insecure implementation, the key app and the main app need to be signed with the same key:
public boolean isPackageAvailable(String packageName) {
int sigMatch = getPackageManager().checkSignatures(getPackageName(), packageName);
return sigMatch == PackageManager.SIGNATURE_MATCH;
}
Check MarketEnabler on market-enabler.googlecode.com to see how I used it (not not a secure way but a starting point).
2) You include the plugin app as intent into a subview so it looks like just one app splitted to multiple apk's.
Check http://speakerproximity.googlecode.com where I used it to include the settings view inside the mainview:
....
public class SpeakerProximity extends ActivityGroup {
....
mainLayout.addView(getViewFromIntent("preferences", new Intent(
this, PreferenceScreen.class)));
....
public View getViewFromIntent(String tag, Intent intent) {
/** start an activity inside an ActivityGroup and get the window handler **/
final Window w = getLocalActivityManager().startActivity(tag, intent);
/** extract the view out of the window handler **/
final View wd = w != null ? w.getDecorView() : null;
return wd;
}
...
Note that I extend ActivityGroup and not Activity ;-)
精彩评论