I've made an app & website that lets you quickly try out java snippets on android, e.g. if you see a code snippet on stack overflow you can just copy paste it and throw it in and let it run on your phone. But I didn't continue with it because no one uses it :)
https://runondroid.com/