Android——基本控件(下)(十四)

news2024/10/1 5:27:29

1. 滚动视图:ScrollView

1.1 知识点

(1)掌握滚动视图的主要作用;

(2)可以使用滚视图进行布局;

1.2 具体内容

范例:

<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
	<LinearLayout 
	    android:layout_width="match_parent"
    	android:layout_height="match_parent"
	    >
	    <!-- 存放若干组件 -->
	</LinearLayout>
</ScrollView>

 其实滚动视图中,只能保存一个组件。所以在开发的时候,一般在滚动视图中放置一个布局管理器,而这个布局管理器中又可以放置多个组件。

范例:继续在上面一个范例中添加组件。

package com.example.scrollviewproject;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.LinearLayout;
public class ScrollViewActivity extends Activity {
	private LinearLayout mylayout = null;
	private String data[] = { "爱科技有限公司", "www.aikeji.com", "毛栗子",
			"甘肃省软件适用人才重点培训基地", "兰州市软件及服务外包人才重点实训基地", "服务外包人才实训及交流平台",
			"服务外包人才公共服务平台", "爱科技有限公司", "www.aikeji.com", "毛栗子",
			"甘肃省软件适用人才重点培训基地", "兰州市软件及服务外包人才重点实训基地", "服务外包人才实训及交流平台",
			"服务外包人才公共服务平台" };

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_scroll_view);
		this.mylayout = (LinearLayout) super.findViewById(R.id.mylayout);// 获取组件
		LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.WRAP_CONTENT);//准备布局参数
		for (int i = 0; i < data.length; i++) {
			Button but = new Button(this);
			but.setText(data[i]);
			this.mylayout.addView(but,params);//向布局中添加组件
		}
	}
}

 对于滚动视图来说,并没有太多复杂的操作。

1.3 小结

(1)ScrollView提供一个显示的容器,可以包含一个布局并进行滚动;

(2)在ScrollView中只能包含一个组件,而这个组件可以是布局,布局中添加其他多个组件。

2. 列表显示:ListView

2.1 知识点

(1)掌握ListView组件的基本使用;

(2)可以使用SimpleAdapter对显示数据进行封装;

(3)了解ListActivity类的作用;

(4)掌握ListView组件的事件处理操作。

2.2 具体内容

为了更好的说明ListView的基本使用,首先通过一段程序完成ListView的基本操作,在讲解本程序之前,我们直接将上一章节的数组直接拿过来使用。我们肯定需要做一些简单的设置,将数组的内容在ListView中进行显示。

 

对于这些方法,最关键的还是在ListView数据的设置上,使用setAdapter()这个方法,完成ListView 的数据设置,而此方法的参数是一个ListAdapter接口的对象,既然有接口的话,那么必须就会有实现类,而这个接口的实现类又比较多。我们现在使用ArrayAdapter这个实现类完成对ListAdapter接口的实例化,我们还是需要观察ArrayAdapter类的构造方法:

public ArrayAdapter(Context context,int textViewResourceId,T[] objects)

发现此构造方法有三个参数:

       ·Context context:android上下文对象

       ·textViewResourceId:要是用的布局管理器

       ·T [] objects :表示要操作的数组

现在要使用到布局管理器,我们必须要单独的定义一个布局文件,或者使用android中已经为开发者提供的若干的布局。

 

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ListView
        android:id="@+id/mylist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</LinearLayout>

package com.example.listviewproject;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ListViewActivity extends Activity {
	private String data[] = { "爱科技有限公司", "www.aikeji.com", "毛栗子",
			"甘肃省软件适用人才重点培训基地", "兰州市软件及服务外包人才重点实训基地", "服务外包人才实训及交流平台",
			"服务外包人才公共服务平台", "爱科技有限公司", "www.aikeji.com", "毛栗子",
			"甘肃省软件适用人才重点培训基地", "兰州市软件及服务外包人才重点实训基地", "服务外包人才实训及交流平台",
			"服务外包人才公共服务平台" };
	private ListView listView = null;
	private ArrayAdapter adp = null;//准备的数据
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_list_view);
		this.listView = (ListView) super.findViewById(R.id.mylist);
		this.adp = new ArrayAdapter(this,android.R.layout.simple_expandable_list_item_1,data);
		this.listView.setAdapter(this.adp);//设置ListView要显示的数据
	}
}

此程序是我们将内容设置到ListView中进行显示,如果说显示的效果不好的话,我们可以换其他的系统定义的布局。

this.adp = new ArrayAdapter(this,android.R.layout.simple_list_item_1,data);

此时完成的操作是一个简单ListView的显示操作,但是这种操作并不好,因为ArrayAdapter只适合数组的操作,对于一些其他比较复杂的界面的就没有办法完成。

 

 

范例:图片—编号—信息

       首先我们来编写布局模板

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <ImageView
        android:id="@+id/img"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:src="@drawable/ic_launcher"/>
    <TextView 
        android:id="@+id/num"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        />
	<TextView 
        android:id="@+id/info"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        />
</LinearLayout>

 主布局文件:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
   	android:orientation="vertical"
    >
	<TextView 
	    android:layout_width="match_parent"
    	android:layout_height="wrap_content"
	    android:textSize="25px"
	    android:gravity="center"
	    android:text="爱科技有限公司"
	    />
    <ListView
        android:id="@+id/mylist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</LinearLayout>

现在主要就是Activity程序没有完成,我们需要使用SimpleAdapter为ListView 设置信息。

	package com.example.listviewproject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class ListViewActivity extends Activity {
	private String data[][] = { { "001", "爱科技有限公司" },
			{ "002", "www.aikeji.com" }, { "003", "兰州市软件园二期" },
			{ "004", "研发一部" }, { "005", "软件项目组" },
			{ "006", "Android应用开发" }, { "007", "初级工程师" }, { "008", "双软认定企业" },
			{ "009", "高科技企业" }, { "010", "服务外包示范企业" } };
	private ListView listView = null;
	private List<Map<String, String>> list = new ArrayList<Map<String, String>>();
	private SimpleAdapter simpleAdapter = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_list_view);
		this.listView = (ListView) super.findViewById(R.id.mylist);
		// 准备List集合,里面放的是Map
		for (int i = 0; i < data.length; i++) {
			Map<String, String> map = new HashMap<String, String>();
			map.put("num", data[i][0]);
			map.put("info", data[i][1]);
			list.add(map);// 将Map加入到List集合中
		}
		this.simpleAdapter = new SimpleAdapter(this, list, R.layout.list_view,
				new String[] { "num", "info" },
				new int[] { R.id.num, R.id.info });//准备好了SimpleAdapter
		this.listView.setAdapter(this.simpleAdapter);//设置ListView显示的数据。
	}
}

对于这种程序来说,依然是比较简单的程序。我们再看一下更为复杂的布局。

首先还是修改布局模板:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <ImageView
        android:id="@+id/img"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="3px"/>
  	<LinearLayout 
  	    android:layout_width="100px"
    	android:layout_height="wrap_content"
  	    android:orientation="vertical"
  	    >
  	    <TextView
  	        android:id="@+id/coursename"
  	        android:layout_width="wrap_content"
    		android:layout_height="wrap_content"
  	        android:textSize="20px"
  	        android:padding="3px"
  	        />
  	    <TextView
  	        android:id="@+id/teacher"
  	        android:layout_width="wrap_content"
    		android:layout_height="wrap_content"
  	        android:textSize="15px"
  	        android:padding="3px"
  	        />
  	</LinearLayout>
  	
  	<LinearLayout 
  	    android:layout_width="250px"
    	android:layout_height="wrap_content"
  	    android:orientation="vertical"
  	    >
  	    <TextView
  	        android:id="@+id/info"
  	        android:layout_width="wrap_content"
    		android:layout_height="wrap_content"
  	        android:textSize="15px"
  	        android:padding="3px"
  	        />
  	    <ImageView
	        android:id="@+id/score"
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"
	        android:padding="3px"/>
  	</LinearLayout>
</LinearLayout>

主布局文件:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
   	android:orientation="vertical"
    >
	<TextView 
	    android:layout_width="match_parent"
    	android:layout_height="wrap_content"
	    android:textSize="25px"
	    android:gravity="center"
	    android:text="爱科技培训学校视频列表"
	    />
    <ListView
        android:id="@+id/mylist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</LinearLayout>

编写Activity程序:

package com.example.listviewproject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class ListViewActivity extends Activity {
	private ListView listView = null;
	private List<Map<String, String>> list = new ArrayList<Map<String, String>>();
	private SimpleAdapter simpleAdapter = null;
	private int pic[] = {R.drawable.java,R.drawable.javaweb,R.drawable.oracle};
	private String data[][] = {{"JavaSE","毛栗子","2000"},{"JavaWeb","小石头","1000"},{"Oracle","大白菜","3000"}};
	private int picScore[] = {R.drawable.javascore,R.drawable.javawebscore,R.drawable.oraclescore};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_list_view);
		this.listView = (ListView) super.findViewById(R.id.mylist);
		// 准备List集合,里面放的是Map
		for (int i = 0; i < data.length; i++) {
			Map<String, String> map = new HashMap<String, String>();
			map.put("img",String.valueOf(pic[i]));
			map.put("coursename",data[i][0]);
			map.put("teacher",data[i][1]);
			map.put("info",data[i][2]);
			map.put("score", String.valueOf(picScore[i]));
			list.add(map);
			
		}
		this.simpleAdapter = new SimpleAdapter(this, list, R.layout.list_view,
				new String[] { "img", "coursename","teacher","info","score" },
				new int[] { R.id.img, R.id.coursename,R.id.teacher,R.id.info,R.id.score });//准备好了SimpleAdapter
		this.listView.setAdapter(this.simpleAdapter);//设置ListView显示的数据。
	}
}

以上的程序我们都是在Activity程序中设置ListView的内容的,在Android中,也为开发者提供了列表显示IDE一个ListActivity组件类,开发者的Activity程序只需要直接集成此类。

package com.example.listviewproject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.SimpleAdapter;

public class ListViewActivity extends ListActivity {
	private List<Map<String, String>> list = new ArrayList<Map<String, String>>();
	private SimpleAdapter simpleAdapter = null;
	private int pic[] = {R.drawable.java,R.drawable.javaweb,R.drawable.oracle};
	private String data[][] = {{"JavaSE","毛栗子","2000"},{"JavaWeb","小石头","1000"},{"Oracle","大白菜","3000"}};
	private int picScore[] = {R.drawable.javascore,R.drawable.javawebscore,R.drawable.oraclescore};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// 准备List集合,里面放的是Map
		for (int i = 0; i < data.length; i++) {
			Map<String, String> map = new HashMap<String, String>();
			map.put("img",String.valueOf(pic[i]));
			map.put("coursename",data[i][0]);
			map.put("teacher",data[i][1]);
			map.put("info",data[i][2]);
			map.put("score", String.valueOf(picScore[i]));
			list.add(map);
			
		}
		this.simpleAdapter = new SimpleAdapter(this, list, R.layout.list_view,
				new String[] { "img", "coursename","teacher","info","score" },
				new int[] { R.id.img, R.id.coursename,R.id.teacher,R.id.info,R.id.score });//准备好了SimpleAdapter
		super.setListAdapter(this.simpleAdapter);//设置ListView显示的数据。
	}
}

 以上的程序没有使用主体的布局文件,只是使用了布局模板,最终的效果也是在画面上显示列表的功能。虽然这种操作可以完成列表显示,但是这种风格并不是特别的实用,肯定不如之前在布局文件中直接定义ListView,并使用Activity程序去填充ListView中的数据,现在我们已经掌握了ListView的一些显示操作,现在我们要关注的就是对ListView进行事件的监听操作。

继续修改程序。   

修改主布局文件:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
   	android:orientation="vertical"
    >
	<TextView 
	    android:layout_width="match_parent"
    	android:layout_height="wrap_content"
	    android:textSize="25px"
	    android:gravity="center"
	    android:text="爱科技软件培训学校视频列表"
	    />
    <ListView
        android:id="@+id/mylist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <TextView
        android:id="@+id/selectinfo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        />
</LinearLayout>

 修改Activity程序:

package com.example.listviewproject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

public class ListViewActivity extends Activity {
	private TextView selectInfo = null;
	private ListView listView = null;
	private List<Map<String, String>> list = new ArrayList<Map<String, String>>();
	private SimpleAdapter simpleAdapter = null;
	private int pic[] = {R.drawable.java,R.drawable.javaweb,R.drawable.oracle};
	private String data[][] = {{"JavaSE","毛栗子","2000"},{"JavaWeb","小石头","1000"},{"Oracle","大白菜","3000"}};
	private int picScore[] = {R.drawable.javascore,R.drawable.javawebscore,R.drawable.oraclescore};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_list_view);
		this.selectInfo = (TextView) super.findViewById(R.id.selectinfo);
		this.listView = (ListView) super.findViewById(R.id.mylist);
		// 准备List集合,里面放的是Map
		for (int i = 0; i < data.length; i++) {
			Map<String, String> map = new HashMap<String, String>();
			map.put("img",String.valueOf(pic[i]));
			map.put("coursename",data[i][0]);
			map.put("teacher",data[i][1]);
			map.put("info",data[i][2]);
			map.put("score", String.valueOf(picScore[i]));
			list.add(map);
		}
		this.simpleAdapter = new SimpleAdapter(this, list, R.layout.list_view,
				new String[] { "img", "coursename","teacher","info","score" },
				new int[] { R.id.img, R.id.coursename,R.id.teacher,R.id.info,R.id.score });//准备好了SimpleAdapter
		this.listView.setAdapter(this.simpleAdapter);//设置ListView显示的数据。
		
		//进行事件监听
		this.listView.setOnItemClickListener(new OnItemClickListener() {//单击选项
			@Override
			public void onItemClick(AdapterView<?> parent, View view, int position,
					long id) {
				//在单击的时候取得数据信息
				Map<String,String> map = (Map<String,String>)ListViewActivity.this.simpleAdapter.getItem(position);//返回选中行的数据
				String teacher = map.get("teacher");//去除选中老师信息
				String coursename = map.get("coursename");//取得选中课程名称
				ListViewActivity.this.selectInfo.setText("课程名称:" + coursename+"老师名称:" +teacher);
			}
			
		});
	}
}

2.3 小结

(1)使用ListView可以进行数据的列表显示;

(2)对于ListView显示的数据可以使用ArrayAdapter和SimpleAdapter进行封装;

(3)可以直接让一个类继承ListActivit类实现简单的列表操作;

(4)列表操作也可以进行事件的监听处理;

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/670137.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

执行Windows数据恢复的有效指南!

​被删除的文件真的没有了吗&#xff1f; 在Windows上&#xff0c;删除的文件会被放在哪里&#xff1f;发生的事情告诉我们&#xff0c;这些最近和永久删除的文件可能在数据覆盖之前仍存在于你的Windows电脑上。 在删除之后&#xff0c;回收站会自动保留这些最近删…

【Mysql索引数据结构与算法】

脑图链接 一、索引 什么是索引 索引指的是数据库管理系统中一个排序的数据结构&#xff0c;以协助快速查询、更新数据库表中的数据。类似于书籍的目录&#xff0c;用于快速定位到所需内容、数据的页码位置。 优点&#xff1a;提高数据检索的效率&#xff0c;降低数据库的IO成…

TC8:UDP_FIELDS_06-10

UDP_FIELDS_06: Fields - Total Length 目的 验证DUT发送的UDP报文的Total Length字段的正确性 测试步骤 Tester:让DUT发送UDP消息,数据大小为udpUserDataSizeTester:监听在DIface-0上DUT:发送消息Tester:验证接收到的UDP消息的Total Length字段的值为udpUserDataSize+8期…

Ansys Zemax | 内窥镜物镜系统初始结构的优化提升(上)

概述 本文分为内窥镜系统简介、主要结构、系统分析、性能提升和总结五个部分&#xff0c;介绍了内窥镜系统的主要结构&#xff0c;并讨论了如何在 OpticStudio 中根据内窥镜物镜系统的初始结构进行像差分析&#xff0c;以及如何对其进行后续的优化提升。(联系我们获取文章附件…

【设计模式】SpringBoot优雅使用策略模式

文章目录 1.概述1.1.简述策略模式 2.实现方法2.1.实现思路2.2.实现代码2.3.策略拓展2.4.执行调用 3.总结 1.概述 本篇文章主要会描述SpringBoot与策略模式的结合使用&#xff0c;因为不涉及到理论部分&#xff0c;所以在阅读本篇之前&#xff0c;需要对策略模式的理论已经有了…

<C++> C++11 新的类功能

C11 新的类功能 1.默认成员函数 原来C类中&#xff0c;有6个默认成员函数&#xff1a; 构造函数析构函数拷贝构造函数拷贝赋值重载取地址重载const取地址重载 最后重要的是前4个&#xff0c;后两个用处不大。默认成员函数就是我们不写编译器会生成一个默认的。 C11 新增了两…

大家知道什么是CDN吗?对网站有什么帮助?

&#x1f482; 个人网站:【海拥】【游戏大全】【神级源码资源网】&#x1f91f; 前端学习课程&#xff1a;&#x1f449;【28个案例趣学前端】【400个JS面试题】&#x1f485; 寻找学习交流、摸鱼划水的小伙伴&#xff0c;请点击【摸鱼学习交流群】 目录 前言什么是CDN&#xf…

【Python 随练】自由落体运动

题目&#xff1a; 一球从 100 米高度自由落下&#xff0c;每次落地后反跳回原高度的一半&#xff1b;再落下&#xff0c;求它在第 10 次落地时&#xff0c;共经过多少米&#xff1f;第 10 次反弹多高&#xff1f; 简介&#xff1a; 在本篇博客中&#xff0c;我们将解决一个物…

华为OD机试之阿里巴巴找黄金宝箱(IV)(Java源码)

阿里巴巴找黄金宝箱(IV) 题目描述 一贫如洗的樵夫阿里巴巴在去砍柴的路上&#xff0c;无意中发现了强盗集团的藏宝地&#xff0c;藏宝地有编号从0-N的箱子&#xff0c;每个箱子上面有一个数字&#xff0c;箱子排列成一个环&#xff0c;编号最大的箱子的下一个是编号为0的箱子。…

[进阶]网络通信:概述、IP地址、InetAddress

什么是网络编程&#xff1f; 可以让设备中的程序与网络上其他设备中的程序进行数据交互&#xff08;实现网络通信的&#xff09;。 Java提供的网络编程解决方案就是在java.net.*包下进行网络编程。 基本的通信架构 基本的通信架构有2种形式&#xff1a;CS架构&#xff08;Cl…

C++IO流和类型处理(11)

IO流 IO流包括 标准IO流&#xff0c;字符串流&#xff0c;文件流 标准IO流 基础使用 #include <iostream> //包括istream和ostream cin >> ----- 标准输入 cout<< ----- 标准输出 clog<< ----- 带缓冲区的标准错误 cerr<< ----- 不带缓冲…

lazada、速卖通、煤炉、eBay 、亚马逊测评环境系统:如何掌握核心养号技巧?

作为一个准备跨足测评行业的业者&#xff0c;或是一个正在考虑将电商业务转向测评服务的卖家&#xff0c;一份详尽的养号指南绝对是你不可错过的知识宝库。 跨境电商平台无疑是巨大的数据中心&#xff0c;它们不仅检测你的设备参数和IP&#xff0c;还分析你的购物习惯&#xf…

mapbox-gl 点位编辑功能

文章目录 前言方式一&#xff1a;借助 Marker添加自定义icon添加POI图层&#xff0c;绑定对应事件基于Marker交互创建自定义Marker编辑 / 创建POI 方式二&#xff1a;采用 mapbox-gl-draw 插件总结 前言 矢量在线编辑是gis常用的编辑功能&#xff0c;兴趣点&#xff08;POI&am…

力扣算法练习(一)

目录 1. 两数相加&#xff08;2&#xff09; 2. 寻找两个正序数组的中位数&#xff08;4&#xff09; 1. 两数相加&#xff08;2&#xff09; 给你两个 非空 的链表&#xff0c;表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的&#xff0c;并且每个节点只能存储…

MySQL 中的常用函数详解

0️⃣前言 MySQL是一种常用的关系型数据库管理系统&#xff0c;它提供了许多内置函数来处理数据。本文将介绍MySQL中的各种常用函数&#xff0c;包括字符串函数、日期函数、数学函数、聚合函数等。 文章目录 0️⃣前言1️⃣字符串函数1.1CONCAT函数1.2SUBSTRING函数1.3REPLACE函…

高级SQL语句1

高级SQL语句 建立实验环境高级语句1.---- SELECT ----显示表格中一个或数个字段的所有数据记录2.---- DISTINCT ----不显示重复的数据记录3.---- WHERE ----有条件查询4.---- AND OR ----且 或 &#xff08;一般配合where使用&#xff09;5.---- IN ----显示已知的值的数据记录…

私家云二代/比特米盒安装Armbian Blueseye到Emmc

快捷导航 私家云二代/比特米盒安装Armbian Blueseye到Emmc设备介绍前期准备硬件清单Windows电脑一台Type-C数据线一根U盘或SD卡一个键盘一把显示器HDMI数据线 软件清单Amlogic USB Burning ToolUSB烧录工具SSH工具 下载清单Amlogic刷机工具USB烧录工具ATV6.imgDTB文件BIN文件切…

Spring Security OAuth2授权原理、流程与源码解读

文章目录 前言AuthorizationServerConfigurerAdapter(身份认证服务配置适配器)OAuth2AuthorizationServerConfiguration(OAuth2授权服务配置) EnableAuthorizationServer(开启身份认证服务)AuthorizationServerEndpointsConfigurations身份认证服务站点配置类AuthorizationEndp…

HITSZ嵌入式计算(研)23年Keil模拟器项目解决方案

HITSZ嵌入式计算&#xff08;研&#xff09;23年Keil模拟器项目解决方案 1. 项目介绍2. Keil安装3. 创建新项目3.1 参考博文3.2 流程 4. 发送串口数据4.1 参考博文4.2 串口收发流程 5. 产生波形5.1 头文件封装5.2 初始化GPIO口5.3 产生并观察方波 6. Keil信号函数和中断6.1 中断…

佩戴舒适的蓝牙耳机有哪些品牌?不伤耳的蓝牙耳机推荐

​真无线蓝牙耳机逐渐成为大家日常必不可少的数码产品&#xff0c;也随着耳机的发展&#xff0c;人们对蓝牙耳机的要求也越来越高&#xff0c;不仅音质要好&#xff0c;长时间佩戴也要舒适&#xff0c;更是能够应用于多种场景中使用&#xff0c;但挑选蓝牙耳机也是一门学问&…