From cd12c890814fc15a63ed224024949de5e1a4c188 Mon Sep 17 00:00:00 2001 From: Asura146 Date: Fri, 12 Jan 2024 10:37:44 +0900 Subject: [PATCH] =?UTF-8?q?Bluetooth=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=9D=E5=AD=98=E3=81=99=E3=82=8B=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../childguard/Bluetooth_device_save.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/src/androidTest/java/com/example/childguard/Bluetooth_device_save.java diff --git a/app/src/androidTest/java/com/example/childguard/Bluetooth_device_save.java b/app/src/androidTest/java/com/example/childguard/Bluetooth_device_save.java new file mode 100644 index 0000000..de0df1c --- /dev/null +++ b/app/src/androidTest/java/com/example/childguard/Bluetooth_device_save.java @@ -0,0 +1,21 @@ +package com.example.childguard; + +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; + +import androidx.appcompat.app.AppCompatActivity; + +public class Bluetooth_device_save extends AppCompatActivity { + final SharedPreferences pref= PreferenceManager.getDefaultSharedPreferences(this); + public Bluetooth_device_save() { + } + public void device_save(String deviceAddress){ + SharedPreferences.Editor e=pref.edit(); + e.putString("bluetooth_device1",deviceAddress); + e.apply(); + } + public String device_info(){ + return pref.getString("bluetooth_device1","not_device"); + } +}