Android development road 05, android road 05

Source: Internet
Author: User

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>

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.