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 deleted file mode 100644 index de0df1c..0000000 --- a/app/src/androidTest/java/com/example/childguard/Bluetooth_device_save.java +++ /dev/null @@ -1,21 +0,0 @@ -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"); - } -} diff --git a/app/src/main/java/com/example/childguard/MainActivity.java b/app/src/main/java/com/example/childguard/MainActivity.java index e6a222c..4cd26ee 100644 --- a/app/src/main/java/com/example/childguard/MainActivity.java +++ b/app/src/main/java/com/example/childguard/MainActivity.java @@ -34,9 +34,8 @@ public class MainActivity extends AppCompatActivity { //通知のやつ↓ int importance = NotificationManager.IMPORTANCE_DEFAULT; - NotificationChannel channel = new NotificationChannel("CHANNEL_ID", "通報通知", importance); - //説明・説明 ここに通知の説明を書くことができる↓ - channel.setDescription("第3者からの通報を検知しました"); + NotificationChannel channel = new NotificationChannel("CHANNEL_ID", "サンプルアプリ", importance); + channel.setDescription("説明・説明 ここに通知の説明を書くことができる"); NotificationManager notificationManager = getSystemService(NotificationManager.class); notificationManager.createNotificationChannel(channel); @@ -66,13 +65,13 @@ public class MainActivity extends AppCompatActivity { } //↓通知のやつ - public void notifyMain() { - ((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).vibrate(1000); + public void notifyTest() { + ((Vibrator)getSystemService(Context.VIBRATOR_SERVICE)).vibrate(1000); NotificationCompat.Builder builder = new NotificationCompat .Builder(this, "CHANNEL_ID") .setSmallIcon(android.R.drawable.ic_menu_info_details) - .setContentTitle("通報検知") - .setContentText("子供の置き去りを検知しました。") + .setContentTitle("タイトル") + .setContentText("メッセージ・メッセージ") .setPriority(NotificationCompat.PRIORITY_DEFAULT); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); @@ -91,9 +90,8 @@ public class MainActivity extends AppCompatActivity { } - //Bluetooth_setupの戻るボタン - public void setupBackButton(boolean enableBackButton) { + public void setupBackButton(boolean enableBackButton){ ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(enableBackButton); } diff --git a/app/src/main/res/drawable/a_group_qr_sos.png b/app/src/main/res/drawable/a_group_qr_sos.png new file mode 100644 index 0000000..467ba5f Binary files /dev/null and b/app/src/main/res/drawable/a_group_qr_sos.png differ diff --git a/app/src/main/res/layout/fragment_notification.xml b/app/src/main/res/layout/fragment_notification.xml index 0d4f90d..1146fca 100644 --- a/app/src/main/res/layout/fragment_notification.xml +++ b/app/src/main/res/layout/fragment_notification.xml @@ -6,18 +6,9 @@ tools:context=".NotificationFragment"> - - - - - + android:layout_height="match_parent" + android:text="@string/hello_blank_fragment" /> \ No newline at end of file