android开发之路05

.获取res资源文件下values中内容的方式:

1.string.xml文件-------------------------------》 取值方式:getResource().getString(resourceID)或者getResource.getText(resourceID)

 

2.Arrays.xml文件-----------------------------------》取值方式:getResource().getStringArrayresourceID);

 

3.Colors.xml文件--------------------------------------》取值方式getResource().getDarwableresourceID)或者getResource().getColorresourceID);

 

4.Dimens.xml文件---------------------------------------getResource().getDimensionresourceID);

 

5.Style.xml-----------------------------------------------》不需要取值

 

二.AndroidManifest.xml清单文件说明:

<?xml version="1.0" encoding="utf-8"?>

<!--package="com.rookie.hello"表示整个应用程序的主要包名,而且是一个默认的程序名称

android:versionCode="1"表示该工程生成的apk的版本号,1开始不断的递增;

android:versionName="1.0"表示版本的名称,1.0开始,其他版本名称自由设置

android:installLocation="auto"apk会自动寻找安装的目录,ROM或者SDcard卡

internalOnly 仅仅只能安装在ROM上

preferExternal 会直接安装到sdcard卡上

 

  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.rookie.hello"

    android:versionCode="1"

    android:versionName="1.0" >

    <!--添加用户的授权  -->

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    <uses-sdk

        android:minSdkVersion="15"

        android:targetSdkVersion="23" />

<!--android:icon="@drawable/ic_launcher"表示我们应用程序logo图片

android:label="@string/app_name"表示应用工程的文字说明

  -->

    <application

        android:allowBackup="true"

        android:icon="@drawable/ic_launcher"

        android:label="@string/app_name"

        android:theme="@style/AppTheme" >

        <!--android:name=".MainActivity"表示整个应用程序的主程序的名称

        intent-filter:意图过滤器,用来过滤用户的动作和操作

        android.intent.action.MAIN:表示当前程序是整个工程的入口程序

        category android:name:表示决定应用程序是否在程序列表中显示

           -->

        <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>

posted @ 2016-03-05 13:04  smallkure  阅读(250)  评论(0编辑  收藏  举报