urltoapp.dev
Convert a link

Turn a Streamlit or Gradio app into an Android app

Python data apps and AI demos are built for laptops, but people want to try them on their phone. A URL app gets them there — with a few Streamlit-specific fixes.

Updated Oct 20262 min readurltoapp.dev

Short answer

Use the app's direct URL (for Hugging Face Spaces, the *.hf.space address rather than the Space page with its frame). Keep Streamlit's sidebar collapsed on mobile, set layout="centered", and remember free hosting sleeps: the first open after idle can take a while, so the app's loading screen matters.

Pick the right URL

  • Streamlit Community Cloud: https://yourapp.streamlit.app. Add ?embed=true to hide Streamlit's toolbar and footer.
  • Hugging Face Spaces: open the Space, ⋮ → Embed this Space, copy the direct https://user-space.hf.space URL. The normal Space page wraps your app in Hugging Face's own UI.
  • Gradio share links (*.gradio.live) expire after a few days — never use them in an app.

Cold starts

Free tiers sleep idle apps. The first visitor waits while it wakes — sometimes with a “wake up” button. For an app, pay for always-on hosting or a paid Space hardware tier, or users will think the app is broken.

Mobile layout

st.set_page_config(page_title="My Tool", layout="centered",
                   initial_sidebar_state="collapsed")

Put the main inputs in the page, not the sidebar; on phones the sidebar hides behind a tiny arrow.

Uploads and the camera

st.file_uploader and st.camera_input need the app's file chooser and camera permission (see uploads). Gradio's image and audio inputs likewise.

FAQ

Can I turn a Hugging Face Space into an app?

Yes, use the direct *.hf.space URL as the start URL.

Do Streamlit websockets work in a WebView?

Yes. WebViews support WebSockets; interactivity works as in mobile Chrome.

Read next