Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,814,393 Members 53,729 Now Online
XDA Developers Android and Mobile Development Forum

Dev-Question; /data/data not persistent

Tip us?
 
MStrecke
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 2
Join Date: Jun 2014
Default Dev-Question; /data/data not persistent

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:
Code:
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.
 
Hazou
Old
#2  
Hazou's Avatar
Senior Member
Thanks Meter 846
Posts: 599
Join Date: Feb 2012
Hey,

I am not an expert on this matter, but I saw it ones coming through the Google issues. This was it:https://code.google.com/p/android/issues/detail?id=8886. 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
 
MStrecke
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 2
Join Date: Jun 2014
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.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes