The way I see it, I can have the minSdkVersion=4 and targetSdkVersion=10 but set the build target to API Level 4. What will happen? Eclipse assumes I'm developing for API Level 4 and any method, constant or whatever defined on API Levels above 4 will not be available to me. If I try to use them, the application will not compile.
ビルドターゲットをAPIレベル4に設定すると、EclipseはAPIレベル4を厳密に使用するため、それより高いメソッドをコンパイルできなくなります。ただし、ビルドターゲットをより高いAPIレベルに設定すると、 APIレベル10、APKはAPIレベル4から10までの電話で使用できます。
2番目の質問の回答は、Androidビルドターゲットであるあなたの質問に答え、アプリケーションを使用できるユーザーの範囲に影響minSdkVersion
を与えます。targetSdkVersion
編集:
定義するつもりはtargetSdkVersion
なく、APIレベル4を超える機能も使用しないため、はとtargetSdkVersion
同じになりますminSdkVersion
。選択したビルドターゲットが自動的に指定されます。APIレベル4未満でない限り、どのビルドターゲットを選択するかは実際には重要ではありません。
のAndroidドキュメントからtargetSdkVersion
:
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion.
This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).