Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Migrate SharedPreferences to DataStore #1178

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

feat: Migrate SharedPreferences to DataStore #1178

wants to merge 1 commit into from

Conversation

Rohit-2602
Copy link

Description

Fixes #1177

Type of Change:

  • Code

Code/Quality Assurance Only

  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

I make the changes and try running this app on my device, but I got a 401 Authentication error on 1st run only. After that app runs fine as it should be.

screen.mp4

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • Any dependent changes have been merged
  • I have written Kotlin Docs whenever is applicable

Code/Quality Assurance Only

  • My changes generate no new warnings
  • My PR currently breaks something (fix or feature that would cause existing functionality to not work as expected)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been published in downstream modules

@vj-codes vj-codes requested a review from epicadk November 23, 2021 19:35
@vj-codes vj-codes added the Status: Needs Review PR needs an additional review or a maintainer's review. label Nov 23, 2021
}

implementation(Dependencies.datastore)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a blank line or just run spotless using gradlew sA

@@ -28,6 +28,7 @@ object Versions {
const val appCompat = "1.0.2"
const val circleImageView = "3.0.1"
const val fragmentKtx = "1.2.5"
const val datastore = "1.0.0-alpha02"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version 1.0.0 is stable


private val dataStorePreferences = context.createDataStore(APPLICATION_PREFERENCE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add encryption ?

@Rohit-2602
Copy link
Author

@epicadk I am getting build error. Can you please help? I just update the DataStore version but it is showing this error

The minCompileSdk (30) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-28).
Dependency: androidx.datastore:datastore-preferences:1.0.0.
AAR metadata file: W:\Android Gradle\caches\transforms-3\3298931b4e39777ba18ae456fda6204c\transformed\jetified-datastore-preferences-1.0.0\META-INF\com\android\build\gradle\aar-metadata.properties.

if I update the compileSDKVersion then it is showing random errors.

@epicadk
Copy link
Member

epicadk commented Nov 26, 2021

@epicadk I am getting build error. Can you please help? I just update the DataStore version but it is showing this error

The minCompileSdk (30) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-28).
Dependency: androidx.datastore:datastore-preferences:1.0.0.
AAR metadata file: W:\Android Gradle\caches\transforms-3\3298931b4e39777ba18ae456fda6204c\transformed\jetified-datastore-preferences-1.0.0\META-INF\com\android\build\gradle\aar-metadata.properties.

if I update the compileSDKVersion then it is showing random errors.

bump compile sdk to 30

@Rohit-2602
Copy link
Author

@epicadk #1180
sorry for creating new PR, I was having some problem with the project in my Android Studio so I have to refork the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review PR needs an additional review or a maintainer's review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Migrate SharedPreferences to DataStore
3 participants