Android development road 05, android road 05
I. How to get the content of values in the res resource file:
1. string. xml file -------------------------------; value options: getResource (). getString (resourceID) or getResource. getText (resourceID );
2. Arrays. xml file -----------------------------------; Value Method: getResource (). getStringArray (resourceID );
3. Colors. xml file -------------------------------------- getResource (). getDarwable (resourceID) or getResource (). getColor (resourceID );
4. Dimens. xml file --------------------------------------- getResource (). getDimension (resourceID );
5. No value is required for Style. xml -----------------------------------------.
2. AndroidManifest. xml file description:
<? Xml version = "1.0" encoding = "UTF-8"?>
<! -- Package = "com. rookie. hello" indicates the main package name of the entire application, and it is a default program name.
Android: versionCode = "1" indicates the apk version generated by the project, and 1 is continuously increasing;
Android: versionName = "1.0" indicates the version name, which starts with 1.0. Other versions can be set as needed.
Android: installLocation = "auto" apk will automatically find the installed directory, ROM or SDcard card
InternalOnly can only be installed on ROM
PreferExternal is directly installed on the sdcard
-->
<Manifest xmlns: android = "http://schemas.android.com/apk/res/android"
Package = "com. rookie. hello"
Android: versionCode = "1"
Android: versionName = "1.0" type = "codeph" text = "/codeph">
<! -- Add user authorization -->
<Uses-permission android: name = "android. permission. ACCESS_NETWORK_STATE"/>
<Uses-sdk
Android: minSdkVersion = "15"
Android: targetSdkVersion = "23"/>
<! -- Android: icon = "@ drawable/ic_launcher" indicates the logo image of our application.
Android: label = "@ string/app_name" indicates the text description of the application project.
-->
<Application
Android: allowBackup = "true"
Android: icon = "@ drawable/ic_launcher"
Android: label = "@ string/app_name"
Android: theme = "@ style/AppTheme">
<! -- Android: name = ". MainActivity" indicates the name of the main program of the entire application.
Intent-filter: intent filter, used to filter user actions and operations
Android. intent. action. MAIN: indicates that the current program is the entrance program of the entire project.
Category android: name: indicates whether the application is displayed in the program list.
-->
<Activity
Android: name = ". MainActivity"
Android: label = "@ string/app_name">
<Intent-filter>
<Action android: name = "android. intent. action. MAIN"/>
<Category android: name = "android. intent. category. LAUNCHER"/>
</Intent-filter>
</Activity>
</Application>
</Manifest>