ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > Android Port > Kitkat save problem Goto page 1, 2  Next
Kitkat save problem
  Author    Thread Reply to topic
jortlaban



Joined: 21 Nov 2013
Posts: 19
Kitkat save problem 

Since Android 4.4 Google has implemented new rules for apps writing to external storage.
An app is only allowed to write to is own folder structure or to the internal storage device.
My save folder is actually in the designated folder for ScummVM so this new android policy shouldn't be any problem, however I am able to load previous saves, but ScummVM fails to write to this folder.
Is there any way or plan to fix this issue in the daily builds?? (or even the "official" Google play release)
A work around is to just put the saves to my internal storage, but I rather have them on my external storage card for easy transfer to other devices.

 Reply with quote  
Post Sat Mar 15, 2014 10:23 pm 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 944
 

Hmm...
https://developer.android.com/about/versions/android-4.4.html

"If your app reads from external storage...

Your app can not read shared files on the external storage when running on Android 4.4, unless your app has the READ_EXTERNAL_STORAGE permission. That is, files within the directory returned by getExternalStoragePublicDirectory() are no longer accessible without the permission. However, if you need to access only your app-specific directories, provided by getExternalFilesDir(), then you do not need the READ_EXTERNAL_STORAGE permission."

We can look at adding the READ_EXTERNAL_STORAGE permission to avoid this, but we may have another issue here, so best to investigate fully.

I have no idea why that would not work correctly to save..

Can you provide some debugging information as I have no Android 4.4 device (and having trouble setting up the VAD emulator):
http://wiki.scummvm.org/index.php/Debugging_ScummVM#Android

Basically any warning or errors into the Android Debug Log when the save fails would allow us to investigate.

Also, ensure you are using the latest development master build from here:
http://buildbot.scummvm.org/builds.html

Important instructions for installing daily builds are given here:
http://wiki.scummvm.org/index.php/Android#Installation

 Reply with quote  
Post Mon Mar 17, 2014 1:15 am 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 944
 

Have done a quick check through the relevant code in scummvm/dists/android and scummvm/backends/platform/android.

As far as I can see, comparing this to the Android documentation online, this should work fine.

The saves path will default to <External Storage>/ScummVM/Saves/. If this directory does not exist or can not be created, then it will switch to a directory under the application specific directory called "saves".

We ask for the WRITE_EXTERNAL_STORAGE permission in our manifest and this should implicitly grant READ_EXTERNAL_STORAGE as well according to:
https://developer.android.com/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE

This may be a subtle bug in your 4.4 implementation where we need to add the READ_EXTERNAL_STORAGE permission explicitly.

But the debug logs should make it clear what is happening when the save fails.. Thanks.

 Reply with quote  
Post Mon Mar 17, 2014 1:49 am 
 View user's profile Send private message
jortlaban



Joined: 21 Nov 2013
Posts: 19
 

The biggest problem is that I can't find any scummVM files on my device.
It is clearly installed, since the app and all installed engines run perfectly.
I wouldn't mind using the main app folder for my saves, but I just can't find it.
The same goes for the debug files.
If someone could provide the standard installation path on Android, it wouldn't be any problem saving there since Android does allow an app to write to it's own installation folder.

 Reply with quote  
Post Sat Mar 22, 2014 7:34 am 
 View user's profile Send private message
jortlaban



Joined: 21 Nov 2013
Posts: 19
 

I am using the latest developments build by the way.

 Reply with quote  
Post Sat Mar 22, 2014 7:36 am 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 944
 

jortlaban: As I said, I can't help you if you don't provide any further information.

Can you check the Android Debug Log, either using alogcat or adb as described here:
http://wiki.scummvm.org/index.php/Debugging_ScummVM#Android

And can you indicate which development build you are using? The version will be v1.7.0git-xxxx . It is the xxxx value that we need. This should be the directory name after you unpacked the zip file of apks. If you no longer have this, then the version is written on the launcher screen below the ScummVM logo and above the games list, Add game button etc.

 Reply with quote  
Post Sat Mar 22, 2014 2:00 pm 
 View user's profile Send private message
jortlaban



Joined: 21 Nov 2013
Posts: 19
 

I am using 1.7.0git6218-g7da44b6.
still wondering where scummVM installs, since that would be the simplest solution. Then I could just copy my required saves to there.
I don't see where the debug report would help.

I will check later tonight to get that though.
thanks in advance anyway.

 Reply with quote  
Post Sat Mar 22, 2014 8:40 pm 
 View user's profile Send private message
jortlaban



Joined: 21 Nov 2013
Posts: 19
 

Tried to get an error log, but no error came up.
It just keeps up stating: "D/AbsListView(24773): unregisterIRlistener () is called" over and over again.

 Reply with quote  
Post Sun Mar 23, 2014 6:42 pm 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 944
 

OK. That build is from 2014-03-15, and no revelant Android fixes have been applied since, so this is not an "outdated" issue.

ScummVM installs to the internal Android storage as per other applications... I think this is a "secure" location (.android_secure IIRC) which is not available to user access unless you have rooted the device... but I am not an Android expert, so don't quote me on that.

Anyway, the point is to work out what the problem is with the external storage location as this should work fine... and even if we avoid it for now, it could come back to bite us again... hence my desire to see if there are any relevant details in the debug/error log.

I don't think that D/AbsListView debug is relevant... You should be able to filter it out with logcat or other tools.
I am specifically looking for any E/ (error) and W/ (Warning) lines associated after the information I/ lines for starting ScummVM.

Also, can you indicate exactly which games you are observing the save failures with? If you have only seen these with one game so far, try Flight of the Amazon Queen, Dreamweb and some of the other freeware games on our download page:
http://www.scummvm.org/games
to eliminate this being an engine specific issue.

 Reply with quote  
Post Sun Mar 23, 2014 9:29 pm 
 View user's profile Send private message
jortlaban



Joined: 21 Nov 2013
Posts: 19
 

All games that access the external card for saving fail.
Currently I just use the internal storage basic scummvm folder (scummvm/saves) which works fine.
I just have to remember this when I tinker with my phone.
Games work fine from the external storage by the way.
It's just the save issue.

 Reply with quote  
Post Tue Mar 25, 2014 4:08 pm 
 View user's profile Send private message
jortlaban



Joined: 21 Nov 2013
Posts: 19
 

To be more precise, when the "save error" occurs, no error is present in the log. I tried to generate some other errors with some tinkering, that will show up just fine.
It looks like the save error is basically just and access denied issue which Android doesn't register as an error.
My library consists of basically the entire Scumm library, some SCI games and 7th Guest.
Or at least on my phone.
The problem seems to be solely connected to the permissions to write to the external storage. Android 4.3 doesn't have this issue.
The games want to write to the external storage because my phone already had the same folder present on the external storage. Will try to reinstall the app and delete the folder to see what happens

 Reply with quote  
Post Tue Mar 25, 2014 4:16 pm 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 944
 

Hmm... OK, so if you have seen this with SCUMM, SCI and Groovie, it is unlikely to be an engine specific issue.

As far as I know, we have correctly asked for the permissions for this:
https://github.com/scummvm/scummvm/blob/master/dists/android/AndroidManifest.xml.in#L49

So not sure why this should be failing...

 Reply with quote  
Post Tue Mar 25, 2014 4:21 pm 
 View user's profile Send private message
mac_es



Joined: 31 Oct 2005
Posts: 104
 

Hello,

Here you have an explanation of what is going on this:

http://www.androidpolice.com/2014/02/17/external-blues-google-has-brought-big-changes-to-sd-cards-in-kitkat-and-even-samsung-may-be-implementing-them/

ScummVM is doing all it can.... Android is stopping it from saving

 Reply with quote  
Post Mon Mar 31, 2014 7:13 am 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 944
 

OH hell... that is retarded.

@jortlaban: Use the fix suggested here. You will need to have rooted your device:
http://www.androidpolice.com/2014/03/21/easily-restore-full-access-to-the-sd-card-on-android-4-4-kitkat-with-sdfix-root-required/

 Reply with quote  
Post Tue Apr 01, 2014 11:39 am 
 View user's profile Send private message
jortlaban



Joined: 21 Nov 2013
Posts: 19
 

For the first time ever I have rooted my phone.
Never needed it, never found it that usefull... until now.

Saves work fine now, some other apps that are non-scummvm related still seem to have some issues, but that is not something for this board.

Thanks for your efforts anyway. in someway it is reassuring that the problem lies solely with Android's stupid stance towards external SD-cards.

 Reply with quote  
Post Wed Apr 02, 2014 9:50 pm 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 
Goto page 1, 2  Next


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge