concept AndroidManifest.xml file in category nativescript

appears as: AndroidMifest.xml files, The AndroidMifest.xml file, AndroidMifest.xml file
NativeScript in Action MEAP V14

This is an excerpt from Manning's book NativeScript in Action MEAP V14.

The last files in the App_Resources/Android folder are the app.gradle and AndroidManifest.xml files. The app.gradle file is used to define custom build settings for an Android app, which is used by the NativeScript CLI to create transform your app’s source code into a complied Android app. We won’t be going into detail about the app.gradle file, but if you want to learn more, go to https://developer.android.com/studio/build/build-variants.html. The AndroidManifest.xml file is like a configuration file for the Pet Scrapbook app, and is the most significant of the files in the Android folder. We’ll be using this file extensively to make modifications to the Pet Scrapbook.

Let’s take a closer look at the AndroidManifest.xml file.

The AndroidManifest.xml file is an Android system file that provides essential information about your app to the Android runtime such as app version, supported screen configurations, app icon, and more.

The AndroidManifest.xml file is where we will configure the app icons for the Pet Scrapbook app. This file must exist in the root of the App_Resources/Android folder, as shown in figure 12.3.

Figure 12.3 The location of the AndroidManifest.xml file within the Pet Scrapbook project (and all NativeScript projects).

We’d like the Pet Scrapbook to run on as many devices as possible, which means that it needs to support multiple screen sizes. Let’s revisit the AndroidManifest.xml file and check out the supports-screens element (listing 12.3).

Listing 12.3 The AndroidManifest.xml file showing the default screen sizes that the Pet Scrapbook supports

The supports-screens element in the AndroidManifest.xml file is used by the Android runtime to specify the screen size compatibility for apps. Once again, you’ll find that the NativeScript CLI made your job easy because it created default screen sizes for you: small (as described by android:smallScreens), normal (android:normalScreens), large (android:largeScreens), and extra-large (android:xlargeScreens).

sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest