简体   繁体   English

android:minSdkVersion =“ 4”导致奇怪的问题

[英]android:minSdkVersion=“4” causing strange problems

I built my applications without specifying a minimum sdk in the beginning. 我在开始时没有指定最小sdk的情况下构建了我的应用程序。 However after I added that line to publish to market I found my applications are behaving very differently for example buttons are smaller, etc... In particular I'm having problems with an application that records sound which was working fine when no minimum sdk was specified, but crashes when I specify one. 但是,当我将该行添加到市场上后,我发现我的应用程序的行为有很大不同,例如按钮更小等。。。特别是我遇到了一个应用程序的问题,该应用程序在没有最小sdk的情况下可以正常录制声音指定,但是当我指定一个时崩溃。 I've tried specifying the minsdk to that of my phone which is 7, but that doesn't seem to help. 我尝试将minsdk指定为我的手机的minsdk(即7),但这似乎无济于事。 What's the default minimum sdk when none is specified? 如果未指定,默认的最小sdk是多少? I just want my application to run like it does normally. 我只希望我的应用程序像通常一样运行。

If you don't specify a minimum or target SDK version you get a lot of compatibility mode behavior. 如果未指定最低或目标SDK版本,则会出现很多兼容模式行为。 The device you're running on is probably a HDPI device and you were probably looking at a UI scaled for compatibility mode before you added the minSdkVersion, hence the smaller buttons - your app is now running at the device's native resolution. 您正在运行的设备可能是HDPI设备,并且在添加minSdkVersion之前,您可能正在查看针对兼容模式缩放的UI,因此按钮较小-您的应用程序现在以设备的本机分辨率运行。

Apps that target SDK 3 and below acquire several permissions by default that must be explicitly requested by apps targeting newer SDK versions. 默认情况下,面向SDK 3及以下版本的应用会获取多个权限,而针对较新SDK版本的应用必须明确请求这些权限。 Check your exception message when your app crashes, it might be a security exception for a permission that you need to explicitly request in your manifest. 当您的应用崩溃时,请检查您的异常消息,这可能是您需要在清单中显式请求的权限的安全性异常。

See the following link for more info: http://developer.android.com/guide/practices/screens_support.html 有关更多信息,请参见以下链接: http : //developer.android.com/guide/practices/screens_support.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM