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

调用图片资源

(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类所输出的日志内容分为六个级别。

相关推荐
联系QQ 180809513 天前
Qt 实现功能丰富的截屏工具
android-studio
壮哥_icon6 天前
Android 使用 PackageInstaller 实现静默安装,并通过 BroadcastReceiver 自动重启应用
android·gitee·android-studio·android系统
我命由我123457 天前
Android 开发 Room 问题:SQL error or missing database (no such table: User)
java·数据库·sql·java-ee·android studio·android-studio·android runtime
我命由我123458 天前
Android 开发问题:在无法直接获取或者通过传递获取 Context 的地方如何获取 Context
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
写代码的健身教练11 天前
androidstudio Layout Inspector没有3D模式
android-studio
沟通QQ192263812 天前
棒板电极流注放电过程探究:氩气形成贯穿流注与等离子体仿真研究
android-studio
四代水门15 天前
简易视频预览器
android·android-studio
我命由我1234516 天前
Android 开发问题:布局文件中的文本,在预览时有显示出来,但是,在应用中没有显示出来
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
清空mega1 个月前
第二章 Android常见界面布局
android-studio
Nick56831 个月前
Apple Pay 与 Google Pay 开发与结算全流程文档
ios·安卓·android-studio