【问题标题】:How to increase the compatibility of the apk如何增加apk的兼容性
【发布时间】:2018-01-11 04:49:14
【问题描述】:

我正在制作一个应用程序,而我使用 USB 在手机 (API 23) 上安装的 apk 文件在其他设备上不支持(我已共享 apk 并尝试将其安装在 API 25 的设备上)。但是可以使用 USB 在该设备上安装另一个 apk,这在我的手机上再次不支持。所以,我的应用程序的 apk 不兼容。

还有一件事,不同设备中的布局变得不同,有时 2 个图像在一个设备中重叠,而在另一个设备中则完全没问题。 所以我想增加我的应用程序的兼容性。请帮帮我。

我的 manifest.xml 文件:

    ?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ankush.anthroplace.anthroplace">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".SplashActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity android:name=".AboutUsActivity" />
        <activity android:name=".TestimonialActivity" />
        <activity android:name=".LoginActivity" />
        <activity android:name=".RegisterActivity" />
        <activity
            android:name=".ServicesActivity"
            android:label="@string/title_activity_services"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity android:name=".FormActivity"></activity>
    </application>

</manifest>

【问题讨论】:

  • 兼容性?不太明白问题所在。我认为除了 MIN SDK 支持 AFAIK 之外,没有任何类似的兼容性。
  • 分享您的 Manifest xml 文件。

标签: android compatibility


【解决方案1】:

检查您的项目所针对的 API 级别。

如果您使用的是 Android Studio,请查看文件“build.gradle (Module: app)”并更改“minSdkVersion”属性。

您在该属性上设置的数字越小,您的应用就越兼容,但您也应该放弃一些功能。

【讨论】:

    【解决方案2】:

    尝试将最低 sdk API 级别设置为 19。 通过定位最低 apk 级别 19,您的应用将在大约 90% 以上的 Android 设备上运行。

    并使用最新的构建工具编译您的应用

    您可以从 build.gradle 文件更改最低 sdk 版本

       android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "profile.com.demotest"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    

    }

    【讨论】:

      【解决方案3】:

      检查Android Dashboard你会更好地了解选择最低api级别

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多