Androidversion prüfen

Verwende grundsätzlich diesen Pfad:

/storage/emulated/0/Android/data/...

der auf allen Android-Versionen funktioniert.

Die API abzufragen, ist kein Problem (siehe z.B. hier), ist aber in diesem Fall unnnötig.
Den Pfad zum ASD kann man u.a. mit dieser kleinen Extension abfragen: Get the path of → ASD (app-specific dir) & → private data dir (internal storage), was (wie gesagt) in diesem Fall nicht erforderlich ist.

Btw, der Block, den du gepostet hast, macht wenig Sinn, da es so scheint, dass du etwas aus dem ASD in das ASD kopieren willst.

Also, immer dieselbe Frage: Um was geht es? Was ist das Ziel?

English

Querying the API is not a problem (see e.g. here), but in this case it is unnecessary.
The path to the ASD can be queried with this small extension: Get the path of → ASD (app-specific dir) & → private data dir (internal storage) which (as I said) is not necessary in this case.

Btw, the block you posted makes little sense as it seems that you want to copy something from the ASD to the ASD.

So, always the same question: what is it about? What is the goal?