• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Shared Preference Editor is taking a long time to update the value

Shared Preference Editor is taking a long time to update the value​


Shared Preference Editor is taking a long time (3-4 seconds) to update the value into the XML file.
Below is my scenario
  1. I am updating the parameter value into the shared pref.XML file.
  2. After updating the value withing 2-3 seconds I reboot the device.
  3. After reboot I am able to see there is two shared pref XML file in /data/data/apk.package/shared_pref path. one is original and another one is xml.bak file In xml.bak file parameter value is not updated while in xml file value has been updated properly.
  4. After reboot when I run the application, bak.xml is convert into the main xml file (main xml file deleted) and application read parameter value from bak.xml file which is not correct.
Below is my source code
Java:
sUserPref = app.getSharedPreferences("ABC", Context.MODE_PRIVATE);
sUserEditor = sUserPref.edit();
sUserEditor.putInt(storedKey, value);
if (sUserEditor.commit()) {
LogHelper.Logd(DBG_HEADER, "commit success");
return true;
} else {
return false;
}
Why sharedpref is taking time to update the file? Is it depends on the memory in the device? Is there any other alternative?

Media (Music) Volume Fluctuates Randomly (searched, no solutions))

I've spent weeks Googling this issue. I've seen people have this issue across so many different forums with no solutions. LG G7 Sprint Android 8.0

To describe it, the media volume fluctuates randomly. It can go down for a few seconds to a few minutes and then spike back up to normal volume and drop back down. Usually when I start and stop the music it will sometimes go back to normal but will then continue to fluctuate not long after.

It doesn't matter what kind of phone it is and it's not specific to any app. The only responses I usually find are pretty much the tech support answers of restarting the phone, try different headphones, ect.

So I'm going try and remember and list all of the things I've tried along with many other people to no avail.

1. I've rebooted the phone
2. Took the battery out
4. Entered Safe Mode
5. Cleared cache through safe mode
6. It's strictly the media (music) volume. Not the ringer or notifications or anything else.
7. My buttons are not stuck because the icon would show the buttons turning it down. There are no warnings or indications of the volume turning down.
8. I tried with 3D sound, the equalizer, Do Not Disturb, on and off with no results
9. My apps do not auto update so there are no changes.
10. Any new apps, I cleared the storage data and cache and uninstalled.
11. It happens regardless of whatever app is playing media (default music app, Spotify, Youtube, etc).so it's not the apps themselves
12. I've tried downloading alternative music and video apps.
13. It doesn't matter what kind of headphones. Bluetooth, wired, even without headphones it does it. Tried multiple headphones and different bluetooth sources to no avail.
14. Haven't done a factory reset because I have some things I can't backup (I've heard many others already tried this and it did not solve the issue.)
15. I'm not rooted.
16. I've tried both bluetooth audio and regular audio lockers to prevent volume going down but no dice.

There's probably a few more things that I've tried but couldn't remember to type them down. The only thing that seems to fit any kind of pattern or makes sense is something called "Audio Focus" or "Audio Ducking. Where the volume will lower for another app or if you get a notification. I'm not even getting notifications and it still goes crazy. Just for giggles, I turned off all of my notifications from the app menu and still it persists. I've even found apps like Rocket Music Player and a few others that can change the focus but those didn't work either. I think also it seems most people having this issue seems to be with newer phones so maybe it has to do with Android 8.0 or higher?

In any case, I'm still looking through Google, forums, Youtube and hoping someone finds an answer to where this issue can be fixed.

Thank you.
Hello Lurker. Am pretty sure you may not be even logging in to here anymore - especially 5 years after the happening of this conversation - but am here on a Motorola phone (g7 play) with an Android 10 which in the past 2-3 weeks it's been giving me an increasing number of issues regarding to volume fluctuations when playing music on apps. To describe it I can only copy and paste what you wrote on here about your phone's problems <<It can go down for a few seconds to a few minutes and then spike back up to normal volume and drop back dow>>.
I'm very much wondering and hoping you found the way to sort the problem out and have a solution for my one before I hammer it out as a last resort, since I was almost going to undertake all those innumerable (and useless) different ways you already tried, but now I know they didn't solve your problem, and that for some reason am expecting them not be working on my issue too.
Please tell me you choose a better way than hammering to sort your phone out because ATM after reading you I actually have no clue whatsoever of what can I do to fix mine. Have another Motorola's phone of a way older model than this one, that comes with Android 8 and it does have or gives 0 issues whatsoever to its volume when playing tunes using the same music app I have installed on to both devices. Knowing this obviously made it even more clear in my head that the problem I have is on this device only and it has anything to do with where or on to what I did plugged the phone in when the volume begin to fault. Also, it all started with the volume drastically decreasing only on a very random basis and most of the time happening when I was either turning the volume up or down and only doing so when connected to my Bluetooth speaker. Now the issues gone so bad that the volume decreases or cuts off a lot like on a literally every 40sec song basis, and it's doing so even when playing music at a medium/low volume on the speaker phone. One more thing that I noticed while standing in front of my speaker set when the problem occurred is that each time the volume decreases it mainly goes down the most from it's right front speaker and way less from it's left speaker and from the woofer. Changing the phone output settings from mono to combined audio does not too make any difference whatsoever. Please someone's help me out. Cheers

Google storage limitation already caused havoc

I want sd and a decent camera, a zillion dollars, peace, love and a machine gun. I don't want any of "em spying on me or telling me what to do. That said, I guess I am sonewhat of an Android loyalist, having used only a single crapple phone. This was in the day when they had those strange sideways chargers that remind me of vacuum cleaner attachments. That sucker filled up fast.

Are you paper book fan or kindle fan?

What do you prefer?
Of course, I'm a fan of e-books, particularly the Amazon Kindle! E-readers provide many benefits, such as access to a huge library in one device, the convenience of carrying multiple books with you, and customizing the text to suit your preferences. Amazon Kindle also gives you access to a variety of book formats and services, making reading even more fun. Sometimes when I’m too lazy to read, I ask do my homework, I found https://edubirdie.com/do-my-homework for this. But the rest of the time I read on my e-reader. It is very convenient and comfortable. It also saves money on buying books. So it’s worth a lot of thought.

Error: INSTALL_FAILED_UPDATE_INCOMPATIBLE

Hello everyone!
I get an error when install my local aab build by bundle build tool:
Caused by: com.android.ddmlib.InstallException: Failed to commit install session 1908590605 with command cmd package install-commit 1908590605. Error: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package com.company.game signatures do not match newer version; ignoring!

Here is my command to generate and install the build:
  • java -jar bundletool_1.15.4.jar build-apks --bundle=bundle.aab --output=filename.apks --ks=ks_path --ks-pass=pass:mypass --ks-key-alias=mylias --key-pass=pass:myaliaspass
  • java -jar bundletool_1.15.4.jar install-apks --apks=filename.apks

I tried build-apks with flag '--local-testing' but no luck.

*NOTE:
I absolutely sure I was using same keystore for 2 build (build was upload to ggplay store and local build)
I must keep old build in phone (Cause I tesing case user update my app)
This error only happen when install in android 13 and android 14 beta (android 12 and below was fine)
I can download update the build when I upload new build into ggplay store (channel internal testing)

Thanks all!

Help Help me choose a budget rugged phone

My fellow mp3 player
Fellow? Is that a brand name?

I'll be honest: I'm having a hard time making out what you're saying, because you're using texting-talk instead of standard English. Ture: The rules of this site allow texting-talk. And true: I could make it out if I put extra effort into making out your texting-talk. But even with that effort, it'd be like trying to read Shakespeare or the King James Bible. I might get it, more or less, but I'll likely miss important stuff. If I miss important stuff, I'll be far less able to help you!

In other words, while texting-talk is allowed here: I strongly recommend sticking for standard English for important matters (such as this), so that we can focus more on giving you help with finding a phone, and less on making out your English.

Is shipt for real?

Milk was the staple beverage when I was growing up. We never drank store bought milk. It was purchased from private farms without any homogenization or pasteurization or fortification. It was a completely different product than that purchased in a store. To this day, I still shake the milk jug before pouring. :)

I've had raw milk like that, while it was still warm from the cow. Which I'm pretty sure is illegal to sell in the UK these days. I've also drank horse milk as well.

Completely offline news app?

If you're offline, you're not going to get any news. Wifi, yes but that's being online also.
Well, download while i'm on wifi so I can read later. I just want when I have data for the app to auto refresh. I don't want to have to think about it all the time refreshing the app.

Press Reader seems to work like the app Pocket. It's like you need to figure out while you have wifi which websites you want to read and then download them. Then you can read them offline. It only saves that one site at that moment in time. But, I can't tell it just to download all news stories all the time from abcnews.com and always keep them up to date so, that one moment when I'm offline, I can read what is the most recent when I went offline. With Pocket and Press Reader, a day after I select the site, it's out of date and I'm reading old news.

We have fiber at our house. (Just got it a few months ago. But, most places around my house I have absolutely no cell signal. I go to my kids school for a school function. I'm just trying to pass time while at a football game. I'm not really into the football game. My kids are just there to run around and play with other kids. I can't get online because there's absolutely no cell signal at the school. So, it would be nice to be able to just read the news while I'm there...

I just switched from at&t to verizon wondering if coverage would be any better around my area and it's not. We live in a very rural area. (We jus moved a year ago where we had great coverage everywhere, but we lived in the city. my wife and I are not city folks. we like country land. so, we have that now. but also, we have no cell signal most places we go.)

Difference between Youtube and Spotify audio?

I could never get into any Star Wars since the original trilogy. I can't stand the edited trilogy changes either, and own an original unedited VHS set. I did see The Force Awakens, but there was a few off-putting things about it. Killing off Han Solo sure didn't help.

I see a ton of 'baby Yoda' stickers everywhere and I'm outta the loop on that one, but I assume it has a lot to do with a later series in the same universe. For myself, there is only ONE Yoda and he died in Return of the Jedi

Chrome OS / Chromebooks

Mainly I do this because everyone I know calls me for help with their tech. I had not given Chromebook much thought until this opportunity to pick one up, and my brother-in-law says he likes using his, so gotta find out for myself.
In other words: Using the Chromebook for e-mail and browsing is a means to an end, that end being learning about Chromebooks so you can help folks with thier Chromebook.

Filter

Back
Top Bottom