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

SD card support #53

Open
Winqov opened this issue Jun 15, 2024 · 1 comment
Open

SD card support #53

Winqov opened this issue Jun 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Winqov
Copy link

Winqov commented Jun 15, 2024

Issue:
The internal storage of my phone is very limited. To counter that, I have a 128 GB SD card, but this app doesn't take advantage of it for now.

Solution:
Adding SD card support would solve the issue.

My patch:
I have being investigating how to do it for myself and I have successfully achieved something.

/app/src/main/java/at/andreasrohner/spartantimelapserec/data/RecSettings.java LINE 150

if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
	StorageManager storageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
	List<StorageVolume> storageVolumeList = storageManager.getStorageVolumes();
	if (storageVolumeList.size() > 1) {
		StorageVolume storageVolume = storageVolumeList.get(1);
		projectPath = storageVolume.getDirectory().getPath() + "/Pictures/";
	}
}

I made a build with this patch, and it's working fine so far on my android 11 device. With my SD card inserted, the app will record the videos to it, if I extract it, the videos are recorded in the internal storage. No extra permissions, the app already have write access to the "Pictures" folder in the SD card.

As you can see, this method requires API 30 for "getDirectory()", so there is a check, and if not matched, it is ignored. If you ask me, that's better than no SD card support at all, but I'm not an android dev, so maybe there is a better option.

My device:
Redmi Note 7
Android 11 - DivestOS, a soft fork of LineageOS

@woheller69 woheller69 added the enhancement New feature or request label Jun 16, 2024
@woheller69
Copy link
Owner

in case you want to record in jpg mode, you can try the version in the beta branch which @andreasb242 is working on.
It also supports SD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants