如果我想发布一个 minSDK 比市场上更高的更新怎么办? [英] What if I want to release an update with higher minSDK than the one on the market?

查看:20
本文介绍了如果我想发布一个 minSDK 比市场上更高的更新怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用 minSDK<在市场上发布了一款应用/strong> 设置为 4(Android 1.6),但现在我想发布一个 更新,其中包含 1.6 中不可用的功能,因此我需要更高的 minSDK.

I have released an app on the market with minSDK set to 4 (Android 1.6) but now I want to release an update with features unavailable in 1.6 so I need a higher minSDK.

所以,我的问题是:运行 1.6 的用户会收到此更新的通知吗?...如果是,他们是否能够下载/安装它?

So, my question is: Will users running 1.6 be notified of this update?...and if yes will they be able to download/install it?

推荐答案

不,他们不应该收到更新通知.市场将把应用程序全部过滤掉,他们将无法再看到它或接收更新.

No they shouldn't be notified of the update. The market will filter the application out all together and they will no longer be able to see it or receive updates.

如果您想添加使用较高 api 级别但不排除较低 api 级别用户的功能,您可以使用一些反射来启用此功能:

If you want to add features that use a higher api level but not exclude user's of a lower api level you can use some reflection to enable this:

           public static Method getExternalFilesDir;        

            try {
                    Class<?> partypes[] = new Class[1];
        partypes[0] = String.class;
                    getExternalFilesDir = Context.class.getMethod("getExternalFilesDir", partypes);
            } catch (NoSuchMethodException e) {
                    Log.e(TAG, "getExternalFilesDir isn't available in this devices api");
            }

这段代码在说:

在 Context.class 中我有这个方法 getExternalFilesDir (API 级别 9)

Within the Context.class have I got this method getExternalFilesDir (API level 9)

如果是这样,将变量 getExternalFilesDir 实例化为对该方法的反射调用,否则将其保留为 null.

If so instantiate the variable getExternalFilesDir as a reflective call to this method else leave it as null.

然后你可以简单地做

     // If the user's device is API9 or above
     if(getExternalFilesDir != null){
       // Invoke is basically the same as doing Context.getExternalFilesDir(var1, var2);
       getExternalFilesDir.invoke(variable1, variable2);
     } else {
        // User cannot use this method do something else
     }

希望有帮助

这篇关于如果我想发布一个 minSDK 比市场上更高的更新怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆