移动应用开发技术 第一章(用于期末考试复习)

调用图片资源

(1)java

调用mipmap中

getResources().getDrawable(R.mipmap.ic_launcher);

调用以drawable 开头的文件夹

getResources().getDrawable(R.drawable.icon);

(2)xml

@mipmap/ic_launcher

@drawable/icon

<style></style>:定义主题的标签

<item></item>:设置主题样式的标签

设置主题

(1)androidmanifest.xml

android:theme ="@style/AppTheme"

(2)java

setTheme(R.style.apptheme);

<style></style>:定义样式的标签

<item></item>:设置控件样式的标签

xml中引用样式

style="@style/textviewstyle"

布局资源

(1)java

//在Activity的onCreate()方法中调用activity_main.xml布局文件

setcontentview(R.layout.activity_main);

(2)xml

<include layout="@layout/activity_main/">

字符串

<string></string>:定义字符串的标签

<resources>

<string name="app_name">字符串</string>

</resources>

(1)java

getResources().getString(R.string.app.name);

(2)xml

@string/app_name

颜色

<color></color>:定义颜色的标签

<resources>

<color name="colorPrimary">#3F51B5</color>

</resources>

(1)java

getResources().getColor(R.color.colorPrimary);

(2)xml

@color/colorPrimary

尺寸

<dimen></dimen>:定义尺寸的标签

<resources>

<dimen name="activity_horizontal_margin">16dp</dimen>

</resources>

(1)java

getReources().getDimension(R.dimen.activity_horizontal_margin);

(2)xml

@dimen/activity_horizontal_margin

单元测试是指在Android程序开发过程中对最小的功能模块进行测试,单元测试包括Android单元测试和Junit单元测试。

LogCat是Android中的命令行工具,用于获取程序从启动到关闭的日志信息。

Log类所输出的日志内容分为六个级别。

相关推荐
陈大头铃儿响叮当7 天前
Mac环境 aab包转apks,并安装apks
android-studio
小菜翔13 天前
如何在 Android 应用中设置 `android:authorities`
android-studio
Jinyi50313 天前
Android studio安卓期末大作业,智学英语App
java·服务器·笔记·android studio·安卓·课程设计·android-studio
microhex19 天前
聊聊对Andorid的FileProvider的理解
linux·服务器·android-studio
李斯维20 天前
制作自己的 @OnClick、@OnLongClick(告别 setOnClickListener,使用注解、反射和动态代理)
android·java·移动开发·android-studio
广煜永不挂科24 天前
在win11系统上安装启动Hyper-V
android-studio
秋叶先生_1 个月前
【最新鸿蒙应用开发】——使用axios完成手机号注册业务
开发语言·typescript·harmonyos·鸿蒙·android-studio
悟V-SpHeNIC1 个月前
Android 安卓通过bindService ServiceConnection 没有响应的问题
android·安卓·binder·android-studio
FlyJapan_viba1 个月前
Handler --- Message code analyze
经验分享·笔记·android-studio