Currently, RAW4J does not retain session, which means that it needs a call to Reddit.login() for every instance of the class before any action can be taken. This can lead to a lot of superfluous requests.
The API returns a reddit_session cookie which should be passed in later requests. There is a system-wide cookie handler that should be holding onto this, but it may or may not get destroyed at an arbitrary time by the system.
Different components in an Android application cannot share instances of a class unless it is a singleton.
The session cookie should be accessible as a String which can then be passed to different Reddit instances, perhaps with a restoreSession(String) method.
Currently, RAW4J does not retain session, which means that it needs a call to
Reddit.login()for every instance of the class before any action can be taken. This can lead to a lot of superfluous requests.The API returns a
reddit_sessioncookie which should be passed in later requests. There is a system-wide cookie handler that should be holding onto this, but it may or may not get destroyed at an arbitrary time by the system.Different components in an Android application cannot share instances of a class unless it is a singleton.
The session cookie should be accessible as a
Stringwhich can then be passed to differentRedditinstances, perhaps with arestoreSession(String)method.