How to reliably identify an Android Tablet microSD Card

Peter Reid preid at reidit.co.uk
Wed Nov 28 06:49:16 EST 2018


I've got an app running on an Android 8.1 7in tablet which uses a microSD card for its RW data storage. I've tried using:

	specialFolderPath("external documents")

which the docs describe as follows:

	• "external documents": The folder on the primary shared/external storage device where application-specific data can be placed
but this doesn't point to the microSD.

Instead I'm having to try to pause the app and then search around for the microSD.  So far I've found 7 different locations for the microSD, depending on the model of tablet:

	1. /mnt/ext_sdcard/Android/data/com.reidit.myapp/files

	2. /mnt/sdcard2/Android/data/com.reidit.myapp/files

	3. /mnt/m_external_sd/Android/data/com.reidit.myapp/files

	4. /mnt/sdcard/Android/data/com.reidit.myapp/files

	5. /mnt/extSdCard/Android/data/com.reidit.myapp/files

	6. /mnt/external_sd/Android/data/com.reidit.myapp/files

	7. /mnt/SDCard/Android/data/com.reidit.myapp/files

where the ../files folder is located in the microSD filing system as follows:

	/Android
		/data
			/com.reidit.myapp
				/files

Whenever I try to install my app on a different Android tablet, I have to go hunting for the exact filing system for the 1st part of the microSD:

	/mnt/<unknown>/

The tail of /Android/data/com.reidit.myapp/files seems to be consistent. It seems that the only variable is the <unknown> part.

However, I have 2 tablets (Android 5.1 and Android 8.1) where I haven't been able to locate the microSD card at all!

Any suggestions about how to reliably locate the microSD card in an Android tablet?

Peter
--
Peter Reid
Loughborough, UK





More information about the use-livecode mailing list