whether or not clearing the cache is actually the solution is unclear, but if you absolutely must do it from the app, you can try this code:
Log("trying to clear cache")
jo.InitializeContext
Dim appmanager As JavaObject
appmanager = jo.RunMethodJO("getSystemService",Array("activity")).RunMethod("clearApplicationUserData",Null)
but you need to know:
"(the command) permits an application to erase its own data from disk. This is equivalent to the user choosing to clear
the app's data from within the device settings UI. It erases all dynamic data associated with the app -- its private data
and data in its private area on external storage -- but does not remove the installed application itself, nor any OBB files.
It also revokes all runtime permissions that the app has acquired, clears all notifications and removes all Uri grants
related to this application." don't say you weren't told.
you also need to know that the command kills the app. don't say you weren't told.s o there is no way to know from within
the app if the command has been successful. presumably, if you re-launch the app, it was successful. presumably, you could
also check the app's storage and cache before issuing the command and then having a look afterwards.
since the command kills the app (with no notice), you'll have some explaining to do to your users.