当前位置:网站首页>Training log III of "Shandong University mobile Internet development technology teaching website construction" project
Training log III of "Shandong University mobile Internet development technology teaching website construction" project
2022-07-29 05:49:00 【BEER_ seven】
Time :
21 The sixth week of spring semester
Personal work content :
Complete the compass case app
Export the components and colors of all visual drafts
Record in detail :
- Compass case app Design description
- Target users :android Students at the introductory stage of development .
- Requirement specification : Explain how to use the sensor , Animation use simple teaching
- Design description : Use a pointer disc to indicate the pointer facing north , After acquiring the deviation angle, the sensor rotates the pointer disc and marks the deviation angle , When approaching the north, the font turns red to emphasize the correctness of orientation
Key points
- Compass page

xml file :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center"
android:background="#211E1E">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NORTH"
android:textColor="#FFFFFF"
android:textSize="50sp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/compass3"
android:layout_marginTop="60dp"/>
<TextView
android:id="@+id/degree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0°"
android:textColor="#FFFFFF"
android:textSize="50sp"
android:layout_marginTop="60dp"/>
</LinearLayout>
- When approaching the north , The angle indicator will turn red , In the method of sensor monitoring direction change, the degree can be judged

SensorListener Inner class :
// adopt getSystemService get SensorManager Instance object
manager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
private final class SensorListener implements SensorEventListener {
private float predegree = 0;
// The sensor monitors a change in direction
public void onSensorChanged(SensorEvent event) {
float degree = event.values[0];// Stored the direction value 90
Animation , Write in the method of monitoring the direction change of the upper sensor :
RotateAnimation animation = new RotateAnimation(predegree, -degree,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
// The duration of the rotation process
animation.setDuration(200);
// Compass pictures use rotation animation
imageView.startAnimation(animation);
predegree = -degree;
Later work planning :
- Complete the case of shaking the alarm clock next week App Development and teaching design
边栏推荐
- JDBC连接数据库详细步骤
- What is sqlmap and how to use it
- 农村品牌建设给年轻人的一些机会
- Sqlmap是什么以及使用方法
- 性能对比|FASS iSCSI vs NVMe/TCP
- Novice introduction: download from PHP environment to thinkphp6 framework by hand
- 完全去中心化的编程模式,不需要服务器,也不需要ip,就像一张漫无目的的网络、四处延伸
- July 28 ens/usd Value Forecast: ENS attracts huge profits
- Mobile terminal -flex item attribute
- Reporting Service 2016 自定义身份验证
猜你喜欢

量化开发必掌握的30个知识点【什么是分笔逐笔数据】?

“山东大学移动互联网开发技术教学网站建设”项目实训日志二

Record the SQL injection vulnerability of XX company

如何在加密市场熊市中生存?

Detailed steps of JDBC connection to database

超简单集成HMS ML Kit 人脸检测实现可爱贴纸

量化开发必掌握的30个知识点【什么是Level-2数据】

Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round

What is sqlmap and how to use it

完全去中心化的编程模式,不需要服务器,也不需要ip,就像一张漫无目的的网络、四处延伸
随机推荐
量化开发必掌握的30个知识点【什么是分笔逐笔数据】?
Relationship between redrawing and reflow
nmap是什么以及使用教程
“山东大学移动互联网开发技术教学网站建设”项目实训日志三
Laravel service container (inheritance and events)
熊市下PLATO如何通过Elephant Swap,获得溢价收益?
Seay source code audit system
C# 连接 SharepointOnline WebService
Elastic box flex
DAY4:MySQL 数据库的建立及简单实用
Differences between href and SRC
DAY5:PHP 简单语法与使用
Similarities and differences between REM and PX and EM
DeFi 2.0的LaaS协议,重振DeFi赛道发展的关键
浅谈分布式全闪存储自动化测试平台设计
极致通缩和永动机模型,将推动 PlatoFarm 爆发
Refresh, swagger UI theme changes
QFrame类学习笔记
The difference between link and @import importing external styles
DAY13:文件上传漏洞