Improved build script with APK generation