diff --git a/app/build.gradle b/app/build.gradle
index f34f8ff..feb7b35 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -35,4 +35,6 @@
//cropView
api 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation project(path: ':dynamicgrid')
+ //Gson
+ implementation 'com.google.code.gson:gson:2.2.4'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 27624e1..00f2e1e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -75,16 +75,23 @@
android:name=".views.GroupListActivity"
android:label="グループ一覧"
android:theme="@style/AppTheme.NoActionBar" />
-
+
-
+
+
+
+
+
+
+
+
@@ -93,6 +100,4 @@
-
-
\ No newline at end of file
diff --git a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java
index 08f8cc6..9a9a4eb 100644
--- a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java
+++ b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java
@@ -7,6 +7,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
@@ -15,11 +16,16 @@
import android.support.v4.content.ContextCompat;
import android.util.Log;
+import com.example.cosmosclient.entities.Area;
import com.example.cosmosclient.entities.AreaInformation;
+import com.example.cosmosclient.entities.CachePref;
import com.example.cosmosclient.entities.Group;
import com.example.cosmosclient.services.CosmosBackgroundService;
import com.example.cosmosclient.views.RequestPermissionsActivity;
+import com.example.cosmosclient.entities.ObjectStorage;
+import com.google.gson.Gson;
+
import android.content.SharedPreferences;
import android.view.Gravity;
import android.widget.Toast;
@@ -38,6 +44,7 @@
private ArrayList areaInfoKey= new ArrayList<>();
private static final int REQUEST_MULTI_PERMISSIONS = 101;
ArrayList reqPermissions = new ArrayList<>();
+ private Area theWorld = new Area();
public Cosmos() {
super();
@@ -241,11 +248,22 @@
return areaInfo.get(areaId);
}
+
public ArrayList AreaInfoGetKey(){
- for(int key : areaInfo.keySet()){
- areaInfoKey.add(key);
+ SharedPreferences pref = getSharedPreferences("pref",MODE_PRIVATE);
+ Gson gson = new Gson();
+ theWorld = gson.fromJson(pref.getString("Area",""),Area.class);
+ if(theWorld != null) {
+ this.areaInfo = this.theWorld.getAreaInfo();
+ this.areaInfoKey.clear();
+ for (int key : areaInfo.keySet()) {
+ areaInfoKey.add(key);
+ }
+ return areaInfoKey;
+ }else{
+ theWorld =new Area();
+ return new ArrayList<>();
}
- return areaInfoKey;
}
// 位置情報許可の確認、外部ストレージのPermissionにも対応できるようにしておく
diff --git a/app/src/main/java/com/example/cosmosclient/entities/Area.java b/app/src/main/java/com/example/cosmosclient/entities/Area.java
new file mode 100644
index 0000000..2460f5f
--- /dev/null
+++ b/app/src/main/java/com/example/cosmosclient/entities/Area.java
@@ -0,0 +1,15 @@
+package com.example.cosmosclient.entities;
+
+import java.util.HashMap;
+
+public class Area {
+ private HashMap areaInfo = new HashMap<>();
+
+ public void setAreaInfo(HashMap areaInfo) {
+ this.areaInfo = areaInfo;
+ }
+
+ public HashMap getAreaInfo() {
+ return areaInfo;
+ }
+}
diff --git a/app/src/main/java/com/example/cosmosclient/entities/AreaInformation.java b/app/src/main/java/com/example/cosmosclient/entities/AreaInformation.java
index 3dc2816..635eeb6 100644
--- a/app/src/main/java/com/example/cosmosclient/entities/AreaInformation.java
+++ b/app/src/main/java/com/example/cosmosclient/entities/AreaInformation.java
@@ -19,6 +19,9 @@
public void setFeature(HashMap> feature) {
this.feature = feature;
}
+ public void setFeature(int code,ArrayList feature){
+ this.feature.put(code,feature);
+ }
public HashMap> getFeature() {
return feature;
}
diff --git a/app/src/main/java/com/example/cosmosclient/entities/CachePref.java b/app/src/main/java/com/example/cosmosclient/entities/CachePref.java
new file mode 100644
index 0000000..17b717d
--- /dev/null
+++ b/app/src/main/java/com/example/cosmosclient/entities/CachePref.java
@@ -0,0 +1,20 @@
+package com.example.cosmosclient.entities;
+
+import android.content.SharedPreferences;
+
+import com.google.gson.Gson;
+
+public class CachePref {
+ private final static String RPEF_NAME = "cache";
+ private SharedPreferences pref;
+ private SharedPreferences.Editor editor;
+
+ public static final String KEY_AREA_INFO = "AreaInfo";
+
+ public String get(String key, String defaultValue) {
+ return pref.getString(key, defaultValue);
+ }
+ public void put(String key, String value) {
+ editor.putString(key, value).commit();
+ }
+}
diff --git a/app/src/main/java/com/example/cosmosclient/entities/CosmosLocation.java b/app/src/main/java/com/example/cosmosclient/entities/CosmosLocation.java
index a13d9db..bec955a 100644
--- a/app/src/main/java/com/example/cosmosclient/entities/CosmosLocation.java
+++ b/app/src/main/java/com/example/cosmosclient/entities/CosmosLocation.java
@@ -19,6 +19,6 @@
}
public int hashCode(){
- return (int)((latitude+90)/0.1)+(int)((longitude/0.1)*1800);
+ return (int)((latitude+90)/0.1)+((int)(longitude/0.1)*1800);
}
}
diff --git a/app/src/main/java/com/example/cosmosclient/entities/ObjectStorage.java b/app/src/main/java/com/example/cosmosclient/entities/ObjectStorage.java
new file mode 100644
index 0000000..4e3226d
--- /dev/null
+++ b/app/src/main/java/com/example/cosmosclient/entities/ObjectStorage.java
@@ -0,0 +1,18 @@
+package com.example.cosmosclient.entities;
+
+import com.google.gson.Gson;
+
+public class ObjectStorage {
+ public static void save(Object src, String key) {
+ String json = new Gson().toJson(src);
+ new CachePref().put(key, json);
+ }
+
+ public static T get(String key, Class klazz) {
+ String jsonStr = new CachePref().get(key, "");
+ if (jsonStr.equals("")) {
+ return null;
+ }
+ return new Gson().fromJson(jsonStr, klazz);
+ }
+}
diff --git a/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java b/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java
index 74be9d2..36da15b 100644
--- a/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java
+++ b/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java
@@ -25,6 +25,7 @@
import com.example.cosmosclient.R;
import com.example.cosmosclient.app.Cosmos;
+import com.example.cosmosclient.entities.AreaInformation;
import com.example.cosmosclient.entities.CosmosLocation;
import com.example.cosmosclient.entities.Feature;
import com.example.cosmosclient.entities.Group;
@@ -38,12 +39,14 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.TimeZone;
import java.util.Timer;
import java.util.TimerTask;
+import java.util.UUID;
import retrofit2.Call;
import retrofit2.Callback;
@@ -51,6 +54,8 @@
import retrofit2.Retrofit;
import retrofit2.converter.jackson.JacksonConverterFactory;
+import static android.app.Notification.EXTRA_NOTIFICATION_ID;
+
public class CosmosBackgroundService extends IntentService implements LocationListener {
private Context context;
@@ -63,6 +68,14 @@
private CosmosLocation LOC = new CosmosLocation();
private double leftLat,leftLon,rightLat,rightLon; //ここに計算予定
private int count = 0;
+ private int areacount = 0;
+ private ArrayList Electrical = new ArrayList<>();
+ private ArrayList Home = new ArrayList<>();
+ private ArrayList Phone = new ArrayList<>();
+ private ArrayList PC = new ArrayList<>();
+ private ArrayList Convenience = new ArrayList<>();
+ private ArrayList Supermarket = new ArrayList<>();
+ private AreaInformation areaInfo = null;
private NotificationManager notificationManager;
public CosmosBackgroundService() {
@@ -246,36 +259,51 @@
}
@Override
- public void onLocationChanged(Location location) {
+ public void onLocationChanged(final Location location) {
final Cosmos cosmos = (Cosmos) getApplication();
// Log.d(TAG, "onLocationChanged");
Log.d(TAG, "lat:" + location.getLatitude());
Log.d(TAG, "lon:" + location.getLongitude());
- updateAreaInformation(location);
- this.notifications=searchNotifications(cosmos,location);
- sendNotifications(this, notifications);
+ new Thread(new Runnable() {
+ private List notifications;
+ public void run() {
+ updateAreaInformation(location);
+ this.notifications=searchNotifications(cosmos,location);
+ sendNotifications(CosmosBackgroundService.this, notifications);
+ }
+ }).start();
}
private void sendNotifications(CosmosBackgroundService cosmosBackgroundService, List notifications) {
- int notificationId = 1;
-// MainActivity→broadcastreseiver(?)に変更
-// Intent intent = new Intent(cosmosBackgroundService, MainActivity.class);
-// 以下二行はボタンについてだよ
-// PendingIntent pendingIntent = PendingIntent.getActivity(cosmosBackgroundService, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
-// android.app.Notification.Action action = new android.app.Notification.Action(R.drawable.notification_icon, "ボタンだよ", pendingIntent);
+ for (Notification notify: notifications) {
- android.app.Notification notification = new android.app.Notification.Builder(cosmosBackgroundService)
- .setContentTitle("通知タイトル")
- .setContentText("通知ないよう")
- .setSmallIcon(R.drawable.icon_no)
- .setChannelId("cosmos")
+ int notificationId = 1;
+ //以下はボタンについてだよ
+ Intent intent = new Intent(cosmosBackgroundService, NotificationDone.class);
+ //snoozeIntent.setAction(ACTION_NOTIFICATION_OFF);
+ intent.putExtra(EXTRA_NOTIFICATION_ID, 0);
+ //以下2行はテスト用。本来はNotificationから取ってくる。
+ intent.putExtra("gId", notify.getGroup().getgId());
+ intent.putExtra("rId", notify.getRequest().getrId());
+ int randamCode = (int)(Math.random()*100000);
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(cosmosBackgroundService, randamCode, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+
+ android.app.Notification.Action action = new android.app.Notification.Action(R.drawable.notification_icon, "ボタンだよ", pendingIntent);
+ android.app.Notification notification = new android.app.Notification.Builder(cosmosBackgroundService)
+ .setContentTitle(notify.getRequest().getProduct())
+ .setContentText("通知ないよう")
+ .setSmallIcon(R.drawable.icon_no)
+ .setChannelId("cosmos")
// .setGroup("")
-// .addAction(action)
- .build();
- notificationManager.notify(notificationId, notification);
+ .addAction(action)
+ .build();
+ notificationManager.notify(notificationId, notification);
+ }
+
+
}
@Override
@@ -386,14 +414,16 @@
startActivity(settingsIntent);
}
- private void updateAreaInformation(Location location) {
+ private void updateAreaInformation(final Location location){
Cosmos app = (Cosmos) getApplication();
count = 0;
LOC.setLatitude(location.getLatitude());
LOC.setLongitude(location.getLongitude());
- for (int i = 0; i < app.AreaInfoGetKey().size(); i++) {
- if (LOC.hashCode() != app.AreaInfoGetKey().get(i)) {
- count++;
+ if(app.AreaInfoGetKey().size() != 0) {
+ for (int i = 0; i < app.AreaInfoGetKey().size(); i++) {
+ if (LOC.hashCode() != app.AreaInfoGetKey().get(i)) {
+ count++;
+ }
}
}
if (count == 0) {
@@ -415,33 +445,115 @@
Call> call = LocationService.LocationService(String.valueOf(leftLat),
String.valueOf(leftLon), String.valueOf(rightLat), String.valueOf(rightLon));
- //サーバからデータ受け取り
- call.enqueue(new Callback>() {
- //成功時
- @Override
- public void onResponse(Call> call, Response> response) {
- if (response.isSuccessful()) {
- ArrayList result = response.body();
-
- //app/Cosmosに情報保存
- Cosmos app = (Cosmos) getApplication();
-// app.setAreaInfo();
-
- } else {
- //onFailureでキャッチできないエラー用
- Toast.makeText(CosmosBackgroundService.this,
- "通信エラー", Toast.LENGTH_LONG).show();
+ Response> areaInformationResponse;
+ try{
+ areaInformationResponse = call.execute();
+ if (areaInformationResponse.isSuccessful()) {
+ areaInfo = new AreaInformation();
+ ArrayList result = areaInformationResponse.body();
+ for(int i = 0; i < result.size(); i++){
+ switch (result.get(i).getCode()) {
+ case 203001:
+ Electrical.add(result.get(i));
+ areaInfo.setFeature(Electrical.get(0).getCode(),Electrical);
+ break;
+ case 203002:
+ Home.add(result.get(i));
+ areaInfo.setFeature(Home.get(0).getCode(),Home);
+ break;
+ case 203003:
+ Phone.add(result.get(i));
+ areaInfo.setFeature(Phone.get(0).getCode(),Phone);
+ break;
+ case 203004:
+ PC.add(result.get(i));
+ areaInfo.setFeature(PC.get(0).getCode(),PC);
+ break;
+ case 205001:
+ Convenience.add(result.get(i));
+ areaInfo.setFeature(Convenience.get(0).getCode(),Convenience);
+ break;
+ case 205002:
+ Supermarket.add(result.get(i));
+ areaInfo.setFeature(Supermarket.get(0).getCode(),Supermarket);
+ break;
+ default:
+ continue;
+ }
}
- }
- //失敗時
- @Override
- public void onFailure(Call> call, Throwable t) {
- t.printStackTrace();
+ //app/Cosmosに情報保存
+ app = (Cosmos) getApplication();
+ areaInfo.setLocation(LOC);
+ app.setAreaInfo(areaInfo.getLocation().hashCode(),areaInfo);
+
+ } else {
+ //onFailureでキャッチできないエラー用
Toast.makeText(CosmosBackgroundService.this,
- "区画情報の更新に失敗しました", Toast.LENGTH_SHORT).show();
+ "区画情報取得失敗", Toast.LENGTH_LONG).show();
}
- });
+ }catch (IOException e){
+ e.printStackTrace();
+ Log.d(TAG, "区画情報を取得できていません。");
+ }
+
+ //サーバからデータ受け取り
+// call.enqueue(new Callback>() {
+// //成功時
+// @Override
+// public void onResponse(Call> call, Response> response) {
+// if (response.isSuccessful()) {
+// ArrayList result = response.body();
+// for(int i = 0; i < result.size(); i++){
+// switch (result.get(i).getCode()) {
+// case 203001:
+// Electrical.add(result.get(i));
+// areaInfo.setFeature(Electrical.get(0).getCode(),Electrical);
+// break;
+// case 203002:
+// Home.add(result.get(i));
+// areaInfo.setFeature(Home.get(0).getCode(),Home);
+// break;
+// case 203003:
+// Phone.add(result.get(i));
+// areaInfo.setFeature(Phone.get(0).getCode(),Phone);
+// break;
+// case 203004:
+// PC.add(result.get(i));
+// areaInfo.setFeature(PC.get(0).getCode(),PC);
+// break;
+// case 205001:
+// Convenience.add(result.get(i));
+// areaInfo.setFeature(Convenience.get(0).getCode(),Convenience);
+// break;
+// case 205002:
+// Supermarket.add(result.get(i));
+// areaInfo.setFeature(Supermarket.get(0).getCode(),Supermarket);
+// break;
+// default:
+// continue;
+// }
+// }
+//
+// //app/Cosmosに情報保存
+// Cosmos app = (Cosmos) getApplication();
+// app.setAreaInfo(areaInfo.getLocation().hashCode(),areaInfo);
+//
+// } else {
+// //onFailureでキャッチできないエラー用
+// Toast.makeText(CosmosBackgroundService.this,
+// "区画情報取得失敗", Toast.LENGTH_LONG).show();
+// }
+// }
+//
+// //失敗時
+// @Override
+// public void onFailure(Call> call, Throwable t) {
+// t.printStackTrace();
+// Toast.makeText(CosmosBackgroundService.this,
+// "区画情報の更新に失敗しました", Toast.LENGTH_SHORT).show();
+// }
+// });
}
}
@@ -453,8 +565,7 @@
HashMap> codeToNotification = new HashMap<>();
//業番:feature
HashMap> codeToFeature = new HashMap<>();
- ArrayList groups =(ArrayList) cosmos.getGroups();
-
+ ArrayList groups = new ArrayList<>(cosmos.getGroups());
//現在時刻取得
Date nowDate = new Date();
//codeToNotificationを作成。Featureはnull
@@ -462,9 +573,10 @@
//requestのArrayListを回す
for (int j = 0; j < groups.get(i).getRequestList().getRequests().size(); j++) {
//codeToNotificationに格納するArrayListを初期化
- ArrayList notifications = null;
+ ArrayList notifications = new ArrayList<>();
+ Date deadline = groups.get(i).getRequestList().getRequests().get(j).getDeadline();
//期限内かつ未達成のrequestのみ取得
- if (groups.get(i).getRequestList().getRequests().get(j).getDeadline().after(nowDate) && groups.get(i).getRequestList().getRequests().get(j).isDone() == false) {
+ if (( deadline == null || deadline.after(nowDate))&& groups.get(i).getRequestList().getRequests().get(j).isDone() == false) {
//notificationを作成
Notification notification = new Notification(groups.get(i).getRequestList().getRequests().get(j),groups.get(i),null);
//指定したkey(業番)を持っているHashMapがなければ作成する。
@@ -489,11 +601,11 @@
//HashMapを順番に実行
for(HashMap.Entry> e : codeToFeature.entrySet()) {
//ArrayList>を回していく
- for(int i=e.getValue().size(); i >= 0;i--) {
+ for(int i=e.getValue().size() - 1; i >= 0;i--) {
float[] distance = getDistance(NowLat, NowLon, e.getValue().get(i).getLocation().getLatitude(), e.getValue().get(i).getLocation().getLongitude());
// distance[0] = [2点間の距離]
//50m圏外のFeatureを削除
- if (distance[0] > 50) {
+ if (distance[0] > 1000) {
e.getValue().remove(i);
}
}
diff --git a/app/src/main/java/com/example/cosmosclient/services/NotificationDone.java b/app/src/main/java/com/example/cosmosclient/services/NotificationDone.java
new file mode 100644
index 0000000..fcc18d5
--- /dev/null
+++ b/app/src/main/java/com/example/cosmosclient/services/NotificationDone.java
@@ -0,0 +1,91 @@
+package com.example.cosmosclient.services;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+
+import com.example.cosmosclient.app.Cosmos;
+import com.example.cosmosclient.entities.AddRequestsResponse;
+import com.example.cosmosclient.entities.Group;
+import com.example.cosmosclient.entities.Request;
+import com.example.cosmosclient.resources.GroupsRest;
+
+import java.io.IOException;
+
+import retrofit2.Call;
+import retrofit2.Response;
+import retrofit2.Retrofit;
+import retrofit2.converter.jackson.JacksonConverterFactory;
+
+public class NotificationDone extends BroadcastReceiver {
+ //retrofitの処理
+ final Retrofit retrofit = new Retrofit.Builder()
+ .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/cosmos/rest/")
+ // .baseUrl("http://10.0.2.2:8080/rest/")
+ .addConverterFactory(JacksonConverterFactory.create())
+ .build();
+ //interfaceから実装を取得
+ final GroupsRest requestsService = retrofit.create(GroupsRest.class);
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Cosmos app = (Cosmos) context.getApplicationContext();
+ String gId = intent.getExtras().getString("gId");
+ Request editRequest = app.getGroup(gId).getRequestList().getRequestById(intent.getExtras().getString("rId"));
+ if(gId == null){
+ System.out.println("error");
+ return;
+ }
+ if(editRequest == null){
+ System.out.println("cannot find Request");
+ return;
+ }
+ doneRequest(gId, editRequest);
+ }
+
+ //引数で受け取ったリクエストを達成する
+ public void doneRequest(final String gId, final Request request){
+
+
+ new Thread(new Runnable() {
+ public void run() {
+ String deadline = null;
+ //Date型のフォーマット設定
+ if (request.getDeadline() != null) {
+ deadline = String.format("%d-%02d-%02d %02d:%02d:%02d", request.getDeadline().getYear(), request.getDeadline().getMonth() + 1, request.getDeadline().getDate() + 1, 23, 59, 59);
+ } final Call updateRequestCall = requestsService.updateRequest(gId, request.getrId(), request.getIssuer().getuId(), request.getProduct(), deadline, request.getLocation(), true, "token");
+ Response response;
+ try {
+ response = updateRequestCall.execute();
+ if (response.isSuccessful()) {
+ AddRequestsResponse result = response.body();
+// Toast.makeText(RequestListActivity.this, "RequestListを達成しました", Toast.LENGTH_SHORT).show();
+// requestList.removeRequests(selectedRequestList);
+// handler.post(new Runnable() {
+// @Override
+// public void run() {
+// ResetRequestListTable();
+// AddRequestListTable(requestList);
+// }
+// });
+ } else {
+ // onFailure
+ try {
+ System.out.println(response.errorBody().string());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ //onFailureでキャッチできないエラーの処理
+// Toast.makeText(RequestListActivity.this, "通信エラー", Toast.LENGTH_SHORT).show();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+// Toast.makeText(RequestListActivity.this, "RequestListの達成失敗しました", Toast.LENGTH_SHORT).show();
+
+ }
+ }
+ }).start();
+
+ }
+}
diff --git a/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java b/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java
index 1070a00..ba12736 100644
--- a/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java
+++ b/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java
@@ -12,6 +12,7 @@
import com.example.cosmosclient.R;
import com.example.cosmosclient.app.Cosmos;
+import com.example.cosmosclient.entities.AreaInformation;
import com.example.cosmosclient.entities.SigninResponse;
import com.example.cosmosclient.resources.UsersRest;
diff --git a/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java b/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java
index bafa874..8db61a1 100644
--- a/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java
+++ b/app/src/main/java/com/example/cosmosclient/views/SignupActivity.java
@@ -216,23 +216,23 @@
@Override
public void afterTextChanged(Editable s){
+ final int maxStringLength = 21;
switch(view.getId()) {
case R.id.NameText:
- if (s.length() > 0) {
+ if (0 < s.length() && s.length() < maxStringLength){
nameEnable = true;
- } else {
- nameEnable = false;
+ } else { nameEnable = false;
}
break;
case R.id.PasswordText:
- if(s.length()>0){
+ if(0 < s.length() && s.length() < maxStringLength){
pwEnable=true;
}else{
pwEnable=false;
}
break;
case R.id.ConfirmPasswordText:
- if(s.length()>0){
+ if(0 < s.length() && s.length() < maxStringLength){
cpwEnable=true;
}else{
cpwEnable=false;
diff --git a/app/src/main/res/drawable/notification_icon.png b/app/src/main/res/drawable/notification_icon.png
new file mode 100644
index 0000000..f9a5e8b
--- /dev/null
+++ b/app/src/main/res/drawable/notification_icon.png
Binary files differ
diff --git a/app/src/test/java/com/example/cosmosclient/NotificationDoneTestMain.java b/app/src/test/java/com/example/cosmosclient/NotificationDoneTestMain.java
new file mode 100644
index 0000000..79a5bbe
--- /dev/null
+++ b/app/src/test/java/com/example/cosmosclient/NotificationDoneTestMain.java
@@ -0,0 +1,28 @@
+package com.example.cosmosclient;
+
+import com.example.cosmosclient.entities.Feature;
+import com.example.cosmosclient.entities.Group;
+import com.example.cosmosclient.entities.Request;
+import com.example.cosmosclient.entities.UserJsonforRequests;
+import com.example.cosmosclient.services.Notification;
+import com.example.cosmosclient.services.NotificationDone;
+
+import java.util.Date;
+import java.util.List;
+
+public class NotificationDoneTestMain {
+ public static void main(String[] args) {
+ //以下の変数は、変更したいリクエストに合わせて変更する必要があります。
+ String rid = "a87c2716-0174-40bc-bb41-a1ce8b6009bb";
+ String rUri = "http://nitta-lab-www.is.konan-u.ac.jp/cosmos/rset/groups/909221c1-c343-405e-8b39-f0dbed60e48b/requests/a87c2716-0174-40bc-bb41-a1ce8b6009bb";
+ String product = "mimiz";
+ int location = 20501;
+ String gid = "909221c1-c343-405e-8b39-f0dbed60e48b";
+ String issuerUid = "d3c73732-1287-4fa4-bb74-c9342be81fde";
+
+ NotificationDone notificationDone = new NotificationDone();
+// Notification notification = new Notification(new Request(rid, rUri, product, new Date(), new Date(), location, "name", false), new Group(gid, "uri", "name", "uId"), null);
+ Request request = new Request(rid, rUri, product, new Date(), new Date(), location, "name", true);
+ notificationDone.doneRequest(gid, request);
+ }
+}
\ No newline at end of file