0

I am creating an Android app with several actions. I am using Volley to access a REST service to get data from a server.

Some of the data will be used across several actions, so there needs to be a central way of keeping the data objects (e.g. User).

Is there a pattern for Android to do so? Where would I put the model within the app structure and how would I access it from all actions?

Onestone
  • 609
  • 2
  • 10
  • 23

1 Answers1

0

You can create global variables inside Application class Refer this :https://stackoverflow.com/a/1945297/3303075 you can create own model class variable like "User" in-place of String and can be used throughout the app.

Community
  • 1
  • 1
Nilay Dani
  • 896
  • 6
  • 24