乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      AndroidManifest.xml 詳解 (六) 之uses

       gideshi 2013-01-03

         我們要寫入manifest文件的最后一個(gè)元素就是<uses-sdk>。它是<manifest>的子元素。在第二章創(chuàng)建Hello World項(xiàng)目的時(shí)候,在New Android Project對話框中,通過指定Android SDK 的最小版本,我們已經(jīng)使用了<uses-sdk>元素。

       

         但是我們怎么在<manifest>中指定它呢?這有個(gè)例子:

       

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

       

         和我們在第二章中討論的一樣,每一個(gè)Android SDK 版本號都對應(yīng)一個(gè)整形數(shù)字。<uses-sdk>指定了我們應(yīng)用所支持的最低Android SDK版本號,和我們應(yīng)用所使用的版本號。

       

          <uses-sdk> 元素允許配置我們的應(yīng)用,一個(gè)低版本的android sdk開發(fā),而能夠在最新的android系統(tǒng)上運(yùn)行(向上兼容)。一個(gè)突出的例子就是多點(diǎn)觸控APIs,多點(diǎn)觸控在SDK 5(Android 2.0)或以上版本才能夠被支持。當(dāng)我們在Eclipse中設(shè)置Android 項(xiàng)目的時(shí)候,我們使用build target來選擇支持多點(diǎn)觸控的Android 版本——舉個(gè)例子,SDK 5或更高(我通常設(shè)置成最新的版本,在我寫這本書的時(shí)候是SDK 9)。如果我們想讓我們的游戲在安裝有SDK 3(Android 1.5)的系統(tǒng)的設(shè)備上運(yùn)行,我們就可以和剛才的例子一樣,在manifest文件中指定minSdkVersion屬性。當(dāng)然,使用高版本開發(fā)時(shí),我們必須小心別去使用那些在低版本中不可用的API,比如說高版本SDK兼容安裝了1.5系統(tǒng)的設(shè)備。如果設(shè)備安裝了高版本的系統(tǒng),那么我們就可以很好的使用更新的APIs了。

       

          前面的配置說明已經(jīng)可以適用于大多數(shù)的游戲開發(fā)(除非你不能為一個(gè)更高版本的APIs提供獨(dú)立的代碼路徑,而在這種情況下你會(huì)希望設(shè)置minSdkVersion為你實(shí)際支持的最低的SDK版本)

       

      終于完結(jié)了。

      最近看到第7章 OpenGL ES的內(nèi)容。~所以接下來翻譯會(huì)和第七章有關(guān)。

      書中有一個(gè)最簡單的Android游戲框架。。。雖然小但是能學(xué)到很多東西..感覺是libgdx的迷你版本(此書作者是libgdx框架的開發(fā)者之一~)

      我會(huì)把源碼上傳。

       

       

      最后附上原文:

      The <uses-sdk> Element


      The last element we’ll put in our manifest file is the <uses-sdk> element. It is a child of
      the <manifest> element. We implicitly defined this element when we created our Hello
      World project in Chapter 2 when we specified the minimum SDK version in the New
      Android Project dialog. So what does this element do? Here’s an example:


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


      As we discussed in Chapter 2, each Android version has an integer assigned, also
      known as an SDK version. The <uses-sdk> element specifies what minimum version our
      application supports and what the target version of our application is. 


      This element allows us to deploy an application that uses APIs that are only available in
      newer versions to devices that have a lower version installed. One prominent example
      would be the multitouch APIs, which are supported from SDK version 5 (Android 2.0)
      onward. When we set up our Android project in Eclipse, we use a build target that
      supports that API—for example, SDK version 5 or higher (I usually set it to the latest
      SDK version, which is 9 at the time of writing). If we want our game to run on devices
      with SDK version 3 (Android 1.5) as well, we specify the minSdkVersion as before in the
      manifest file. Of course we must be careful not to use any APIs that are not available on
      the lower version, at least on a 1.5 device. On a device with a higher version, we can use
      the newer APIs as well.


      The preceding configuration is usually fine for most games (unless you can’t provide a
      separate fallback code path for the higher-version APIs, in which case you will want to
      set the minSdkVersion attribute to the minimum SDK version you actually support).

        本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多