This project is a lightweight Android wrapper for running any public Streamlit app inside a native Android WebView.
It allows you to:
- Wrap your Streamlit app in an Android interface
- Generate an
.apkor.aab - Publish it to the Google Play Store
📱 Ideal for data scientists, developers, educators or researchers who want to make their web-based apps available as native Android apps — without rewriting them in Java/Kotlin.
- Minimal native code (just a WebView)
- Compatible with Streamlit’s full interactivity
- Supports file uploads, plots, input widgets, etc.
- Works on Android 5.0+ (
minSdk 21) - Small app size (~5 MB)
git clone https://github.com/luiscunhacsc/androidwrapper4streamlit.git
cd androidwrapper4streamlit- Launch Android Studio
- Open the project directory
- Let it sync Gradle files
Open MainActivity.java and set your URL:
private String streamlitUrl = "https://yourusername-yourappname.streamlit.app";Ensure the URL is publicly accessible.
To be accepted on Google Play, you must use a unique package name — never use com.example.
Update the following to your own reverse domain name:
package com.joanasilva.myfinanceapp;Update the same in:
build.gradle:namespace 'com.joanasilva.myfinanceapp' applicationId "com.joanasilva.myfinanceapp"
- Rename folder structure:
app/src/main/java/com/joanasilva/myfinanceapp/MainActivity.java
This is caused by a mismatch in package names or errors in res files.
- Match package name everywhere (
MainActivity,build.gradle, folder) File > Sync Project with Gradle FilesBuild > Clean Project, thenBuild > Rebuild- Check for errors in XML files (e.g.,
activity_main.xml) - If needed:
File > Invalidate Caches / Restart
Google Play requires .aab files for new apps.
In Android Studio:
Build > Build Bundle(s) / APK(s) > Build Bundle (AAB)Output is in:
app/build/outputs/bundle/release/app-release.aab
To publish your app, the Play Console requires:
| Requirement | Description | Suggestions |
|---|---|---|
| ✅ Unique package name | Must not be com.example |
Use a reverse domain: com.nome.aplicacao |
| 📸 Screenshots | At least 2 screenshots (1080x1920) | Use Android Emulator + Shift+Cmd+S or `Screenly |
| 🖼️ App icon | 512x512 PNG | Use Canva or IconKitchen |
| 📜 Privacy policy URL | Public link is required | Use Notion, Google Docs, or GitHub Pages |
| 📋 Content Rating | Fill in Google's questionnaire | Done inside Play Console |
| 🌍 Countries & Pricing | Choose target countries | Usually set as “Free” |
| 🔒 Data safety form | Describe data collection (usually none) | Mark as: no data collected, no shared data |
| 📲 Target API level | Must be recent (e.g. 34) | Already set in build.gradle |
- In your Streamlit app, add:
st.set_page_config(layout="wide")- Use
st.button,st.radio,st.selectbox, etc., instead of complex drag/drop widgets - Keep pages light to reduce load time on mobile networks
MIT License — feel free to use and adapt.
Created by Luís Cunha to make Streamlit apps more accessible via the Android ecosystem.