Android安卓读写低频EM4469卡源码

news2024/9/28 17:24:53

本示例使用的发卡器:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="3dp"
    tools:context=".EM4469Activity">
    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:background="?attr/colorPrimary"
        app:navigationIcon="@drawable/baseline_arrow_back_ios_24"
        app:titleTextColor="@color/white"
        tools:ignore="MissingConstraints"
        tools:layout_editor_absoluteY="0dp">

        <TextView
            android:id="@+id/TextViewlabelDispleft"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:text="返回"
            android:textColor="@color/white"
            android:textSize="16sp"
            android:gravity="center"
            android:onClick="retmain" />

        <TextView
            android:id="@+id/TextViewlabelDisp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="EM4469卡测试页  "
            android:textColor="@color/white"
            android:textSize="16sp"
            android:gravity="center_horizontal|right|center"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="@+id/TextViewlabelDispleft"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.appcompat.widget.Toolbar>

    <TextView
        android:id="@+id/sample_text"
        android:layout_width="fill_parent"
        android:layout_height="150dp"
        android:padding="3dp"
        android:text="操作结果"
        android:textSize="12sp"
        android:background="@drawable/shape4border"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"

        />


    <ScrollView
        android:id="@+id/scrollViewIC"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="5dp"

        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/toolbar"
        app:layout_constraintBottom_toTopOf="@+id/sample_text"
        android:scrollbars="horizontal"
        >

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="3dp"

            >

            <CheckBox
                android:id="@+id/chkPwdEM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="12sp"
                android:checked="false"
                android:text="带密码操作"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent"/>

            <EditText
                android:id="@+id/editTextPwdEM4469"
                android:layout_width="80dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:background="@drawable/shape4border"
                android:digits="0123456789ABCDEFabcdef"
                android:gravity="center"
                android:inputType="textCapCharacters"
                android:maxLength="8"
                android:maxLines="1"
                android:text="00000000"
                android:textSize="14sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkPwdEM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkPwdEM4469"
                app:layout_constraintTop_toTopOf="@+id/chkPwdEM4469"

                />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="(十六进制)"
                android:textSize="12sp"
                android:layout_marginLeft="10dp"
                app:layout_constraintLeft_toRightOf="@+id/editTextPwdEM4469"
                app:layout_constraintTop_toTopOf="@+id/chkPwdEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkPwdEM4469"/>



            <CheckBox
                android:id="@+id/chkUidNeedEM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="12sp"
                android:checked="false"
                android:text="仅操作指定卡号的卡"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/chkPwdEM4469"/>

            <EditText
                android:id="@+id/editTextUidEM4469"
                android:layout_width="80dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:background="@drawable/shape4border"
                android:digits="0123456789ABCDEFabcdef"
                android:gravity="center"
                android:inputType="textCapCharacters"
                android:maxLength="8"
                android:maxLines="1"
                android:text="00000000"
                android:textSize="14sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkUidNeedEM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkUidNeedEM4469"
                app:layout_constraintTop_toTopOf="@+id/chkUidNeedEM4469"

                />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="(十六进制)"
                android:textSize="12sp"
                android:layout_marginLeft="10dp"
                app:layout_constraintLeft_toRightOf="@+id/editTextUidEM4469"
                app:layout_constraintTop_toTopOf="@+id/chkUidNeedEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkUidNeedEM4469"/>



            <TextView
                android:id="@+id/TextViewlabel15"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="返回数据:"
                android:textSize="12sp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintBottom_toTopOf="@+id/TextViewRetDataEM4469"/>

            <TextView
                android:id="@+id/TextViewRetDataEM4469"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="3dp"
                android:text=""
                android:textSize="12sp"
                android:background="@drawable/shape4border"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/btnRetDataClrEM4469"

                />



            <Button
                android:id="@+id/btnRetDataClrEM4469"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:onClick="textclear4469"
                android:text="清空数据"
                android:textSize="11sp"
                app:layout_constraintTop_toBottomOf="@+id/editTextUidEM4469"
                app:layout_constraintRight_toRightOf="parent" />

            <Button
                android:id="@+id/btnPwdChangeEM4469"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:onClick="changepwd4469"
                android:text="修改卡密码"
                android:textSize="11sp"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/TextViewRetDataEM4469" />

            <TextView
                android:id="@+id/TextViewlabel16"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="新密码:"
                android:textSize="12sp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="@+id/btnPwdChangeEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/btnPwdChangeEM4469"

                />

            <EditText
                android:id="@+id/editTextPwdNewEM4469"
                android:layout_width="80dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:background="@drawable/shape4border"
                android:digits="0123456789ABCDEFabcdef"
                android:gravity="center"
                android:inputType="textCapCharacters"
                android:maxLength="8"
                android:maxLines="1"
                android:text="00000000"
                android:textSize="14sp"
                app:layout_constraintBottom_toBottomOf="@+id/btnPwdChangeEM4469"
                app:layout_constraintLeft_toRightOf="@+id/TextViewlabel16"
                app:layout_constraintTop_toTopOf="@+id/btnPwdChangeEM4469" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="(十六进制)"
                android:textSize="12sp"
                android:layout_marginLeft="10dp"
                app:layout_constraintLeft_toRightOf="@+id/editTextPwdNewEM4469"
                app:layout_constraintTop_toTopOf="@+id/editTextPwdNewEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/editTextPwdNewEM4469"/>


            <CheckBox
                android:id="@+id/chkB0EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="11sp"
                android:checked="false"
                android:text="块0"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/btnPwdChangeEM4469"/>

            <CheckBox
                android:id="@+id/chkB1EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="11sp"
                android:checked="false"
                android:text="块1(UID)"
                app:layout_constraintLeft_toRightOf="@+id/chkB0EM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkB0EM4469"/>

            <CheckBox
                android:id="@+id/chkB3EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="11sp"
                android:checked="false"
                android:text="块3"
                app:layout_constraintLeft_toRightOf="@+id/chkB1EM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkB0EM4469"/>
            <CheckBox
                android:id="@+id/chkB4EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="12sp"
                android:checked="false"
                android:text="块4(配置)"
                app:layout_constraintLeft_toRightOf="@+id/chkB3EM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkB0EM4469"/>
            <CheckBox
                android:id="@+id/chkB5EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="12sp"
                android:checked="false"
                android:text="块5"
                app:layout_constraintLeft_toRightOf="@+id/chkB4EM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkB0EM4469"/>



            <CheckBox
                android:id="@+id/chkB6EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块6"
                android:textSize="11sp"
                app:layout_constraintLeft_toRightOf="@+id/chkB5EM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkB0EM4469"/>

            <CheckBox
                android:id="@+id/chkB7EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:textSize="12sp"
                android:checked="false"
                android:text="块7"
                app:layout_constraintTop_toBottomOf="@+id/chkB0EM4469"
                app:layout_constraintLeft_toLeftOf="parent"/>


            <CheckBox
                android:id="@+id/chkB8EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块8"
                android:textSize="11sp"
                app:layout_constraintLeft_toRightOf="@+id/chkB7EM4469"
                app:layout_constraintBottom_toBottomOf="@+id/chkB7EM4469" />

            <CheckBox
                android:id="@+id/chkB9EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块9"
                android:textSize="11sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkB8EM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkB8EM4469" />

            <CheckBox
                android:id="@+id/chkB10EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块10"
                android:textSize="11sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkB8EM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkB9EM4469" />

            <CheckBox
                android:id="@+id/chkB11EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块11"
                android:textSize="11sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkB8EM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkB10EM4469" />

            <CheckBox
                android:id="@+id/chkB12EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块12"
                android:textSize="11sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkB8EM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkB11EM4469" />

            <CheckBox
                android:id="@+id/chkB13EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块13"
                android:textSize="11sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkB8EM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkB12EM4469" />

            <CheckBox
                android:id="@+id/chkB14EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块14"
                android:textSize="11sp"
                app:layout_constraintTop_toBottomOf="@+id/chkB8EM4469"
                app:layout_constraintLeft_toLeftOf="parent" />

            <CheckBox
                android:id="@+id/chkB15EM4469"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="2dp"
                android:checked="false"
                android:text="块15"
                android:textSize="11sp"
                app:layout_constraintBottom_toBottomOf="@+id/chkB14EM4469"
                app:layout_constraintLeft_toRightOf="@+id/chkB14EM4469" />

            <TextView
                android:id="@+id/TextViewlabel17"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="写入数据:"
                android:textSize="12sp"
                app:layout_constraintTop_toBottomOf="@+id/chkB14EM4469"
                app:layout_constraintLeft_toLeftOf="parent" />

            <EditText
                android:id="@+id/editTextDataEM4469"
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:background="@drawable/shape4border"
                android:digits="0123456789ABCDEFabcdef"
                android:gravity="left"
                android:inputType="textCapCharacters"
                android:maxLength="128"
                android:text="11111111"
                android:padding="3dp"
                android:textSize="12sp"
                app:layout_constraintLeft_toLeftOf="@+id/TextViewRetDataEM4469"
                app:layout_constraintRight_toRightOf="@+id/TextViewRetDataEM4469"
                app:layout_constraintTop_toBottomOf="@+id/TextViewlabel17" />

            <Button
                android:id="@+id/btnReadEM4469"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:layout_marginRight="20dp"
                android:onClick="read4469"
                android:text="读卡"
                android:textSize="11sp"
                app:layout_constraintRight_toLeftOf="@+id/btnWriteEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/btnWriteEM4469" />

            <Button
                android:id="@+id/btnWriteEM4469"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:onClick="write4469"
                android:text="写卡"
                android:textSize="11sp"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintBottom_toTopOf="@+id/editTextDataEM4469" />

            <TextView
                android:id="@+id/TextViewlabel18"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="数据速率:"
                android:textSize="12sp"
                app:layout_constraintTop_toTopOf="@+id/SpinnerDateRateEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/SpinnerDateRateEM4469"
                app:layout_constraintLeft_toLeftOf="parent" />

            <Spinner
                android:id="@+id/SpinnerDateRateEM4469"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:entries="@array/datarateEM4469"
                android:theme="@style/my_spinner_style"
                android:spinnerMode="dropdown"
                app:layout_constraintLeft_toRightOf="@+id/TextViewlabel18"
                app:layout_constraintTop_toBottomOf="@+id/editTextDataEM4469">

            </Spinner>



            <TextView
                android:id="@+id/TextViewlabel19"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="调制模式:"
                android:textSize="12sp"
                app:layout_constraintTop_toTopOf="@+id/SpinnerDateRateEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/SpinnerDateRateEM4469"
                app:layout_constraintRight_toLeftOf="@+id/SpinnerEncoderEM4469" />

            <Spinner
                android:id="@+id/SpinnerEncoderEM4469"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:entries="@array/EncoderEM4469"
                android:theme="@style/my_spinner_style"
                android:spinnerMode="dropdown"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintBottom_toBottomOf="@+id/SpinnerDateRateEM4469">

            </Spinner>

            <Spinner
                android:id="@+id/SpinnerLoginModeEM4469"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:entries="@array/loginmodeEM4469"
                android:theme="@style/my_spinner_style"
                android:spinnerMode="dropdown"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"

                app:layout_constraintTop_toBottomOf="@+id/SpinnerEncoderEM4469">

            </Spinner>


            <TextView
                android:id="@+id/TextViewlabel20"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="自动发送最大块:"
                android:textSize="12sp"
                app:layout_constraintTop_toTopOf="@+id/editTextMaxBlockEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/editTextMaxBlockEM4469"
                app:layout_constraintLeft_toLeftOf="parent" />

            <EditText
                android:id="@+id/editTextMaxBlockEM4469"
                android:layout_width="20dp"
                android:layout_height="wrap_content"
                android:background="@drawable/shape4border"
                android:digits="0123456789"
                android:gravity="left"
                android:inputType="textCapCharacters"
                android:maxLength="2"
                android:text="6"
                android:paddingLeft="3dp"
                android:textSize="12sp"
                app:layout_constraintLeft_toRightOf="@+id/TextViewlabel20"
                app:layout_constraintTop_toBottomOf="@+id/SpinnerLoginModeEM4469" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="范围:5-15块,时序从5块至最大块"
                android:textSize="12sp"
                app:layout_constraintBottom_toBottomOf="@+id/editTextMaxBlockEM4469"
                app:layout_constraintLeft_toRightOf="@+id/editTextMaxBlockEM4469"
                app:layout_constraintTop_toTopOf="@+id/editTextMaxBlockEM4469" />


            <TextView
                android:id="@+id/TextViewlabel21"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="配置值:"
                android:textSize="12sp"
                app:layout_constraintTop_toTopOf="@+id/editTextConfigWordEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/editTextConfigWordEM4469"
                app:layout_constraintLeft_toLeftOf="parent" />

            <EditText
                android:id="@+id/editTextConfigWordEM4469"
                android:layout_width="68dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:background="@drawable/shape4border"
                android:digits="0123456789ABCDEFabcdef"
                android:gravity="left"
                android:inputType="textCapCharacters"
                android:maxLength="8"
                android:text="45800100"
                android:paddingLeft="3dp"
                android:textSize="12sp"
                app:layout_constraintLeft_toRightOf="@+id/TextViewlabel21"
                app:layout_constraintTop_toBottomOf="@+id/editTextMaxBlockEM4469" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="(十六进制)"
                android:textSize="12sp"
                android:layout_marginLeft="10dp"
                app:layout_constraintLeft_toRightOf="@+id/editTextConfigWordEM4469"
                app:layout_constraintTop_toTopOf="@+id/editTextConfigWordEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/editTextConfigWordEM4469"/>

            <Button
                android:id="@+id/btnDefalutEM4469"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:layout_marginRight="20dp"
                android:onClick="default4469"
                android:text="← 默认值"
                android:textSize="11sp"
                app:layout_constraintRight_toLeftOf="@+id/btnInitEM4469"
                app:layout_constraintBottom_toBottomOf="@+id/btnInitEM4469" />


            <Button
                android:id="@+id/btnInitEM4469"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:onClick="init4469"
                android:text="设定配置"
                android:textSize="12sp"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/editTextConfigWordEM4469"/>

        </androidx.constraintlayout.widget.ConstraintLayout>


    </ScrollView>


</androidx.constraintlayout.widget.ConstraintLayout>

 

package com.usbreadertest;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

import com.reader.ouridr;
import com.reader.ourmifare;
public class EM4469Activity extends AppCompatActivity {
    private TextView tv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_em4469);
        androidx.appcompat.widget.Toolbar toolbar=findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        tv = findViewById(R.id.sample_text);
        tv.setText("操作结果");

        //增加输入监听事件
        //EM4469
        ((EditText)findViewById(R.id.editTextMaxBlockEM4469)).setOnFocusChangeListener(new View.OnFocusChangeListener(){

            @Override
            public void onFocusChange(View v,boolean FocusState) {
                if(FocusState){//进入焦点

                }
                else{//离开焦点
                    updateset4469();
                }

            }
        });

        Spinner spls;
        spls = findViewById(R.id.SpinnerDateRateEM4469);//数据速率
        spls.setSelection(1);

        spls.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                updateset4469();
            }

            @Override
            public void onNothingSelected(AdapterView<?> parent) {

            }
        });

        spls = findViewById(R.id.SpinnerEncoderEM4469);//调制模式
        spls.setSelection(1);
        spls.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                updateset4469();
            }

            @Override
            public void onNothingSelected(AdapterView<?> parent) {

            }
        });

        //加密模式
        ((Spinner)findViewById(R.id.SpinnerLoginModeEM4469)).setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                updateset4469();
            }

            @Override
            public void onNothingSelected(AdapterView<?> parent) {

            }
        });
    }
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if(item.getItemId()==android.R.id.home){
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    public void retmain(View view)
    {
        finish();
    }

    public void textclear4469(View view)
    {
        TextView tvls;
        tvls = findViewById(R.id.TextViewRetDataEM4469);
        tvls.setText("");
    }
    public void changepwd4469(View view)
    {
        byte i;
        byte j;
        byte status;//存放返回值

        byte myctrlword;//控制字

        byte[] oldpicckey = new byte[4];//旧密码
        byte[] mypiccserial = new byte[4];//卡序列号
        byte[] newpicckey = new byte[4];//新密码

        myctrlword = 0; //NEEDSERIAL:需要只对指定系列号的卡操作,NEEDKEY:需要用密码认证,LOCKBIT:锁定块,KEYENABLE:启用本卡的密码功能

        String strls;

        CheckBox cbls;
        EditText etls;

        cbls = findViewById(R.id.chkPwdEM4469);
        if(!cbls.isChecked()) {//本次操作需要密码验证
            tv.setText("EM4469卡修改卡密码必须带密码操作");
            return;
        }

        etls = findViewById(R.id.editTextPwdEM4469);
        strls = etls.getText().toString().trim();
        if(strls.length() < 8)
        {
            tv.setText("旧密码长度不足8位");
            return;
        }
        for (i = 0; i < 4; i++) {
            oldpicckey[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
        }
        myctrlword += ouridr.NEEDKEY;

        cbls = findViewById(R.id.chkUidNeedEM4469);
        if(cbls.isChecked()) {//仅操作指定卡号的卡
            etls = findViewById(R.id.editTextUidEM4469);
            strls = etls.getText().toString().trim();
            if(strls.length() < 8)
            {
                tv.setText("卡号长度不足8位");
                return;
            }

            for (i = 0; i < 4; i++) {
                mypiccserial[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
            myctrlword += ouridr.NEEDSERIAL;

        }

        etls = findViewById(R.id.editTextPwdNewEM4469);
        strls = etls.getText().toString().trim();
        if(strls.length() < 8)
        {
            tv.setText("新密码长度不足8位!");
            return;
        }

        for (i = 0; i < 4; i++) {
            newpicckey[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
        }

        status = ouridr.em4305changekey(myctrlword,mypiccserial,oldpicckey,newpicckey);

        if(status == 0)
        {

            strls = "卡号[";

            strls += String.format("%02X%02X%02X%02X",mypiccserial[0],mypiccserial[1],mypiccserial[2],mypiccserial[3]);

            strls += "]";

            TextView tvls = findViewById(R.id.TextViewRetDataEM4469);
            tvls.setText(strls);

            strls = "EM4469卡修改卡密码成功";

            ouridr.beep(38);



        }
        else
        {

            if(status == 8)
            {
                strls = "请将卡放在感应区";
            }
            else if(status == 23)
            {
                strls = "错误代码:23,读卡器未插入";
            }
            else if(status == 1)
            {
                strls = "错误代码:1,卡放得远 或 需要密码才能写卡";
            }
            else if(status == 12)
            {
                strls = "错误代码:12,卡放得远 或 密码错误";
            }
            else
            {
                strls = "错误代码:" + Integer.toString(status);
            }

        }

        tv.setText(strls);
    }
    public void read4469(View view)
    {
        byte i;
        byte status;//存放返回值

        byte myctrlword;//控制字

        byte[] oldpicckey = new byte[4];//密码
        byte[] mypiccserial = new byte[4];//卡序列号
        byte[] mypiccdata = new byte[64];//读卡数据缓冲:卡无线转输分频比、卡内容长度(字节数),及最多返回12块的数据
        byte[] mypiccblockflag = new byte[2];//指定读哪一块

        myctrlword = 0; //NEEDSERIAL:需要只对指定系列号的卡操作,NEEDKEY:需要用密码认证,LOCKBIT:锁定块,KEYENABLE:启用本卡的密码功能

        String strls;

        CheckBox cbls;
        EditText etls;

        cbls = findViewById(R.id.chkPwdEM4469);
        if(cbls.isChecked()) {//本次操作需要密码验证
            etls = findViewById(R.id.editTextPwdEM4469);
            strls = etls.getText().toString().trim();
            if(strls.length() < 8)
            {
                tv.setText("密码长度不足8位");
                return;
            }
            for (i = 0; i < 4; i++) {
                oldpicckey[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
            myctrlword += ouridr.NEEDKEY;

        }

        cbls = findViewById(R.id.chkUidNeedEM4469);
        if(cbls.isChecked()) {//仅操作指定卡号的卡
            etls = findViewById(R.id.editTextUidEM4469);
            strls = etls.getText().toString().trim();
            if(strls.length() < 8)
            {
                tv.setText("卡号长度不足8位");
                return;
            }

            for (i = 0; i < 4; i++) {
                mypiccserial[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
            myctrlword += ouridr.NEEDSERIAL;

        }

        //操作块标志
        mypiccblockflag[0] = 0;

        cbls = findViewById(R.id.chkB0EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 1;
        }

        cbls = findViewById(R.id.chkB1EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 2;
        }

        cbls = findViewById(R.id.chkB3EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 8;
        }

        cbls = findViewById(R.id.chkB4EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 16;
        }

        cbls = findViewById(R.id.chkB5EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 32;
        }

        cbls = findViewById(R.id.chkB6EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 64;
        }

        cbls = findViewById(R.id.chkB7EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 128;
        }

        mypiccblockflag[1] = 0;

        cbls = findViewById(R.id.chkB8EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 1;
        }

        cbls = findViewById(R.id.chkB9EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 2;
        }

        cbls = findViewById(R.id.chkB10EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 4;
        }

        cbls = findViewById(R.id.chkB11EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 8;
        }

        cbls = findViewById(R.id.chkB12EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 16;
        }

        cbls = findViewById(R.id.chkB13EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 32;
        }

        cbls = findViewById(R.id.chkB14EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 64;
        }

        cbls = findViewById(R.id.chkB15EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 128;
        }

        status = ouridr.em4305read(myctrlword,mypiccserial,oldpicckey,mypiccblockflag,mypiccdata);

        if(status == 0)
        {

            strls = "卡无线转输分频比[" + Integer.toString(mypiccdata[0]) + "],卡号[";

            strls += String.format("%02X%02X%02X%02X",mypiccserial[0],mypiccserial[1],mypiccserial[2],mypiccserial[3]);

            strls += "],卡数据[";

            for (i = 0; i < mypiccdata[1]; i++) {
                strls += String.format("%02X",mypiccdata[i+2]);
            }

            strls += "]";

            TextView tvls = findViewById(R.id.TextViewRetDataEM4469);
            tvls.setText(strls);

            strls = "读EM4469卡成功";

            ouridr.beep(38);



        }
        else
        {

            if(status == 8)
            {
                strls = "请将卡放在感应区";
            }
            else if(status == 23)
            {
                strls = "错误代码:23,读卡器未插入";
            }
            else if(status == 4)
            {
                strls = "错误代码:4,卡放得远 或 需要密码才能读卡";
            }
            else if(status == 12)
            {
                strls = "错误代码:12,卡放得远 或 密码错误";
            }
            else
            {
                strls = "错误代码:" + Integer.toString(status);
            }

        }

        tv.setText(strls);
    }
    public void write4469(View view)
    {
        byte i;
        byte j;
        byte status;//存放返回值

        byte myctrlword;//控制字

        byte[] oldpicckey = new byte[4];//密码
        byte[] mypiccserial = new byte[4];//卡序列号
        byte[] mypiccdata = new byte[64];//读卡数据缓冲:卡无线转输分频比、卡内容长度(字节数),最多12块的数据
        byte[] mypiccblockflag = new byte[2];//指定读哪一块

        myctrlword = 0; //NEEDSERIAL:需要只对指定系列号的卡操作,NEEDKEY:需要用密码认证,LOCKBIT:锁定块,KEYENABLE:启用本卡的密码功能

        String strls;

        CheckBox cbls;
        EditText etls;

        cbls = findViewById(R.id.chkPwdEM4469);
        if(cbls.isChecked()) {//本次操作需要密码验证
            etls = findViewById(R.id.editTextPwdEM4469);
            strls = etls.getText().toString().trim();
            if(strls.length() < 8)
            {
                tv.setText("密码长度不足8位");
                return;
            }
            for (i = 0; i < 4; i++) {
                oldpicckey[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
            myctrlword += ouridr.NEEDKEY;

        }

        cbls = findViewById(R.id.chkUidNeedEM4469);
        if(cbls.isChecked()) {//仅操作指定卡号的卡
            etls = findViewById(R.id.editTextUidEM4469);
            strls = etls.getText().toString().trim();
            if(strls.length() < 8)
            {
                tv.setText("卡号长度不足8位");
                return;
            }

            for (i = 0; i < 4; i++) {
                mypiccserial[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
            myctrlword += ouridr.NEEDSERIAL;

        }

        //操作块标志
        j = 0;
        mypiccblockflag[0] = 0;

        cbls = findViewById(R.id.chkB0EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 1;
            j++;
        }

        cbls = findViewById(R.id.chkB1EM4469);
        if(cbls.isChecked()) {
            tv.setText("块1为只读,不允许写");
            return;
        }

        cbls = findViewById(R.id.chkB3EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 8;
            j++;
        }

        cbls = findViewById(R.id.chkB4EM4469);
        if(cbls.isChecked()) {
            tv.setText("块4为配置区,只能在初始化函数中操作");
            return;
        }

        cbls = findViewById(R.id.chkB5EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 32;
            j++;
        }

        cbls = findViewById(R.id.chkB6EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 64;
            j++;
        }

        cbls = findViewById(R.id.chkB7EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[0] += 128;
            j++;
        }

        mypiccblockflag[1] = 0;

        cbls = findViewById(R.id.chkB8EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 1;
            j++;
        }

        cbls = findViewById(R.id.chkB9EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 2;
            j++;
        }

        cbls = findViewById(R.id.chkB10EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 4;
            j++;
        }

        cbls = findViewById(R.id.chkB11EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 8;
            j++;
        }

        cbls = findViewById(R.id.chkB12EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 16;
            j++;
        }

        cbls = findViewById(R.id.chkB13EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 32;
            j++;
        }

        cbls = findViewById(R.id.chkB14EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 64;
            j++;
        }

        cbls = findViewById(R.id.chkB15EM4469);
        if(cbls.isChecked()) {
            mypiccblockflag[1] += 128;
            j++;
        }

        //写卡数据准备
        if(j == 0)
        {
            tv.setText("请先选择需要写入的块");
            return;
        }
        etls = findViewById(R.id.editTextDataEM4469);
        strls = etls.getText().toString().trim();
        if(strls.length() < (j*8))
        {
            tv.setText("写入数据长度不足,请补足数据!");
            return;
        }

        for (i = 0; i < (j*4); i++) {
            mypiccdata[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
        }

        status = ouridr.em4305write(myctrlword,mypiccserial,oldpicckey,mypiccblockflag,mypiccdata);

        if(status == 0)
        {

            strls = "卡号[";

            strls += String.format("%02X%02X%02X%02X",mypiccserial[0],mypiccserial[1],mypiccserial[2],mypiccserial[3]);

            strls += "]";

            TextView tvls = findViewById(R.id.TextViewRetDataEM4469);
            tvls.setText(strls);

            strls = "写EM4469卡成功";

            ouridr.beep(38);



        }
        else
        {

            if(status == 8)
            {
                strls = "请将卡放在感应区";
            }
            else if(status == 23)
            {
                strls = "错误代码:23,读卡器未插入";
            }
            else if(status == 1)
            {
                strls = "错误代码:1,卡放得远 或 需要密码才能写卡";
            }
            else if(status == 12)
            {
                strls = "错误代码:12,卡放得远 或 密码错误";
            }
            else
            {
                strls = "错误代码:" + Integer.toString(status);
            }

        }

        tv.setText(strls);
    }
    public void default4469(View view)
    {

        EditText etls;
        Spinner spls;

        etls = findViewById(R.id.editTextConfigWordEM4469);
        etls.setText("45800100");
        etls = findViewById(R.id.editTextMaxBlockEM4469);
        etls.setText("6");

        spls = findViewById(R.id.SpinnerDateRateEM4469);//数据速率
        spls.setSelection(1);
        spls = findViewById(R.id.SpinnerEncoderEM4469);//调制模式
        spls.setSelection(1);
        spls = findViewById(R.id.SpinnerLoginModeEM4469);//加密模式
        spls.setSelection(0);

    }

    public void updateset4469()
    {
        EditText etls;
        EditText etMaxBlock;
        Spinner spls;
        String strls;
        byte i;

        byte[] Configdata = new byte[4];//配置值

        etls = findViewById(R.id.editTextConfigWordEM4469);
        strls = etls.getText().toString().trim();
        if(strls.length() < 8){
            strls = "45800100";
            Configdata[0] = 0x45;
            Configdata[1] = (byte)0x80;
            Configdata[2] = 0x01;
            Configdata[3] = 0x00;
        }
        else {
            for (i = 2; i < 4; i++) {
                Configdata[i] = (byte)Integer.parseInt(strls.substring(i * 2, i * 2 + 2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
        }

        spls = findViewById(R.id.SpinnerDateRateEM4469);//数据速率
        i = (byte)(spls.getSelectedItemId());
        Configdata[0] = 0x00;
        Configdata[1] = 0x00;
        if(i == 0){//RF/32
            Configdata[0] |= 0x04;
        }
        else if(i == 2) {//RF/128
            Configdata[0] |= 0x06;
        }
        else {//RF/64或其他
            Configdata[0] |= 0x05;
        }

        spls = findViewById(R.id.SpinnerEncoderEM4469);//调制模式
        i = (byte)(spls.getSelectedItemId());
        if(i == 0){//NRZ码

        }
        else if(i == 2) {//Biphase码
            Configdata[0] |= 0x80;
        }
        else if(i == 3) {//Miller码
            Configdata[0] |= 0xC0;
        }
        else if(i == 4) {//PSK2码
            Configdata[0] |= 0x40;
            Configdata[1] |= 0x01;
        }
        else if(i == 5) {//PSK3码
            Configdata[0] |= 0x80;
            Configdata[1] |= 0x01;
        }
        else if(i == 6) {//FSK码
            Configdata[1] |= 0x02;
        }
        else {//其他
            Configdata[0] |= 0x40;
        }

        Configdata[2] = 0x00;
        //自动发送最大块
        etMaxBlock = findViewById(R.id.editTextMaxBlockEM4469);
        strls = etMaxBlock.getText().toString().trim();
        if(strls.length() < 1){
            i = 6;
            etMaxBlock.setText("6");
        }
        else {
            i = (byte)Integer.parseInt(strls,10);
            if((i < 5) || (i > 15)){
                i = 6;
                etMaxBlock.setText("6");
            }
        }

        Configdata[1] |=  ((i % 4) * 64);
        Configdata[2] |= ((i / 4) % 4);

        spls = findViewById(R.id.SpinnerLoginModeEM4469);//密码规则(也就是读登陆或写登陆)
        i = (byte)(spls.getSelectedItemId());
        if(i == 1){//0-1块任意读,3-15块需密码读,0-13块任意写,14-15块需密码写
            i = 0x01;
        }
        else if(i == 2) {//0-15任意读,0-15块需密码写
            i = 0x04;
        }
        else if(i == 3) {//0-1块任意读,3-15块需密码读,0-15块需密码写
            i = 0x05;
        }
        else {//0-15块任意读.0-13块任意写,14-15块需密码写
            i = 0x00;
        }

        Configdata[2] |= (i * 4);

        Configdata[3] = 0;

        etls.setText(String.format("%02X%02X%02X%02X",Configdata[0],Configdata[1],Configdata[2],Configdata[3]));

    }

    public void init4469(View view)
    {
        byte i;
        byte status;//存放返回值

        byte myctrlword;//控制字

        byte[] oldpicckey = new byte[4];//密码
        byte[] mypiccserial = new byte[4];//卡序列号
        byte[] mypiccdata = new byte[4];//写入数据缓冲

        myctrlword = 0; //NEEDSERIAL:需要只对指定系列号的卡操作,NEEDKEY:需要用密码认证,LOCKBIT:锁定块,KEYENABLE:启用本卡的密码功能

        String strls;

        CheckBox cbls;
        EditText etls;

        updateset4469();

        cbls = findViewById(R.id.chkPwdEM4469);
        if(cbls.isChecked()) {//本次操作需要密码验证
            etls = findViewById(R.id.editTextPwdEM4469);
            strls = etls.getText().toString().trim();
            if(strls.length() < 8)
            {
                tv.setText("密码长度不足8位");
                return;
            }
            for (i = 0; i < 4; i++) {
                oldpicckey[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
            myctrlword += ouridr.NEEDKEY;

        }


        cbls = findViewById(R.id.chkUidNeedEM4469);
        if(cbls.isChecked()) {//仅操作指定卡号的卡
            etls = findViewById(R.id.editTextUidEM4469);
            strls = etls.getText().toString().trim();
            if(strls.length() < 8)
            {
                tv.setText("卡号长度不足8位");
                return;
            }

            for (i = 0; i < 4; i++) {
                mypiccserial[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
            }
            myctrlword += ouridr.NEEDSERIAL;

        }

        //配置值:
        etls = findViewById(R.id.editTextConfigWordEM4469);
        strls = etls.getText().toString().trim();
        if(strls.length() < 8)
        {
            tv.setText("配置值输入长度不足8位");
            return;
        }
        for (i = 0; i < 4; i++) {
            mypiccdata[i] = (byte)Integer.parseInt(strls.substring(i*2,i*2+2),16);//只有用Integer.parseInt才能杜绝大于128时的错误
        }

        status = ouridr.em4469init(myctrlword,mypiccserial,oldpicckey,mypiccdata);

        if(status == 0)
        {

            strls = "卡号[";

            strls += String.format("%02X%02X%02X%02X",mypiccserial[0],mypiccserial[1],mypiccserial[2],mypiccserial[3]);

            strls += "]";

            TextView tvls = findViewById(R.id.TextViewRetDataEM4469);
            tvls.setText(strls);

            strls = "配置EM4469卡成功";

            ouridr.beep(38);

        }
        else
        {

            if(status == 8)
            {
                strls = "卡不在感应区 或 密码不正确";
            }
            else if(status == 23)
            {
                strls = "错误代码:23,读卡器未插入";
            }
            else if(status == 1)
            {
                strls = "错误代码:1,卡放得远 或 需要密码才能写卡";
            }
            else if(status == 12)
            {
                strls = "错误代码:12,卡放得远 或 密码错误";
            }
            else
            {
                strls = "错误代码:" + Integer.toString(status);
            }

        }

        tv.setText(strls);
    }


}

源码下载:AndroidstudioRFIDNFC读写源码资源-CSDN文库

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

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

相关文章

Qt通用属性工具:随心定义,随时可见(三)

传送门: 《Qt通用属性工具:随心定义,随时可见(一)》 《Qt通用属性工具:随心定义,随时可见(二)》 《Qt通用属性工具:随心定义,随时可见(三)》 一、效果展示 本文将展示的是一个源于Qt但是却有些年头的Qt属性浏览工具。支持交互式编辑和查阅对象属性。 这可不就是妥…

机器学习--人工智能概述

人工智能概述 入门人工智能&#xff0c;了解人工智能是什么。为啥发展起来&#xff0c;用途是什么&#xff0c;是最重要也是最关键的事情。大致有以下思路。 人工智能发展历程机器学习定义以及应用场景监督学习&#xff0c;无监督学习监督学习中的分类、回归特点知道机器学习…

产品经理学习-产品运营《用户运营策略》

⽤户画像与⽤户运营策略 什么是用户画像 对产品运营而言&#xff0c;用户画像就是对用户的各种特征贴上标签通过这些标签将用户分成不同的用户群体 为用户提供有针对性的服务。 制作用户画像是为了专注和精准 使产品的服务对象更加聚焦&#xff0c;更加专注&#xff1b;根据产…

NIFI 2.0.0版本HTTPS访问部署

1. 相关环境 服务器&#xff1a;centos JDK&#xff1a;jdk21 NIFI: nifi-2.0.0-M1 2. 下载NIFI 下载NIFI https://nifi.apache.org/download/ 将文件上传至服务器指定目录&#xff0c;解压缩 修改 bin 目录下的脚本文件 ​ 注意: nifi 2.0.0 版本需要jdk21&#xff0c;所…

C++ 二叉树OJ题

目录 1、606. 根据二叉树创建字符串 2、102. 二叉树的层序遍历 3、107. 二叉树的层序遍历 II 4、236. 二叉树的最近公共祖先 5、JZ36 二叉搜索树与双向链表 6、105. 从前序与中序遍历序列构造二叉树 7、106. 从中序与后序遍历序列构造二叉树 8、144. 二叉树的前序遍历…

pdf怎么查看?6个不能错过的软件!

PDF&#xff0c;作为一种常用的文件格式&#xff0c;已经成为了我们工作、学习中的必备工具。然而&#xff0c;对于许多新手来说&#xff0c;如何查看和编辑PDF文件却是一个不小的挑战。今天&#xff0c;我们就来为大家详细介绍一下如何查看和编辑PDF文件&#xff0c;以及一些必…

从法律的角度看待项目前期可行性研究的必要性

前言 在司法实践中&#xff0c;很多纠纷展现出来的问题是项目提供方没有按照合同约定履行发生违约的情况&#xff0c;例如逾期交付、项目不符合约定标准等等&#xff0c;但是这些情况发生的原因是各不相同的&#xff0c;其中有一类纠纷的发生却是从一开始就埋下了风险的种子&a…

2.0-学成在线内容管理

内容管理模块 1.需求 1.1 业务流程 内容管理的业务由教学机构人员和平台的运营人员共同完成。 教学机构人员的业务流程如下&#xff1a; 1、登录教学机构。 2、维护课程信息&#xff0c;添加一门课程需要编辑课程的基本信息、上传课程图片、课程营销信息、课程计划、上传课程…

深入详解使用 RabbitMQ 过程中涉及到的多个细节问题(面试可用)

目录 1、基础类问题 2、cluster 相关问题 3、综合性问题 4、参考资料 C软件异常排查从入门到精通系列教程&#xff08;专栏文章列表&#xff0c;欢迎订阅&#xff0c;持续更新...&#xff09;https://blog.csdn.net/chenlycly/article/details/125529931C/C基础与进阶&…

OB OCP工具

文章目录 OCP产品架构OCP核心功能集群管理-集群拓扑图告警管理 OCP OCP&#xff08;OceanBase Cloud Platform&#xff09;是企业级数据库管理平台OceanBase 云平台&#xff08;OceanBase Cloud Platform&#xff0c;OCP&#xff09;是以 OceanBase 为核心的企业级数据库管理平…

外汇天眼:加拿大监管机构提出了关于持有加密资产的公共投资基金的规定

加拿大证券管理局&#xff08;CSA&#xff09;是由加拿大各省金融市场监管机构组成的国家机构。他们已发布了一组旨在征求意见的拟议监管要求&#xff0c;适用于寻求投资加密资产的公共投资基金。 Stan Magidson&#xff0c;CSA主席兼艾伯塔证券委员会主席兼首席执行官表示&…

无货源跨境电商到底应该怎么做,新手必看

如今&#xff0c;跨境电商无疑已经成为了一个热门的创业领域&#xff0c;但对于一些新手来说&#xff0c;面临的一个主要挑战是如何处理产品的货源问题。下面我就和大家分享一下无货源跨境电商的基本概念以及一些新手可以采取的策略和步骤&#xff0c;帮助大家在这个领域取得成…

UE4 添加按键输入事件 并在蓝图中使用按键输入节点

绑定按键 选择Edit/ProjectSettings/Engine/Input 在bindings中可以选择添加ActionMappings或则AxisMappings ActionMappings:按键事件&#xff0c;有按下和抬起两个事件&#xff0c;需要分别用两个键触发AxisMappings:输入事件&#xff0c;返回值为float&#xff0c;对于键盘…

突破划片机技术瓶颈,博捷芯BJX3352助力晶圆切割行业升级

随着半导体行业的快速发展&#xff0c;晶圆切割作为半导体制造过程中的重要环节&#xff0c;对于切割设备的性能和精度要求越来越高。为了满足市场需求&#xff0c;提高生产效率&#xff0c;国产划片机企业博捷芯推出了新一代划片机BJX3352&#xff0c;成功突破了技术瓶颈&…

(设置非自定义Bean)学习Spring的第六天

一 . 获取Bean的方法详解 , 如下图 : 二 . Spring配置非自定义bean----DruidDatasource 我们举个例子 : 配置Druid数据源交由Spring管理 首先导入在pom文件Druid坐标 然后考虑 : 被配置的Bean的实例化方式是什么 : 无参构造 被配置的Bena是否要注入必要属性 : 四个基本信息…

msvcp140_atomic_wait.dll文件缺失的解决方法指南,如何快速修复

在处理计算机软件时&#xff0c;我们经常遭遇一些阻碍程序运行的错误&#xff0c;尤其是那些与动态链接库(DLL)文件相关的。msvcp140_atomic_wait.dll是一个常见的DLL文件&#xff0c;它在Windows操作系统中扮演了重要角色。本文将讨论msvcp140_atomic_wait.dll文件的作用&…

小程序导出excel

先上个图&#xff0c;这个是在电脑上测试导出来的表 大致远离就是用的原生td&#xff0c;tr去导出的&#xff0c; 代码 <template><view><button click"tableToExcel">导出一个表来看</button></view> </template><script&g…

《Python数据分析技术栈》第01章 02 Jupyter入门(Getting started with Jupyter notebooks)

02 Jupyter入门&#xff08;Getting started with Jupyter notebooks&#xff09; 《Python数据分析技术栈》第01章 02 Jupyter入门&#xff08;Getting started with Jupyter notebooks&#xff09; Before we discuss the essentials of Jupyter notebooks, let us discuss…

C语言编译和链接

翻译环境和运行环境 在ANSI C的任何一种实现中&#xff0c;存在两个不同的环境 .第一种是翻译环境&#xff0c;在这个环境中源代码被转换为可执行的机器指令 .第二种是执行环境&#xff0c;它用于实际执行代码 翻译环境 翻译环境是由编译和链接两个大过程组成&#xff0c;而…