星空网 > 软件开发 > 操作系统

android开发之路05

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

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

 

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

 

3.Colors.文件--------------------------------------》取值方式getResource().getDarwable(resourceID)或者getResource().getColor(resourceID);

 

4.Dimens.文件---------------------------------------》getResource().getDimension(resourceID);

 

5.Style.》不需要取值

 

二.AndroidManifest.清单文件说明:

<?

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

    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>




原标题:android开发之路05

关键词:Android

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

法国空派:https://www.goluckyvip.com/tag/31168.html
法国空派专线:https://www.goluckyvip.com/tag/31169.html
外贸营:https://www.goluckyvip.com/tag/3117.html
法国空运fba:https://www.goluckyvip.com/tag/31170.html
法国空运到中国:https://www.goluckyvip.com/tag/31171.html
法国空运港口有哪些:https://www.goluckyvip.com/tag/31172.html
16个独特的商业创意,带你收获真正赚钱的创业理念:https://www.kjdsnews.com/a/1840836.html
2017天台景区收门票吗 2017天台景区收门票吗多少钱:https://www.vstour.cn/a/404226.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流