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

调用图片资源

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

相关推荐
沟通QQ19226381 天前
棒板电极流注放电过程探究:氩气形成贯穿流注与等离子体仿真研究
android-studio
四代水门4 天前
简易视频预览器
android·android-studio
我命由我123455 天前
Android 开发问题:布局文件中的文本,在预览时有显示出来,但是,在应用中没有显示出来
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
清空mega23 天前
第二章 Android常见界面布局
android-studio
Nick568324 天前
Apple Pay 与 Google Pay 开发与结算全流程文档
ios·安卓·android-studio
我命由我1234525 天前
Android 开发 - Android JNI 开发关键要点
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
我命由我123451 个月前
Android WebView - loadUrl 方法的长度限制
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
我命由我123451 个月前
Android PDF 操作 - AndroidPdfViewer 弹出框显示 PDF
android·java·java-ee·pdf·android studio·android-studio·android runtime
我命由我123451 个月前
Android PDF 操作 - AndroidPdfViewer 显示 PDF 异常清单(数据为 null、数据为空、PDF 文件损坏、非 PDF 文件)
android·java·java-ee·pdf·android studio·android-studio·android runtime
—Qeyser1 个月前
Flutter网络请求Dio封装实战
网络·flutter·php·xcode·android-studio