android:versioncode和android:versionname如何让我的sdk兼容

时间:2014-09-06 14:50:48

标签: android version manifest

我只是反编译一个APK,以便我可以看到该应用的工作方式。 我导入了这个项目,但是因为错误,它几乎完全是红色的。 我是否必须在Manifest中更改某些内容?

    <?xml version="1.0" encoding="utf-8"?>
    <manifest android:versionCode="2" android:versionName="1.1"    package="com.jesstech.bluetooth.bledemo"
      xmlns:android="http://schemas.android.com/apk/res/android">
        <uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
        <uses-permission android:name="android.permission.BLUETOOTH" />
        <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
        <application android:theme="@*android:style/Theme.Holo.Light" android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:allowBackup="false">
            <activity android:label="@string/app_name" android:name="com.jesstech.bluetooth.bledemo.DeviceScanActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name="com.jesstech.bluetooth.bledemo.DeviceControlActivity" />
            <service android:name="com.jesstech.bluetooth.bledemo.BluetoothLeService" android:enabled="true" />
        </application>
    </manifest>

1 个答案:

答案 0 :(得分:0)

你的清单应该是这样的

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.jesstech.bluetooth.bledemo"
    android:versionCode="2"
    android:versionName="1.1" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />

<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
        <uses-permission android:name="android.permission.BLUETOOTH" />
        <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
        <application android:theme="@*android:style/Theme.Holo.Light" android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:allowBackup="false">
            <activity android:label="@string/app_name" android:name="com.jesstech.bluetooth.bledemo.DeviceScanActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name="com.jesstech.bluetooth.bledemo.DeviceControlActivity" />
            <service android:name="com.jesstech.bluetooth.bledemo.BluetoothLeService" android:enabled="true" />
        </application>
</manifest>

和sdk

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" /> depends on your SDK version