Androidmanifest. XML (6) uses-SDK-translated from beginning Android games

Source: Internet
Author: User
Tags libgdx android games

The last element to be written to the manifest file is <uses-SDK>. It is a sub-element of <manifest>. When creating the hello World project in Chapter 2, the <uses-SDK> element is used by specifying the minimum version of the android SDK in the new Android project dialog box.

 

But how do we specify it in <manifest>? Here is an example:

 

<Uses-SDK Android: minsdkversion = "3" Android: targetsdkversion = "9"/>

 

As we discussed in chapter 2, each android SDK version corresponds to an integer. <Uses-SDK> specifies the minimum Android SDK version supported by our application, and the version used by our application.

 

The <uses-SDK> element allows you to configure our applications. A lower version of Android SDK is developed, and can be run on the latest Android system (compatible with the above version ). An outstanding example is multi-touch APIs. multi-touch is supported in SDK 5 (Android 2.0) or later versions. When setting the android project in eclipse, we use build target to select the Android version that supports multi-touch. For example, SDK 5 or later (I usually set it to the latest version, when I write this book, it is the SDK
9 ). If we want our game to run on a device installed with SDK 3 (Android 1.5), we can specify the minsdkversion attribute in the manifest file, just like in the previous example. Of course, when developing with a higher version, we must be careful not to use APIs that are unavailable in a lower version. For example, the later version SDK is compatible with devices that have installed a 1.5 system. If the device has installed a later version of the system, we can use the updated APIs.

 

The preceding configuration instructions can be applied to most game development (unless you cannot provide an independentCodeIn this case, you want to set minsdkversion to the minimum SDK version you actually support)

 

Finally, it's over.

I recently saw Chapter 1 OpenGL ES .~ Therefore, the next translation will be related to chapter 7.

The book has a simple android game framework... Although small, I can learn a lot .. I feel like it is the mini version of libgdx (the author of this book is one of the developers of the libgdx framework ~)

I will upload the source code.

 

 

The original text is attached:

The <uses-SDK> element


The last element we'll put in our manifest file is the <uses-SDK> element. It is a child

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 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
wocould 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 ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.