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 6aa4ab8..2b06546 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/Amaryllis.java @@ -8,6 +8,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; @@ -41,6 +42,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();