Android: I had a hard time displaying the HTML file on the SD card

Introduction

Because I wanted to carry a lot of image files and music files on my Android tablet, I had a hard time trying to make a simple app using WebView. ..

Tablet terminal environment

Lenovo 501LV (Android 5.0.2, API21)

External SD card path

///storage/sdcard1



 The first pitfall is
 "Display HTML file on SD card"
 What I googled in ...

 next
 On Lenovo 501LV, with `getExternalStorageDirectory ()`
 I couldn't find the SD card pass. .. (It seems that the path of the internal storage is returned depending on the model)

 And finally
 If you look at the log properly

D/Environment: getStorageVolume, volume:StorageVolume: mStorageId=65537 mPath=/storage/emulated/0 mDescriptionId=17040812 mPrimary=true mRemovable=false mEmulated=true mMtpReserveSpace=10 mAllowMassStorage=false mMaxFileSize=0 mOwner=UserHandle{0} mUuid=null mUserLabel=null mState=mounted D/Environment: getStorageVolume, volume:StorageVolume: mStorageId=131073 mPath=/storage/sdcard1 mDescriptionId=17040810 mPrimary=false mRemovable=true mEmulated=false mMtpReserveSpace=0 mAllowMassStorage=true mMaxFileSize=4294967295 mOwner=null mUuid=0403-0201 mUserLabel=null mState=mounted



`mPath=/storage/sdcard1`

 (・ ・ ;)
 It was here. ..

 Ohri


Recommended Posts

Android: I had a hard time displaying the HTML file on the SD card
I had a hard time installing MariaDB 10.5.5 on CentOS 8 of Sakura VPS
I made a library for displaying tutorials on Android.
[Solution] A memo that I had a hard time because the format of sinatra-validation changed
A story that I had a hard time trying to build PHP 7.4 on GCE's CentOS 8
left4dead2 I made a Docker image for the server and tried running it on GCE # 3 (I had a hard time building the server)
I made a calculator app on Android
I had a hard time doing Java multithreading from scratch, so organize it
I learned about the existence of a gemspec file
I want to simplify the log output on Android