Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to move the app to the SD card #299

Open
Pazu opened this issue Nov 6, 2013 · 7 comments
Open

Ability to move the app to the SD card #299

Pazu opened this issue Nov 6, 2013 · 7 comments

Comments

@Pazu
Copy link

Pazu commented Nov 6, 2013

It appears it's presently not possible to move the ownCloud Android app to the SD card.

ownCloud app version 1.4.6
Android 4.0.4

@davivel
Copy link
Contributor

davivel commented Nov 14, 2013

Currently this is not supported, at least not in regular Android systems. Seems that some users can move the app to the SD card in Cyanogen, but we are not supporting this feature right now.

According to the Android documentation (and our recent experiments) when the app is built supporting installation in external storage, the system installs the APK in that storage BUT the databases of the app are kept in the internal storage. This is true for all the Android apps supporting this feature through the regular installation systems.

I don't know if this happens also in Cyanogen systems. Would be great if any Cyanogen user could tell to us about it (@smu ?).

So ... we don't see a big improvement in doing this. The app is quite small ; the database can get really big if there are a lot of files in the server, but to move the database to external storage we would have to implement the feature from zero, not just enabling it in the manifest. That can be considerably hard.

We will keep this open to follow the discussion. Please, tell us why is important for you being able to move the app to external storage.

@smu
Copy link

smu commented Nov 14, 2013

I am not sure, what you meant by 'database'. The folder structure, where the downloaded files can be found?

If this is the case, then I am a bit puzzled at the moment.
To summarize: I am using owncloud on CyanogenMod 7.2, or better stopped using it because I had to move the app to the SD card (internal storage on my device is very small) which lead to the problem, that I need to reconfigure the app after every reboot.
Now, to answer your question above, I moved the app back to the phone, deleted the directory /sdcard/owncloud, and reconfigured the app.
Surprisingly, the downloaded files are still placed in /sdcard/owncloud. Unfortunately, I do not remember whether this was also the case after the first installation. It may be, that I never checked this, since I directly moved the app to the SD card.
Furthermore, the app remembers the settings, even after a reboot.
So for me, the problem mentioned in #35 is solved.

Now, I do not know, whether this helps. Does it?
I am not sure whether /sdcard/owncloud is used by default, or whether this is somehow remembered by the app after having moved it to the SD card.
If it makes sense I could try to completely reinstall the app, delete all files and try again.

@Pazu
Copy link
Author

Pazu commented Nov 15, 2013

@davivel My reason for requesting this is one of those @smu mentioned; namely, to save as much or my limited internal memory as possible.

@davivel
Copy link
Contributor

davivel commented Nov 15, 2013

Thanks both of you for your responses.

Let me explain a bit more. Sorry if it's too much reading.

The ownCloud app holds two differnt items to map locally the files in the server side: the first one is a SQLite database with the information (names, sizes, MIME type) about all the files contained in the server ; the second one is a local file tree with all the files that are downloaded or that were uploaded from the device.

Currently, the local file tree is always located at the folder /owncloud in the "external" storage partition of the device. "External" is quoted because we are using the definition of "external" used by Google here: http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory() . As the 'Note' states, this can be indeed an SD card or not, and that's fully dependent of what wanted to do the manufacturer of your devices.

There is an issue requesting that the base location for the downloaded / uploaded files can be set up by the users. That would probably help you to save space, if the current location of /sdcard/owncloud is a problem. If you download a lot of files, or just some heavy files, this will be easily the part of the app that takes more space from your devices. We hope we can work in that issue some time, or that some contributor wants to implement it.

About the database, it's located in the private storage of the app, that is always defined by the system in the internal storage. Even if allow to change the installation location of the app, the database will still be in the interanl storage since we use the regular interfaces in the Android API for creating and handling SQLite databases, and they keep it there. So, to gain space moving the database app, we would need to handle an extra SQLite file in the external storage, and create an ad hoc implementation to handle it. It is probably possible, but can have some implications in security, and will need some extra effort that, maybe, doesn't worth enough.

To have an idea of how big is the space used by your database in your internal storage, just have a look to Settings / Application / ownCloud in your devices. The size marked as 'Data' is mainly due to the database. If you have a lot of files in your server it can be considerably big, but it won't be in all the cases. Is it really big for you, or isn't it?

Look also to the size of 'Application' in the same view. Roughly half of it is really moved to the SD card when the app is allowed to be installed outside. Probably not a great difference, or maybe it is for you?

@smu
Copy link

smu commented Nov 15, 2013

Thank you for the explanations!

I checked the location of the owncloud database on my device.
In both cases, when the app is installed in the internal storage, as well when the app is moved to the SD card in CyanogenMod 7.2, the database is located in the internal storage directory (on my device /data/data/com.owncloud.android/databases).
However, for me this is not an issue since the database is not very large.

If you have any further question don't mind to ask.

@davivel
Copy link
Contributor

davivel commented Nov 19, 2013

Let's keep this open by now. Probably will be useful for you to know abou issue #10 also.

@masensio
Copy link

I think it is related with #1012 and #1017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants