If you want platform independence then folks write web apps and use Apache Cordova to make it into a mobile app for a specific platform.
If you just want to play then checkout Processing.org with the Android SDK where you can write processing sketches that can be sideloaded onto an Android device.
There are also some on-device apps that provide a programming environment:
- Pythonista on iOS
- Codea on iOS
- APDE on Android (on-device processing sketches)
- AIDE on Android (java on android)
Xcode for iOS is the official means of writing Apple apps in either Objective-C or in Apple's Swift. However, to upload apps you need a developer license from Apple and must get your app vetted by them for commercial use.
Android has a similar development environment using IntelliJ tools: