I noticed that Android 7 device (API 24) doesn't erase some of the 
preferences when the app is being reinstalled, unless I call clearAll() or 
manually choose "Clear Data" in the App Storage settings. 
This caused some bugs. 
Adding  android.allowBackup=false to the hints resolved this particular 
problem. 


On Friday, May 21, 2021 at 12:58:51 AM UTC-4 Shai Almog wrote:

> Preferences clearAll is pretty destructive. I would suggest using it only 
> in extreme cases. 
>
> On Thursday, May 20, 2021 at 7:16:51 PM UTC+3 [email protected] wrote:
>
>> Oh yes, just use the Storage class to write its own file instead of 
>> Preferences and then you won't have to worry about Prefs.clearAll
>> Preferences just uses a single file where it stores a dictionary, but you 
>> can write separate files and that will take care of it
>>
>> On Thu, 20 May 2021, 16:58 Hannah R, <[email protected]> wrote:
>>
>>> Thank you, Javier. 
>>>
>>> I wondered if there are any other options because I use 
>>> Preferences.clearAll() in some cases, as well as I wasn't sure about 
>>> app updates etc. But I guess if there are no other ways or this is the best 
>>> one, will do it. 
>>>
>>> On Thursday, May 20, 2021 at 11:55:26 AM UTC-4 [email protected] 
>>> wrote:
>>>
>>>> You can use Preferences to write a small boolean value that is set to 
>>>> true after the first time the app is used
>>>>
>>>> Updating an already installed app wont reset the flag as that re uses 
>>>> the app data folder
>>>>
>>>>
>>>>
>>>> On Thu, 20 May 2021, 16:52 Hannah R, <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> How can I find out when the app was launched the first time after 
>>>>> installation? 
>>>>> Thank you a lot. 
>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "CodenameOne Discussions" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/codenameone-discussions/c7b0a5b4-cfc9-48d8-85c6-7619272c6d2bn%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/codenameone-discussions/c7b0a5b4-cfc9-48d8-85c6-7619272c6d2bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "CodenameOne Discussions" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/codenameone-discussions/5d4d76ec-87d6-4c2a-8cd4-e8343da1b77cn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/codenameone-discussions/5d4d76ec-87d6-4c2a-8cd4-e8343da1b77cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/ea86febe-01a5-4430-bc93-97baa6bd960cn%40googlegroups.com.

Reply via email to