2016-11-23 50 views
0

我是Android編程的初學者,我不知道是否需要通過在Android SDK 2.2或7.1(最新版本)上編碼來創建我的第一個應用程序。爲了說清楚,我將創建一個應用程序在任何類型的智能手機上運行。 謝謝。哪個Android SDK選擇編譯

+0

代碼到最新版本,並使用Android:targetSdkVersion =「19」(如果需要)在清單中,而無需「兼容行爲」運行。 19你變成你想要的東西。另請參閱minSdkVersion和maxSdkVersion。 –

+0

我像你說的那樣使用了targetSdkVersion 19,但是當我嘗試創建項目時出現了很多錯誤,在這裏你可以看到其中的一個: [2016-11-24 00:49:05 - AndroidTest] C:\ Users \ torai_000 \ workspace \ AndroidTest \ res \ values \ styles.xml:7:錯誤:檢索項的父項時出錯:找不到與給定名稱'Theme.AppCompat.Light'匹配的資源。 – Torai

+0

您需要爲.../android-sdk/extras/android/support/v7/appcompat創建v7/appcompat項目並鏈接項目和庫(基於資源的庫)。 http://stackoverflow.com/questions/21059612/no-resource-found-that-matches-the-given-name-style-theme-appcompat-light –

回答

0

Picking your compileSdkVersion, minSdkVersion, and targetSdkVersion blog post

Therefore it is strongly recommended that you always compile with the latest SDK

因此,你應該與Android 7.1編譯

minSdkVersion is the lower bound for your app

一般來說,圖書館使用將有一個的minSdkVersion - 您的應用程序將無法支持任何低比起那個來說。谷歌播放服務,例如,目前有9個(although it is increasing to 14 soon)一個的minSdkVersion

targetSdkVersion is the main way Android provides forward compatibility by not applying behavior changes unless the targetSdkVersion is updated

和你targetSdkVersion最好設置爲你測試你的應用程序在Android上的最高水平。

你會注意到文章的結論是:

Ideally, the relationship would look more like this in the steady state:

minSdkVersion (lowest possible) <= targetSdkVersion == compileSdkVersion (latest SDK)