This page (everything below that divider line) was mostly written by GarboMuffin (who is also the TurboWarp Packager's creator) in a packager pull request, credit goes to him.
The styles are also taken from the packager's source code, which is licensed under Apache-2.0.
I just put this on its own webpage, with some modifications to account for this not being part of the packager (and thus not being able to generate some parts), for convienience so an easily readable version can be linked to.
-CST1229
This section assumes you have full access (including adminstrator/root) to a Windows, macOS, or Linux computer.
This is quite large and may take a while.
Create a new project in Android Studio.
My Project
"org.turbowarp.packager.userland.PACKAGENAME
" (replace PACKAGENAME with your project's package name; it should be a unique name used only by your application)In the sidebar on the left, right click on "app", then select "New" > "Folder" > "Assets folder". Use the default settings.
Package the project as a zip normally.
Extract the zip and drag its files into "assets" folder you created. (You can directly drag and drop files over the assets folder in Android Studio)
In the sidebar on the left, navigate to app > src > main > MainActivity. This will open a short Kotlin file.
Replace everything after line 2 with the following:
import android.annotation.SuppressLint import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.webkit.WebView class MainActivity : AppCompatActivity() { private lateinit var web: WebView @SuppressLint("SetJavaScriptEnabled") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) web = WebView(this) web.settings.javaScriptEnabled = true web.loadUrl("file:///android_asset/index.html") setContentView(web) actionBar?.hide() supportActionBar?.hide() } override fun onDestroy() { super.onDestroy() web.destroy() } }
Make sure to leave the first line that says package ...
At this point, you have a functional Android app. However, there are still a few more things you should change.
In the sidebar on the left, open app > main > AndroidManifest.xml
Find the section that looks like this:
<activity android:name=".MainActivity" android:exported="true">
And replace it with this:
<activity android:configChanges="orientation|screenSize" android:screenOrientation="sensor" android:name=".MainActivity" android:exported="true">
Currently the app has a purple color scheme, which may not be what you want. This can be changed.
In the sidebar on the left, open app > main > res > values > color.xml.
You will see these lines:
<color name="purple_200">#FFBB86FC</color> <color name="purple_500">#FF6200EE</color> <color name="purple_700">#FF3700B3</color>
Replace the colors (the parts after #FF) with your background hex color, for example:
<color name="purple_200">#FF4D97FF</color> <color name="purple_500">#FF4D97FF</color> <color name="purple_700">#FF4D97FF</color>
Do not change the other lines.
For advanced users, note that these color codes are a bit unusual in that the "alpha" or "transparency" byte (typically 255
or FF
) goes first instead of last.
Ignore the bits about purple_yyy
; just leave them as is. It would typically be a good idea to rename these colors, but you will be making more work for yourself because you'll have to update some other files to reflect the new names.
It's likely that at some point you will want to update the project without redoing this entire guide. Updating a project is much simpler: