diff --git a/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java b/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java index 39700eb..2f7159c 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java @@ -7,6 +7,7 @@ private String token = null; private String uid = null; private String password=null; + private String name = null; private String latitude=null; private String longitude=null; @@ -40,6 +41,21 @@ return password; } + public void setName(String name) { + SharedPreferences prefData = getSharedPreferences("pref_data", MODE_PRIVATE); + SharedPreferences.Editor editor = prefData.edit(); + editor.putString("name", name); + editor.commit(); + } + + public String getName() { + if(name == null){ + SharedPreferences prefData = getSharedPreferences("pref_data", MODE_PRIVATE); + name = prefData.getString("name", ""); + } + return name; + } + public void setToken(String token) { SharedPreferences prefData = getSharedPreferences("pref_data", MODE_PRIVATE); SharedPreferences.Editor editor = prefData.edit();