我得到這個作爲我的服務器response.And我想存儲所有設備,以便用戶的會話必須創建並存儲在設備上,以便進一步登錄到應用程序不需要。如果用戶註銷應用程序,則該數據必須被刪除。 我卡在這裏....請告訴我一種方法來解決這個問題。保存服務器響應本地在Android設備
03-20 13:18:56.486 20338-20537/? D/Null: Params :{data[User][password]=pfrt1fKLkoZhAT6hoMJFiA==
, data[User][email]=RyUMRBg7UyeIlFBBtNemZFuG46PJtAIdiZWXnlJ4zNI=
}
03-20 13:18:56.609 20338-20338/? D/Null: Reponse Check :{"code":200,"user":{"User":{"id":"ui1bJkK19jxbaquTboA2oQ==","email":"RyUMRBg7UyeIlFBBtNemZFuG46PJtAIdiZWXnlJ4zNI=","status":"1","verified":"1","created":"2016-03-07 11:41:59","modified":"2016-04-07 15:43:43","token":"6b987332b77d7c69d76bf7be80a85177fb7fa08d"},"Profile":{"id":"1","first_name":"Pradeep","last_name":"Gupta","bio":"sfafaf","address":"82, Debinibash Road\r\nDum Dum, P.O. - Motijheel","phone":"+913325505055","profile_pic":"\/img\/356a192b7913b04c54574d18c28d46e6395428ab\/license.jpg","user_id":"1","Contributor":{"id":"31","profile_id":"1","status":"1","vs_cdn_id":"261961777","secret_token":"s-7Va5z","uploaded_on":null,"statement":"AOK KJDHKJDH bkgkg kkhkjh kjhkj kjh kjhkjh","time":"7 hours per month","created":"2016-05-02 18:40:11","modified":"2016-05-02 18:41:29"},"Moderator":[]},"redirect":"\/"}}
03-20 13:18:56.695 20338-20338/? D/Null: Object Check :ModelObject{code='200', id='null', email='null', first_name='null', last_name='null'}
03-20 13:18:56.695 20338-20338/? D/Null: Object Check :class com.example.user.myapplication.ModelObject
根據要存儲的數據量使用「Realm」或「SharedPreferences」 –