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

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/36454.html
跨境电商选品例子:https://www.goluckyvip.com/tag/36455.html
跨境电商选品渠道:https://www.goluckyvip.com/tag/36457.html
跨境电商选品圈:https://www.goluckyvip.com/tag/36458.html
跨境电商选品软件:https://www.goluckyvip.com/tag/36459.html
跨境电商选品软件排行榜:https://www.goluckyvip.com/tag/36460.html
字节跳动辟谣!TikTok收紧美国开店政策为不实信息:https://www.goluckyvip.com/news/188212.html
2024北京庞各庄镇梨花节开幕时间是几号?:https://www.vstour.cn/a/365179.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流