{"id":17225427,"url":"https://github.com/rommansabbir/storex","last_synced_at":"2025-04-14T00:53:08.179Z","repository":{"id":40484051,"uuid":"366053162","full_name":"rommansabbir/StoreX","owner":"rommansabbir","description":"✔️ Simplify Caching in Android","archived":false,"fork":false,"pushed_at":"2024-08-19T16:20:32.000Z","size":1163,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T14:55:23.867Z","etag":null,"topics":["aes-encryption","android","async","encryption","kotlin-coroutine","sharedpreferences","storex"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rommansabbir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-10T13:31:42.000Z","updated_at":"2025-02-24T17:02:26.000Z","dependencies_parsed_at":"2024-08-19T18:12:25.608Z","dependency_job_id":"5080234e-b6f3-4357-9a8a-57149bca8978","html_url":"https://github.com/rommansabbir/StoreX","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FStoreX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FStoreX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FStoreX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FStoreX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rommansabbir","download_url":"https://codeload.github.com/rommansabbir/StoreX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804781,"owners_count":21164131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-encryption","android","async","encryption","kotlin-coroutine","sharedpreferences","storex"],"created_at":"2024-10-15T04:13:31.337Z","updated_at":"2025-04-14T00:53:08.153Z","avatar_url":"https://github.com/rommansabbir.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![StoreX](https://github.com/rommansabbir/StoreX/blob/master/art/storex_logo.png)\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://android-arsenal.com/details/1/8362\"\u003e\u003cimg alt=\"Maintained\" src=\"https://img.shields.io/badge/Android%20Arsenal-StoreX-green.svg?style=flat\" height=\"20\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rommansabbir/StoreX\"\u003e\u003cimg alt=\"Maintained\" src=\"https://img.shields.io/badge/Maintained_Actively%3F-Yes-green.svg\" height=\"20\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://jitpack.io/#rommansabbir/StoreX\"\u003e\u003cimg alt=\"JitPack\" src=\"https://img.shields.io/badge/JitPack-Yes-green.svg?style=flat\" height=\"20\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e ⚡ Latest Version: 3.1.1 | Changelog 🔰\u003c/h1\u003e\n\n- Significant changes compared to `v2.1.0`.\n- Encryption is no longer bundled with the library; it's now the developer's responsibility to implement it.\n- `SmartStoreX` is now entirely storage-based (CacheDir/FilesDir/Others), with no reliance on `SharedPref`.\n- Introduced `StoreXSmartConfig` for enhanced configuration with `SmartStoreX`.\n- Added an alternative initializer for `StoreXSmartConfig`.\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n\u003ch1 align=\"center\"\u003eInstallation\u003c/h1\u003e\n\n## Step 1: Add the JitPack repository to your build file\n\n```gradle\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n## Step 2: Add the dependency\n\n```gradle\ndependencies {\n    implementation 'com.github.rommansabbir:StoreX:3.1.1'\n}\n```\n\n## Step 3: Access `SmartStoreX`\n\n### Initialize `SmartStoreXInitializer`:\n\n```kotlin\nclass MyApplication : Application() {\n\n    override fun onCreate() {\n        super.onCreate()\n        SmartStoreXInitializer.init(this)\n        // other initialization code\n    }\n}\n```\n\n### Create an instance of `StoreXSmartConfig`:\n\n```kotlin\nval testConfig = StoreXSmartConfig(\n    context = WeakReference(this) ?: null, // Pass null if SmartStoreXInitializer.init() is called\n    fileName = \"filename\",\n    storeAbleObject = StoreAbleObject(), // Object to be saved, must extend StoreAbleObject.\n    cachingStrategy = StoreXCachingStrategy.CacheDir, // Options: CacheDir, FilesDir, Others\n    overwriteExistingFile = true\n)\n```\n\n### Write an object:\n\n```kotlin\nval isWriteSuccessful = SmartStoreX.getInstance().write(testConfig)\nLog.d(\"Write Object\", isWriteSuccessful.toString())\n```\n\n### Retrieve a stored object:\n\n```kotlin\nval storedObject: StoreAbleObject? = \n    SmartStoreX.getInstance().read(testConfig, StoreAbleObject::class.java)\nLog.d(\"Retrieved Object\", \"Object ID: \" + (storedObject?.objectId ?: \"null\"))\n```\n\n### Delete a stored object:\n\n```kotlin\nval isDeleted = SmartStoreX.getInstance().delete(testConfig)\nLog.d(\"Is Delete Successful\", isDeleted.toString())\n```\n\n### Manage Subscriptions (`Write/Delete`):\n\n#### Register a subscriber:\n\n```kotlin\nSmartStoreX.registerSubscriber(\n    fileName = testConfig.fileName,\n    subscriber = object : StoreXSubscription {\n        override fun \u003cT : StoreAbleObject\u003e onCallback(fileName: String, updatedObject: T) {\n            Log.d(\"Write Callback\", updatedObject.objectId)\n        }\n\n        override fun \u003cT : StoreAbleObject\u003e onDelete(fileName: String, deletedObject: T) {\n            Log.d(\"Delete Callback\", deletedObject.objectId)\n        }\n    }\n)\n```\n\n#### Remove a subscriber:\n\n```kotlin\nSmartStoreX.removeSubscriber(testConfig.fileName)\n```\n\n#### Remove all subscribers:\n\n```kotlin\nSmartStoreX.removeAllSubscribers()\n```\n\n### Supported `StoreAbleObject` Types:\n\n- `StoreAbleString(\"Value\")`\n- `StoreAbleInt(1)`\n- `StoreAbleDouble(1.0)`\n- `StoreAbleLong(1234567890879)`\n- `StoreAbleByte(Byte)`\n- `StoreAbleChar(Char)`\n- `StoreAbleShort(Short)`\n- `StoreAbleArrayList(ArrayList)`\n- `StoreAbleMutableList(MutableList)`\n- `StoreAbleSet(Set)`\n- `StoreAbleMutableSet(MutableSet)`\n- `StoreAbleHashMap(HashMap)`\n- `StoreAbleHashSet(HashSet)`\n\nFor documentation on older versions, please refer to the [previous README](https://github.com/rommansabbir/StoreX/blob/master/README_OLD.md).\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n## Contact\n\n✔ [LinkedIn](https://www.linkedin.com/in/rommansabbir/)\n\n✔ [Website](https://rommansabbir.com)\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n### License\n\n[Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n```html\nCopyright (C) 2023 Romman Sabbir\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frommansabbir%2Fstorex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frommansabbir%2Fstorex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frommansabbir%2Fstorex/lists"}