Android Studio开发之使用内容组件Content获取通讯信息讲解及实战(附源码 包括添加手机联系人和发短信)

news2025/4/17 17:32:24

运行有问题或需要源码请点赞关注收藏后评论区留言

一、利用ContentResolver读写联系人

在实际开发中,普通App很少会开放数据接口给其他应用访问。内容组件能够派上用场的情况往往是App想要访问系统应用的通讯数据,比如查看联系人,短信,通话记录等等,以及对这些通讯数据及逆行增删改查。 首先要给AndroidMaifest.xml中添加响应的权限配置 

   <!-- 存储卡读写 -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAG" />
    <!-- 联系人/通讯录。包括读联系人、写联系人 -->
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <!-- 短信。包括发送短信、接收短信、读短信 -->
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <!-- 通话记录。包括读通话记录、写通话记录 -->
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
    <uses-permission android:name="android.permission.WRITE_CALL_LOG" />
    <!-- 安装应用请求,Android8.0需要 -->
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

下面是往手机通讯录添加联系人信息的例子 效果如下

分成三个步骤 先查出联系人的基本信息,然后查询联系人号码,再查询联系人邮箱

代码

 ContactAddActivity类

package com.example.chapter07;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

import com.example.chapter07.bean.Contact;
import com.example.chapter07.util.CommunicationUtil;
import com.example.chapter07.util.ToastUtil;

@SuppressLint("DefaultLocale")
public class ContactAddActivity extends AppCompatActivity implements View.OnClickListener {
    private static final String TAG = "ContactAddActivity";
    private EditText et_contact_name;
    private EditText et_contact_phone;
    private EditText et_contact_email;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_contact_add);
        et_contact_name = findViewById(R.id.et_contact_name);
        et_contact_phone = findViewById(R.id.et_contact_phone);
        et_contact_email = findViewById(R.id.et_contact_email);
        findViewById(R.id.btn_add_contact).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.btn_add_contact) {
            Contact contact = new Contact(); // 创建一个联系人对象
            contact.name = et_contact_name.getText().toString().trim();
            contact.phone = et_contact_phone.getText().toString().trim();
            contact.email = et_contact_email.getText().toString().trim();
            // 方式一,使用ContentResolver多次写入,每次一个字段
            CommunicationUtil.addContacts(getContentResolver(), contact);
            // 方式二,使用ContentProviderOperation一次写入,每次多个字段
            //CommunicationUtil.addFullContacts(getContentResolver(), contact);
            ToastUtil.show(this, "成功添加联系人信息");
        }
    }

}

ContactReadActivity类

package com.example.chapter07;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.chapter07.bean.Contact;
import com.example.chapter07.util.CommunicationUtil;
import com.example.chapter07.util.ToastUtil;
import com.example.chapter07.util.Utils;

import java.util.List;

public class ContactReadActivity extends AppCompatActivity {
    private TextView tv_desc;
    private LinearLayout ll_list; // 联系人列表的线性布局

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_contact_read);
        tv_desc = findViewById(R.id.tv_desc);
        ll_list = findViewById(R.id.ll_list);
        showContactInfo(); // 显示所有的联系人信息
    }

    // 显示所有的联系人信息
    private void showContactInfo() {
        try {
            // 读取所有的联系人
            List<Contact> contactList = CommunicationUtil.readAllContacts(getContentResolver());
            String contactCount = String.format("当前共找到%d位联系人", contactList.size());
            tv_desc.setText(contactCount);
            for (Contact contact : contactList){
                String contactDesc = String.format("姓名为%s,号码为%s",contact.name, contact.phone);
                TextView tv_contact = new TextView(this); // 创建一个文本视图
                tv_contact.setText(contactDesc);
                tv_contact.setTextColor(Color.BLACK);
                tv_contact.setTextSize(17);
                int pad = Utils.dip2px(this, 5);
                tv_contact.setPadding(pad, pad, pad, pad); // 设置文本视图的内部间距
                ll_list.addView(tv_contact); // 把文本视图添加至联系人列表的线性布局
            }
        } catch (Exception e) {
            e.printStackTrace();
            ToastUtil.show(this, "请检查是否开启了通讯录权限");
        }
    }

}

activity_contact_addXML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="5dp" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="40dp" >

        <TextView
            android:id="@+id/tv_contact_name"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="联系人姓名:"
            android:textColor="@color/black"
            android:textSize="17sp" />

        <EditText
            android:id="@+id/et_contact_name"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="3dp"
            android:layout_marginTop="3dp"
            android:layout_toRightOf="@+id/tv_contact_name"
            android:background="@drawable/editext_selector"
            android:gravity="left|center"
            android:hint="请输入联系人姓名"
            android:inputType="text"
            android:maxLength="12"
            android:textColor="@color/black"
            android:textSize="17sp" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="40dp" >

        <TextView
            android:id="@+id/tv_contact_phone"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="联系人号码:"
            android:textColor="@color/black"
            android:textSize="17sp" />

        <EditText
            android:id="@+id/et_contact_phone"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="3dp"
            android:layout_marginTop="3dp"
            android:layout_toRightOf="@+id/tv_contact_phone"
            android:background="@drawable/editext_selector"
            android:gravity="left|center"
            android:hint="请输入联系人手机号码"
            android:inputType="number"
            android:maxLength="11"
            android:textColor="@color/black"
            android:textSize="17sp" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="40dp" >

        <TextView
            android:id="@+id/tv_contact_email"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="联系人邮箱:"
            android:textColor="@color/black"
            android:textSize="17sp" />

        <EditText
            android:id="@+id/et_contact_email"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="3dp"
            android:layout_marginTop="3dp"
            android:layout_toRightOf="@+id/tv_contact_email"
            android:background="@drawable/editext_selector"
            android:gravity="left|center"
            android:hint="请输入联系人邮箱"
            android:inputType="textEmailAddress"
            android:textColor="@color/black"
            android:textSize="17sp" />
    </RelativeLayout>

    <Button
        android:id="@+id/btn_add_contact"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="添加联系人"
        android:textColor="@color/black"
        android:textSize="17sp" />

</LinearLayout>

activity_contact_readXML

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

    <TextView
        android:id="@+id/tv_desc"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:textColor="@color/black"
        android:textSize="17sp" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/ll_list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" />

    </ScrollView>

</LinearLayout>

二、利用ContentObserver监听短信

ContentRslover获取数据采用的是主动查询方式,有查询才有数据否则美哟。为了省事,这时用到了ContentObserver内容观察器,事先给目标内容注册一个观察器,目标内容的数据一旦发生变化,就马上触发观察器的监听事件,从而执行开发者预先定义的代码

内容观察器的用法与内容提供器类似,下面是交互方法说明

registerContentObserver 内容解析器要注册内容观察器

unregisterContentObserver 注销

notifyChange 通知内容观察器发生了数据变化

 

 java类代码

MonitorSmsActivity

package com.example.chapter07;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.telephony.SmsManager;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

@SuppressLint("DefaultLocale")
public class MonitorSmsActivity extends AppCompatActivity implements View.OnClickListener {
    private static final String TAG = "MonitorSmsActivity";
    private static TextView tv_check_flow;
    private static String mCheckResult;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_monitor_sms);
        tv_check_flow = findViewById(R.id.tv_check_flow);
        tv_check_flow.setOnClickListener(this);
        findViewById(R.id.btn_check_flow).setOnClickListener(this);
        initSmsObserver();
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.btn_check_flow) {
            //查询数据流量,移动号码的查询方式为发送短信内容“18”给“10086”
            //电信和联通号码的短信查询方式请咨询当地运营商客服热线
            //跳到系统的短信发送页面,由用户手工发短信
            //sendSmsManual("10086", "18");
            //无需用户操作,自动发送短信
            sendSmsAuto("10086", "18");
        } else if (v.getId() == R.id.tv_check_flow) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle("收到流量校准短信");
            builder.setMessage(mCheckResult);
            builder.setPositiveButton("确定", null);
            builder.create().show();
        }
    }

    // 跳到系统的短信发送页面,由用户手工编辑与发送短信
    public void sendSmsManual(String phoneNumber, String message) {
        Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + phoneNumber));
        intent.putExtra("sms_body", message);
        startActivity(intent);
    }

    // 短信发送事件
    private String SENT_SMS_ACTION = "com.example.storage.SENT_SMS_ACTION";
    // 短信接收事件
    private String DELIVERED_SMS_ACTION = "com.example.storage.DELIVERED_SMS_ACTION";

    // 无需用户操作,由App自动发送短信
    public void sendSmsAuto(String phoneNumber, String message) {
        // 以下指定短信发送事件的详细信息
        Intent sentIntent = new Intent(SENT_SMS_ACTION);
        sentIntent.putExtra("phone", phoneNumber);
        sentIntent.putExtra("message", message);
        PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,
                sentIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        // 以下指定短信接收事件的详细信息
        Intent deliverIntent = new Intent(DELIVERED_SMS_ACTION);
        deliverIntent.putExtra("phone", phoneNumber);
        deliverIntent.putExtra("message", message);
        PendingIntent deliverPI = PendingIntent.getBroadcast(this, 1,
                deliverIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        // 获取默认的短信管理器
        SmsManager smsManager = SmsManager.getDefault();
        // 开始发送短信内容。要确保打开发送短信的完全权限,不是那种还需提示的不完整权限
        smsManager.sendTextMessage(phoneNumber, null, message, sentPI, deliverPI);
    }

    private Handler mHandler = new Handler(); // 声明一个处理器对象
    private SmsGetObserver mObserver; // 声明一个短信获取的观察器对象
    private static Uri mSmsUri; // 声明一个系统短信提供器的Uri对象
    private static String[] mSmsColumn; // 声明一个短信记录的字段数组

    // 初始化短信观察器
    private void initSmsObserver() {
        //mSmsUri = Uri.parse("content://sms/inbox");
        //Android5.0之后似乎无法单独观察某个信箱,只能监控整个短信
        mSmsUri = Uri.parse("content://sms"); // 短信数据的提供器路径
        mSmsColumn = new String[]{"address", "body", "date"}; // 短信记录的字段数组
        // 创建一个短信观察器对象
        mObserver = new SmsGetObserver(this, mHandler);
        // 给指定Uri注册内容观察器,一旦发生数据变化,就触发观察器的onChange方法
        getContentResolver().registerContentObserver(mSmsUri, true, mObserver);
    }

    // 在页面销毁时触发
    protected void onDestroy() {
        super.onDestroy();
        getContentResolver().unregisterContentObserver(mObserver); // 注销内容观察器
    }

    // 定义一个短信获取的观察器
    private static class SmsGetObserver extends ContentObserver {
        private Context mContext; // 声明一个上下文对象
        public SmsGetObserver(Context context, Handler handler) {
            super(handler);
            mContext = context;
        }

        // 观察到短信的内容提供器发生变化时触发
        public void onChange(boolean selfChange) {
            String sender = "", content = "";
            // 构建一个查询短信的条件语句,移动号码要查找10086发来的短信
            String selection = String.format("address='10086' and date>%d",
                    System.currentTimeMillis() - 1000 * 60 * 1); // 查找最近一分钟的短信
            // 通过内容解析器获取符合条件的结果集游标
            Cursor cursor = mContext.getContentResolver().query(
                    mSmsUri, mSmsColumn, selection, null, " date desc");
            // 循环取出游标所指向的所有短信记录
            while (cursor.moveToNext()) {
                sender = cursor.getString(0); // 短信的发送号码
                content = cursor.getString(1); // 短信内容
                Log.d(TAG, "sender="+sender+", content="+content);
                break;
            }
            cursor.close(); // 关闭数据库游标
            mCheckResult = String.format("发送号码:%s\n短信内容:%s", sender, content);
            // 依次解析流量校准短信里面的各项流量数值,并拼接流量校准的结果字符串
            String flow = String.format("流量校准结果如下:总流量为:%s;已使用:%s" +
                            ";剩余流量:%s", findFlow(content, "总流量为"),
                    findFlow(content, "已使用"), findFlow(content, "剩余"));
            if (tv_check_flow != null) { // 离开该页面后就不再显示流量信息
                tv_check_flow.setText(flow); // 在文本视图显示流量校准结果
            }
            super.onChange(selfChange);
        }
    }

    // 解析流量短信里面的流量数值
    private static String findFlow(String sms, String begin) {
        String flow = findString(sms, begin, "GB");
        String temp = flow.replace("GB", "").replace(".", "");
        if (!temp.matches("\\d+")) {
            flow = findString(sms, begin, "MB");
        }
        return flow;
    }

    // 截取指定头尾之间的字符串
    private static String findString(String content, String begin, String end) {
        int begin_pos = content.indexOf(begin);
        if (begin_pos < 0) {
            return "未获取";
        }
        String sub_sms = content.substring(begin_pos);
        int end_pos = sub_sms.indexOf(end);
        if (end_pos < 0) {
            return "未获取";
        }
        if (end.equals(",")) {
            return sub_sms.substring(begin.length(), end_pos);
        } else {
            return sub_sms.substring(begin.length(), end_pos + end.length());
        }
    }

}

XML文件代码

activity_monitor_smsXML

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

    <Button
        android:id="@+id/btn_check_flow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="发送校准短信"
        android:textColor="@color/black"
        android:textSize="17sp" />

    <TextView
        android:id="@+id/tv_check_flow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:textColor="@color/black"
        android:textSize="17sp" />

</LinearLayout>

创作不易 觉得有帮助请点赞关注收藏~~~~

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

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

相关文章

Linux top命令的cpu使用率和内存使用率

文章目录前言一、cpu使用率1.1 top简介1.2 cpu使用率的来源二、内存使用率2.1 总内存有关的数据2.2 进程使用内存有关的数据2.3 内存使用率的来源三、 pmap参考资料前言 NAMEtop - display Linux processes一、cpu使用率 1.1 top简介 top程序提供当前运行系统的动态实时视图…

网络协议:一文搞懂Socket套接字

本篇内容包括&#xff1a;Socket 套接字的简介、Socket 套接字的分类、Java 中的 Socket 即 java.net.ServerSocket、java.net.Socket 的使用&#xff0c;以及Java 使用套接字 Scoket 编程的Demo。 一、Socket 简介 TCP&#xff08;传输控制协议&#xff09;是一种面向连接的、…

Qt编写跨平台RTSP/RTMP/HTTP视频流播放器

一、前言 很早以前就做过这款播放器的入门版本&#xff0c;最开始用的ffmpeg去解析&#xff0c;后面陆续用vlc播放器、mpv播放器来做&#xff0c;毕竟播放器提供的接口使用也很方便&#xff0c;而且功能强大&#xff0c;后面发现播放器主要的应用场景是播放视频文件&#xff0…

安装配置Anaconda3

1.装anaconda&#xff0c;就不需要单独装python了 2、 下载Anaconda Anaconda | Anaconda Distribution 3、 安装Anaconda 其他默认 4、配置Anaconda环境变量 此电脑——属性——高级系统设置——环境变量——path——编辑——新建 C:\ProgramData\Anaconda3 C:\ProgramDa…

mybatis 自动化处理 mysql 的json类型字段 终极方案

文章目录mybatis 自动化处理 mysql 的json类型字段 终极方案mysql 建表 json 字段&#xff0c;添加1条json 数据对应的java对象 JsonEntitymybatis&#xff0c;不使用 通用mapper手动自定义1个类型处理器&#xff0c;专门处理 JsonNode 和Json 的互相转化将 自定义的类型处理器…

Java笔记(十二)

文献种类&#xff1a;专题技术总结文献 开发工具与关键技术&#xff1a; IntelliJ IDEA、Java 语言 作者&#xff1a; 方建恒 年级&#xff1a; 2020 撰写时间&#xff1a; 2022 年 11 月 8 日 Java笔记(十二) 今天我给大家继续分享一下我的Java笔记&#xff0c; 我们继续来了…

使用前缀和数组解决“区间和查询“问题

本文已收录到 GitHub AndroidFamily&#xff0c;有 Android 进阶知识体系&#xff0c;欢迎 Star。技术和职场问题&#xff0c;请关注公众号 [彭旭锐] 进 Android 面试交流群。 前言 大家好&#xff0c;我是小彭。 今天分享到一种非常有趣的数据结构 —— 前缀和数组。前缀和…

每日一题|2022-11-8|1684. 统计一致字符串的数目|哈希表|Golang

1684. 统计一致字符串的数目 思路1:丢人做法 哈希记录allowed&#xff0c;暴力遍历words所有字母&#xff0c;如果有不在哈希表里的&#xff0c;计数。最后用words的长度减去 计数 就行。 func countConsistentStrings(allowed string, words []string) int {has1 : make(map[…

如何判断一段程序是否是裸机程序?

在嵌入式MCU领域&#xff0c;一般将不移植操作系统直接烧录运行的程序称为裸机程序。 一般来说&#xff0c;非易失性存储&#xff0c;时钟&#xff0c;图形显示&#xff0c;网络通讯&#xff0c;用户I/O设备…都需要硬件依赖。 基于硬件基础&#xff0c;内存管理、文件系统、…

【API部署】fastapi与nuitka打包py项目

提示&#xff1a;分两部分&#xff1a;fastapi接口调用&#xff0c;与nuitka快速打包 功能&#xff1a;作为一名算法工程师&#xff0c;训练机器学习模型只是为客户提供解决方案的一部分。 除了生成和清理数据、选择和调整算法之外&#xff0c;还需交付和部署结果&#xff0c;…

130道基础OJ编程题之: 29 ~ 38 道

130道基础OJ编程题之: 29 ~ 38 道 文章目录130道基础OJ编程题之: 29 ~ 38 道0. 昔日OJ编程题:29. BC23 时间转换30. BC24 总成绩和平均分计算31. BC30 KiKi和酸奶32. BC31 发布信息33. BC3 输出学生信息34. BC33 计算平均成绩35. BC34 进制AB36. BC37 网购37.BC39 争夺前五名38…

【谷粒商城】

一、项目介绍 1.微服务架构图 2.微服务划分图 二、环境搭建 1.虚拟机搭建环境 这里我买了华为云&#xff0c;没用虚拟机 华为云配置 2.Linux 安装docker docker文档&#xff1a;https://docs.docker.com/engine/install/centos/ # 1. 卸载之前的dockersudo yum remove d…

[MySql]初识数据库与常见基本操作

专栏简介 :MySql数据库从入门到进阶. 题目来源:leetcode,牛客,剑指offer. 创作目标:记录学习MySql学习历程 希望在提升自己的同时,帮助他人,,与大家一起共同进步,互相成长. 学历代表过去,能力代表现在,学习能力代表未来! 文章目录 前言 1.初识数据库 1.1 数据库概述 1.2 数据库…

mysql隔离级别RR下的行锁、临键锁、间隙锁详解及运用

一&#xff1a;mysql 锁的基本概念 锁&#xff1a;悲观锁、乐观锁 悲观锁&#xff1a;写锁 for update、读锁for share 写锁&#xff1a;只允许当前事务读写&#xff0c;其它事务全部等待&#xff0c;包括读取数据&#xff0c;锁的数据范围需要具体分析 读锁&#xff1a;允…

【前端】Vue+Element UI案例:通用后台管理系统-Echarts图表:折线图、柱状图、饼状图

文章目录目标代码数据改写为动态Echarts引入与html结构折线图&#xff1a;orderData柱状图&#xff1a;userData饼状图&#xff1a;videoData总效果总代码:Home.vue上一篇&#xff1a;【前端】VueElement UI案例&#xff1a;通用后台管理系统-Echarts图表准备&#xff1a;axios…

公司缺人自己搞了vue又搞koa,熬夜把架子搭起来

如果有一天&#xff0c;人手紧缺&#xff0c;自己搞了前端还要搞服务端&#xff0c;今天我们把这个项目架子搭起来&#xff0c;让前端同学也可以轻松全栈开火。 技多不压身&#xff0c;活儿多了可压身啊 目录 一、上午写VUE 1、 新建一个我们的伟大项目文件夹 2、用vscode打…

程序中断方式

中断的基本概念 程序中断是指在计算机执行现行程序的过程中&#xff0c;出现某些急需处理的异常情况或特殊请求&#xff0c;CPU暂时中止现行程序&#xff0c;而转去对这些异常情况或特殊请求进行处理&#xff0c;在处理完毕后CPU又自动返回到现行程序的断点处&#xff0c;继续…

c语言之“数组”初级篇

前言 牛牛又和大家见面了&#xff0c;本篇牛牛要讲的内容是c语言中有关数组的内容。 欢迎大家一起学习&#xff0c;共同进步。 目录前言数组一、一维数组1.1 一维数组的创建1.2 一维数组的初始化1.3 一维数组的应用1.4 一维数组的存储二、二维数组2.1 二维数组创建2.2 二维数…

MySQL的select语句

SQL概述 SQL背景知识 1946 年&#xff0c;世界上第一台电脑诞生&#xff0c;如今&#xff0c;借由这台电脑发展起来的互联网已经自成江湖。在这几十年里&#xff0c;无数的技术、产业在这片江湖里沉浮&#xff0c;有的方兴未艾&#xff0c;有的已经几幕兴衰。但在这片浩荡的波…

基于android的车辆违章停放执法移动APP(ssm+uinapp+Mysql)-计算机毕业设计

车辆违章停放执法移动APP的功能已基本实现&#xff0c;主要实现首页&#xff0c;个人中心&#xff0c;市民管理&#xff0c;警察管理&#xff0c;罚单信息管理&#xff0c;缴费通知管理&#xff0c;系统管理等功能的操作系统。 论文主要从系统的分析与设计、数据库设计和系统的…