Questions tagged [sharedpreferences]
SharedPreferences allows you to save and retrieve persistent key-value pairs of primitive data types in Android applications. It can be used either inside a single app or shared between multiple apps.
7,715
questions
0
votes
0
answers
42
views
how to decrypt EncryptedSharedPreferences on a rooted device?
I have exported EncryptedSharedPreferences from the app, here is the content:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="...
1
vote
2
answers
37
views
How to save a response data into sharedPreference in flutter
I want to save the user details response in sharedPreference so that user can resume the app anytime as long as he/she doesn't log out but this keeps on returning null when I tried to retrieved the ...
0
votes
2
answers
41
views
Any idea why Android Kotlin SharedPreferences is crashing my app?
I try to save a key-value pair persistently by use of shared preferences in Android Kotlin.
When putting the object initialisation into my mainActivity-Class and run it in debug mode on my phone the ...
1
vote
2
answers
43
views
sharedPreferences doesn't work in Android (Kotlin)
There is an edittext in this application, and the purpose of this application is that when the user writes text or anything String in the edittext, after the user closes the application and reopens it,...
2
votes
0
answers
33
views
Could not find a file named "pubspec.yaml" in "/Users/rioland/.pub-cache/hosted/pub.dev/win32-5.1.0"
this is the error am getting when ever i run pub.yaml
i thing the error is coming from sharepreference
Could not find a file named "pubspec.yaml" in "/Users/rioland/.pub-cache/hosted/...
0
votes
0
answers
14
views
Shared preference FormatExeption: Unexpected character (at character 1). in. Flutter Desctop
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected character (at character 1)
After deleteting chared preference in my app, it is working fine,
...
0
votes
0
answers
33
views
SharedPreference not creating file in Device File Explorer location
I am creating a login activity using firebase mobile authentication. After successful authentication I get success
callback from firebase.
After getting successful callback response, I am saving login ...
0
votes
0
answers
55
views
Parsing JSON file and store it fast
I'm developing an Android App.
When the app is open, it starts the new fragment with Recycler View.
All data for Recycler View is in a folder (user-choosen).
When the fragment starts, it list all ...
0
votes
0
answers
30
views
Can't Access DataStore Android
I build an Android app and currently working on the user authentication. When the app was installed and launched for the first time, I want to check if there is a user token available on the datastore ...
0
votes
0
answers
41
views
No implementation found for method getAll on channel plugins.flutter.io/shared_preferences
Facing an exception on my flutter app.
The app runs fine on android OS, but throws and exception when trying to run on IOS.
The app runs perfectly on android.
Facing this issue on the splash screen ...
-1
votes
0
answers
42
views
Redirect the already logged in user to the homepage with his credentials without authenticating again
I'm working with APIs and it's new to me, I'm getting the user information from an API wants to redirect the user to the homepage and show his credentials without doing the authentication flow again ...
0
votes
0
answers
43
views
Save data from API to local and Fetch that in flutter
I want to login with API JWT on loginpage.dart, save data local from bearer token and fetch data from API from loginpage.dart to homepage.dart
How can I fetch (name) from JWT to (Your Name), and (...
1
vote
1
answer
26
views
TinyDB problem, cannot resolve symbol 'context'
I want to use TinyDB in my Android app that built in Android Studio. To use the TinyDB, I need to add TinyDB class and write the context.
The context that need to be in the MainActivity:
TinyDB tinydb ...
0
votes
0
answers
30
views
Remove local database after uninstalling flutter desctop app in drift(before moor)
I am using drift package for my local database in Flutter Desctop project, and I am not be able to remove the local database after uninstalling the app.
Data still exist there, I see also shared ...
0
votes
2
answers
37
views
When I'm trying to make register with API and getx this error appears I'm also using sharedprefrence to make a splashscreen
I'm currently working on a Flutter app for user login and registration, and I'm using the GetX state management library and API for this purpose. However, I'm encountering an error, and I'm seeking ...
0
votes
1
answer
35
views
I want to make toggle between two screen by get of Sharedprefrences in flutter
I have a Flutter application where I want to toggle between two screens based on a value stored in the Shared Preferences. I am using the Cubit package for state management. Currently, the app always ...
0
votes
1
answer
29
views
I am trying to be back to same screen once I remove the app from the recents but it always takes me back to signup screen even when I have signedIn
Unable to get the user back to last screen if looged in and once the app is removed from the background using shared preferences and provider for two separate conatiner's tap and based on that tap ...
0
votes
1
answer
41
views
The boolean values in shared preferences doesn't reflect on UI Flutter
I'm working on a todo app where two of the functions are mark and unmark the todo item as done. It works normally onPressed and the isDone value is saved in shared preferences too, but when i reopen ...
1
vote
1
answer
54
views
The data from SharedPreferences doesn't update unless I scroll down the RecyclerView Android Kotlin
The problem is that when I click the "Add to Favorites" button for the first time, the image changes and the data is saved to SharedPreferences. However, when I click the same button again, ...
1
vote
0
answers
51
views
SharedPreferences changes triggers FileObserver's create event every time
I have implemented a custom class which extends FileObserver class and I am listening for the events in the shared_prefs directory of my app's internal storage. The problem is every time I perform the ...
0
votes
1
answer
39
views
How to change the initial Route using SharedPreferences?
When the user logs in, the following code is executed.
login() async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool('loggedIn', true);
}
And I want ...
0
votes
0
answers
28
views
Issue fetching data from DataStore, but using Shared preferences everything works
My problem is that when using DataStore, the data is saved correctly and updated correctly every time, but it is read incorrectly. ( I open applicationB from applicationA and I am passing data with ...
0
votes
0
answers
47
views
why am i getting nosuchmethod exception when i inject an object to my viewmodel that i have clearly provided in my dagger hilt module
any help will be greatly appreciated as I have been on this for days now.
this is the error message;
Caused by: java.lang.NoSuchMethodException: com.example.funditech.presentation.navigationDrawer....
1
vote
0
answers
39
views
Caused by android.security.KeyStoreException: Memory allocation failed
private var masterKey = MasterKey.Builder(applicationContext)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build()
var sharedPreferences: SharedPreferences = ...
0
votes
0
answers
38
views
How to use firebase only for signed in users
I want to create a basic app for android with firebase. For better user experience I want the users to be able to use the app without signing in. In this case, the user data should be stored only ...
0
votes
0
answers
24
views
Only the First Record is Displayed When Retrieving from SharedPreferences
"I have multiple records in Shared Preferences, and I've created a table using the Table class. My goal is to display these records in a table format with name, email, and score, but the code is ...
0
votes
1
answer
36
views
Displaying Data in a Table with Shared Preferences Issue
"I have one record in Shared Preferences, and I've created a table using the Table class. My goal is to display these records in a table format with name, email, and score, but the code is not ...
0
votes
0
answers
15
views
Is there a way to set global preference file for PreferenceManager
I'm using Android PreferenceFragment for a multi-screen preference solution.
I need to have custom preference files because I have per-user settings and need them in different files.
Previously, I had ...
0
votes
1
answer
118
views
Error Cannot invoke "String.isEmpty()" because "parent.path" is null for mockk kotlin datastore functions
I am writing a Test class using mockk framework of koltin for data store. The class looks like
`open class MyStorageClass(context: Context) : Storage {
private val testDataStore = context....
0
votes
2
answers
19
views
Save the submit of terms&conditions as a preference in Android studio?
I'm trying to implement a "Terms & Conditions" screen for an app that pops up when the user opens the app for the first time. When they accept the terms and conditions, they continue to ...
0
votes
1
answer
61
views
How can I get red of this error: LateInitializationError: Field 'currentPage' has not been initialized
I am using late int currentPage; to keep the last page the reader was in. The value of this value is read from shared perefernces through the _loadIndex() method to get the reader back to the last ...
0
votes
0
answers
34
views
How to save theme prefrence using sharedPrefrence in kotlin
So, I'am trying to change the theme of the app using a switch and save the theme prefrence using sharedPrefrence though I have somehow manage to make it work but there are some problems.
`override fun ...
0
votes
0
answers
102
views
How to store JSON API into SharedPreferences Flutter and make app can validate and load from SharedPreferences data first
This is my code, I want to store JSON API into SharedPreferences and validate if SharedPreferences doesn't have my JSON API data or has different data from request API and that SharedPreferences data ...
0
votes
0
answers
17
views
I can not refer to the SharedPreferences from DDL when first install
I have finished implementing Deferred deep linking in my android app. But during the first install, app cannot get getSharedPreferences in the Activity. Even though the shared_pref file already exists....
0
votes
0
answers
19
views
How to save preference of Slide_to_act button in flutter for check in and check out
In my code i have created an slider button from slide_to_act lib,
when user press on slide to check in button , the button fetch and update the check in api .
It does the same for Check out button .
...
1
vote
0
answers
22
views
Android MeasureUnit to Proto Datastore
I want to save a value to datastore with MeasureUnit type.
I know it is not possible but for better explain here is what I want to:
message Pref {
MeasureUnit unit = 1
}
and set like:
pref....
0
votes
1
answer
54
views
Flutter SharedPreferences Error on iOS and macOS
I am trying to run my Flutter application via Xcode and I keep getting the error
Warning: Unable to create restoration in progress marker file (11db)
It seems to happen on line 18 of the file '...
0
votes
1
answer
27
views
App in Android Studio keeps crashing upon clicking submit when trying to share data using Intent and onClickListener
The app is a general profile app to get familiar with the program since this is my first time using it and I don't have much experience with Java. The main activity has two radio buttons, a radio ...
0
votes
1
answer
43
views
Replacing Shared Preferences with Room Database - but data not persisting
I'm self taught so forgive me if I'm missing some basic knowledge. Based on some errors I'm receiving via the Google Play Console and subsequent reading, the understanding I have now is that shared ...
0
votes
2
answers
33
views
Flutter Always showing True Conditoinal Widget at inital create
I am the beginner of Flutter. Recently stuck in creating widget.
Here is my condition. I use SharedPreferences getting Boolean value at first then create widget. However, my widget always show in TRUE ...
0
votes
0
answers
38
views
LiveData is null always when get from Flow of preferencesDataStore - android
I am using from preferencesDataStore like bellow:
val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = PREFERENCES_NAME)
class DataStoreOperationsImpl(context: Context) : ...
0
votes
0
answers
17
views
Flutter Pixel 7 SharedPreferences
Good afternoon and thank you in advance. I'm starting a project in Flutter, Pixel 6, with Api 33 it works great, but in Api 33 it doesn't read the file created with Shared properly.... if I query data,...
3
votes
1
answer
453
views
Android, UMP, how to know if the user did not consent?
Android, UMP always returns "OBTAINED" even if the user did not consent or if the user dismissed the form.
So it's very hard to do anything with it. I want to know if the user did not ...
0
votes
2
answers
66
views
When I add shared_preferences dependency in pubspec.yaml my project doesn't run
when I add Shared_Preferences dependency my project doesn't run
Version : last version 2.2.0
This is the error message:
FAILURE: Build failed with an exception.
What went wrong: A problem occurred ...
0
votes
1
answer
64
views
How to put an init value into preference data store in android Kotlin
I want to save user settings into preference data store.
Here is my code
class SettingsRepository {
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "...
0
votes
1
answer
78
views
Flutter: How to keep user logged-in even when app is closed using Firebase Auth
I'm using Firebase Auth in my Flutter App. User is authenticated and logged in using 'Auth' but when app is closed/cleared from mobile memory, the user is automatically signed out.
How can I keep the ...
0
votes
1
answer
127
views
Flutter "Execution failed for task ':shared_preferences_android:parseDebugLocalResources'" failed debug
I am developing an android app and when I install the SharedPreferences package (and not even using) and try to debug the application on the chrome, it runs normally, but when I debug it on my device (...
0
votes
0
answers
42
views
shared dependencies in flutter not working properly. Data is not persisting
I've a provided 3 files here and my main.dart file. So the thing is, I want to persist the data on the HomePageScreen.dart even when I rerun the app or when I restart the app.
Here's my main.dart() ...
0
votes
0
answers
64
views
When I add shared_preferences dependency my project doesn't run
when I add Shared_Preferences dependency my project doesn't run
Version : last version 2.2.0
This is the error message:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred ...
0
votes
1
answer
29
views
error: org-dartlang-debug:synthetic_debug_expression:1:1: Error: Undefined name 'data'. data is List (while debugging)
error: org-dartlang-debug:synthetic_debug_expression:1:1: Error: Undefined name 'data'.
'data' is a List while debugging. The path is correct.
This is my code
import 'package:flutter/material.dart';
...