android - Service in application is getting killed in background -


i have application requires user log in first time , after should maintain status.the application receives data back-end during login process. data used during lifetime of application.
android kills application during low memory conditions. searched , found service solution.so wrote code login in service.therefore, whenever service restarts(after application killed in background), user automatically logged in. , want user credentials. don't want login credentials stored in shared preference or db.
kind of great.

if want send credentials service without using shared preferences or db can send them when start service. when create intent used start service can use method putextra(name, value) if want send credentials service. (edit) when service gets destroyed have save credentials somewhere. if don't want keep them in shared preferences permanently, can save them example before service gets destroyed, in ondestroy() , remove them preferences after retrieve them in oncreate()


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -