Remove All Ads from XDA
Honor View 10

Dev-Question; /data/data not persistent

2 posts
Thanks Meter: 0
By MStrecke, Junior Member on 3rd June 2014, 12:51 AM
Post Reply Email Thread
I'm using an unrooted Razr-I XT890 with Android 4.1.2

When using the app "Syncthing-android" I run into what seems to be a Razr-I specific problem described below.
Syncthing is a multi-platform secure syncing app and Syncthing-android is a port to the Android platform.

The particular problem is that the the config data (node identity, keys etc) get lost after a reboot of the phone.
When used the memory status of the app shows 72 KB of "data", and 0 KB after a reboot.

One line in the logcat caught my attention:
W/ApplicationContext(386): Unable to create files directory /data/data/com.nutomic.syncthingandroid/files
However, if the app is exited or "killed" and restarted, the data is still available and the app uses them.
But it is gone after a reboot. According the original developer this happens only on my system.

I'm hoping that somebody recognizes this pattern and can give me/us a hint to its origin.

I'm not the developer of that particular app, rather an interested user, who happens to be a developer, but not very proficcent when it comes to Android apps. However terms like "logcat", "intent" or "service" don't scare me

Sorry if this sub-forum is not the correct one for posting this kind of question. The one which seems more appropriate is not accessible to me.
This relates to issue 24 of syncthing-android on github - sorry, I can't post external links here yet.
3rd June 2014, 07:53 PM |#2  
Hazou's Avatar
Senior Member
Thanks Meter: 2,190
Donate to Me

I am not an expert on this matter, but I saw it ones coming through the Google issues. This was it: It could be a permission problem, most likely and in this issue tracker it has been resolved in android 4.4. Some phones do have it others don't, just like the Recovery's here. Some don't have any problems with using them, while others do.

Verstuurd van mijn GT-P5110
4th June 2014, 10:25 AM |#3  
OP Junior Member
Thanks Meter: 0
Thank you for your suggestion.

We found the bug (see original thread on GitHub).

For future reference:
The "official" folder to store persistent data can be obtained by the API call getFilesDir().
The deleoper used getApplicationInto().dataDir

The first one points to /data/data/appname/files/
The second one points to /data/data/appname/

It seems that the Razr (contrary to other phones) deletes files in /data/data/appname/ which are not stored in a subfolder.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes