I have an app that needs to send multiple image attachments in an email. To send the images, I need an absolute path. For this, I use functions .toAbsolutePath
and Paths.get
from java.nio
. Both of these functions only work with API 26
and higher. They seem to me like really basic functions, so I don't know why they don't support lower APIs. Is there any way to make them work with lower APIs
?
realPath1 = Paths.get("storage/emulated/0/Android/data/com.example.abbmalfunctionreport/cache/$image1").toAbsolutePath()