SharedPreferences are not stored after restarting app - android

maybe someone experienced the same problem with Android 8.
I wrote an application for an older Android version ( Android 6 and 7 ).
Now, after having updated my mobile phone to Android 8 it seems as if SharedPreferences are not stored anymore although my application was working fine for a long time with older Android versions.
As long as I save my settings for the current session everything is working fine but as soon as I restart my application all the settings seem to be lost.
I also checked my security settings in Android but they seem to be fine, too.
I have not changed any line of code in my app so I think it has something to do with Android itself.
Did somebody experience the same problem or maybe he/she knows how to solve the problem?
Thank you very much!

At the moment you write your questions you always find the answer.
The problem lies within the security settings for SharedPreferences: MODE_WORLD_READABLE is not allowed anymore or it was deprecated and now it was deleted.

Related

Android studio's Android SDK download button is not activated

I'm having trouble with my android studio and I even changed my windows, now I'm just frustrated. Can someone help me? I almost looked everywhere.
So this is when I've installed android studio and this appears.
Then it automatically goes to this page and wants to download android SDK but the check box is not activated! and as you can see the download size is 0!
And that's the next one!
So I quitted the setup and opened the SDK manager from the android studio and this is what it says:
picture
does anyone know what should I do to download SDK? And by the way, I'm living in Iran, that's one of those countries that include United States sanctions. Do you think it's related and if Yes what should I do?
p.s: This is the first time I'm asking a question on Stackoverflow, so forgive me if I did something wrong in the asking process.
After doing some changes to my IP I could fix the problem. So, if anyone has the same problem I think it's related to their countries limit problems. You should change your IP.

Getting an App APK

Hey guys and girls for a the past week I've grown a lot of interest in android studio (even without knowing quite much about it) I decided to create an app that I deemed quite useful. However the app required maps to be integrated in it and I really did not know what I was doing and at one point I started messing with the settings and then all hell broke loose and I kept getting AAPT2 errors and I even tried to fix this issue with the gradle properties line that you add (I forgot the line of code to add). Anyways it still didnt work. However I rembered that I always kept the good version (before I broke everything) of the app on my phone. So when I go in my phone the app is there and it works just fine. Ive tried so many things to get the source code from the app on my phone without any succes. My question is, how can I get the source code back from the working app onto my laptop to continue coding in android studio? If it helps I am using Linux 18.04 LTS and running the newest version of android studio. Thank you for any help from you guys. This means a lot to me.
You can’t get back the ‘source code’ from an already compiled app.
You should consider using some version control platforms like git from the next time

SharedPreferences file not being removed on uninstall

I have a suspicion that this might be due to my running a custom rom... but I figured I should at least come by and ask here.
I'm working on an app that uses some SharedPreferences. Everything in that aspect works fine, but after completely uninstalling and then installing again, I found that my SharedPreferences values were still being picked up. I ended up uninstalling and then pulling up an adb shell and found that indeed... under /dbdata/databases/mypackagename/shared_prefs/ there were still files there. I would assume that they should have been removed...
I'm using a Samsung Captivate running the Serendipity rom... Again, I can only imagine that that has something to do with it, but I'm not certain.
Edit - I just completely wiped clean and put on the Firefly Rom and tested this out, experiencing the same thing. Is this possibly a Froyo bug (both have been 2.2 Roms)?
Try this on a stock ROM, I've never heard of this problem before.
It is probably the custom ROM. When an application is removed or the Clear Data is clicked in the settings, it not only removes the the application, but also the data that is specific to it.
A custom ROM will not always do it, it would remove the application but store the files.
For the most part, the reason is accessibility, in the sense that when you say uninstall an app (i.e. Game) because of frustration, when you come back, you data is still available for use.
As developers this may get annoying but may users tend to like the ability to reinstalling an app and having the same information.

android app project over RSE

I wonder if anyone can tell me if it is possible to save an android app on a server and use the RSE Eclipse plugin to edit it ?
This has become necessary for me so I don't have to physically be at work to continue work on a project.
Thanks for any input.
Sorry if this seems obvious...but is there no way you can work on the app locally and save your changes to the server using RSE...or even better, commit the changes using some version control system?

Upgrading Android Version cleans application data?

I've received a strange bug report:
After a OTA update of the SO from 2.1 to 2.2 the SharedPreferences have been wiped, thus making my app return to the 1st time screen.
Is this a normal behaviour, wipe of the SharedPreferences on system update although maintaining the app installed?
Thanks
Shared Preferences data will remain.
Kindly check the following link which provides a good analysis of your problem.
http://groups.google.com/group/android-developers/browse_thread/thread/246aae66e0caf302/908be552b1d86158?lnk=gst&q=Shared+Preferences#908be552b1d86158

Categories

Resources