# Holding application state

**URL:** <https://community.homey.app/t/holding-application-state/45321>\
**Category:** Questions & Help\
**Created:** [March 27, 2021, 5:43pm UTC](https://community.homey.app/t/holding-application-state/45321 "2021-03-27T17:43:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henit](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henit/32/27054_2.png) [@henit](https://community.homey.app/u/henit)\
**Post date:** [March 27, 2021, 5:43pm UTC](https://community.homey.app/t/holding-application-state/45321/1 "2021-03-27T17:43:55Z")

</div>

If I want a device to keep a state that will be used and updated while running (hold status variables etc), I see this can be done in different ways. The “store” can be used (this.getStoreValue, this.setStoreValue etc in a Device class), I have also seen apps using the ManagerSettings.set / ManagerSettings.get for this as well, maybe there is other places to store application state as well?

Since the documentation does not say very much about the different choices other than listing the technical details, can anyone explain what these different options is supposed to be used for? And which of them remember even when the app shuts down/restarts, which of them is fastest (to avoid slow logic when it includes updating the state).

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 27, 2021, 6:47pm UTC](https://community.homey.app/t/holding-application-state/45321/2 "2021-03-27T18:47:06Z")

</div>

The per-device settings (`Device#getSettings()/Device#setSettings()`) are meant for per device, _user configurable_, configuration data. You can create a configuration page that uses them from `app.json`, as explained [here](https://developer.athom.com/docs/apps/tutorial-Drivers-Settings.html).

The per-device store (`Device#getStoreValue()/Device#setStoreValue()`) is meant for per device, _internal-use_ configuration data.

For instance: say that your device has to be accessed through an IP-address. That’s a per-device _setting_, because the user should be able to change it. Say that you also want to store the current firmware version of the device for some reason. That’s something internal to your app, not meant for users, so you would use the store for that.

`ManagerSettings` (or `this.homey.settings` in SDKv3) is used for per-application settings. You have to create a custom settings page for them [as explained here](https://developer.athom.com/docs/apps/tutorial-App%20Settings.html).

For example: your app uses a cloud service that requires user credentials to log in. Those credentials are stored in the per-app settings.

I don’t think there’s much of a performance difference between any of the methods, and all of these will survive an app (or Homey) restart.
