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

调用图片资源

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

相关推荐
还是鼠鼠14 小时前
Android移动应用开发入门示例:Activity跳转界面
android·前端·gitee·android studio·android-studio
西瓜本瓜@20 小时前
在Android中如何使用Protobuf上传协议
android·java·开发语言·git·学习·android-studio
我命由我123452 天前
Android Cordova 开发 - Cordova 快速入门(Cordova 环境配置、Cordova 第一个应用程序)
android·开发语言·前端框架·android studio·h5·安卓·android-studio
西瓜本瓜@4 天前
在 Android 中实现通话录音
android·java·开发语言·学习·github·android-studio
VX_CXsjNo121 天前
免费送源码:Java+SSM+Android Studio 基于Android Studio游戏搜索app的设计与实现 计算机毕业设计原创定制
java·spring boot·spring·游戏·eclipse·android studio·android-studio
Android 小码峰啊21 天前
Android Dagger 2 框架的注解模块深入剖析 (一)
android·adb·android studio·android-studio·androidx·android runtime
派小汤21 天前
The emulator process for AVD xxx has terminated
安卓·android-studio
qq_370773091 个月前
androidstudio安装完成后创建新的示例项目编译报错解决
android-studio
xiangzhihong81 个月前
Google 决定终止开源 Android项目
人工智能·android-studio