Is Android Native Redux a good pratice?

Is Android Native Redux a good pratice?



Is there any existing Android component library which I can use to store state(single source of truth) across app activities or fragment?


Android component library



Currently I extending Application to store these data, but I found it not efficient:


public class AppState extends Application
private int name;

public int getName()
return name;


public void setName(int name)
this.name = name;




With this I can save and retrieve state across the application.



What do you think about this solution? I am using Android Architecture components in the app too.


Android Architecture components



I am planing to use something similar like Redux in Android Native app, is it a good practice?


Redux



Content provider?






It is impossible to reliably store state across Activities, unless you attempt to restore it in a BaseActivity yourself on start-up, but no libraries does that for you at this time afaik.

– EpicPandaForce
Sep 17 '18 at 1:17


BaseActivity






Redux is a good approach in general to be able to build something predictable and easier to maintain. Android generally doesn't have a one solution fits all approach to the architecture, there are MVP, MVVM, and many more. You cannot get many resources about using redux in Android though. Most common in handling state is through dagger's Component and Module implementations.

– Jojo Narte
Sep 17 '18 at 1:17



dagger




1 Answer
1



I think a good library to keep the status of your application can be Eiffel. It is not well known but it has good support.



Thanks for contributing an answer to Stack Overflow!



But avoid …



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Popular posts from this blog

Malaysia to Papua New Guinea by motorcycle?

.name

List of Bhojpuri films