<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Indie-Developer</title>
    <description>The latest articles on DEV Community by Indie-Developer (@securityf).</description>
    <link>https://dev.to/securityf</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3976352%2F38de7570-1606-45cd-8279-36fc75163de7.png</url>
      <title>DEV Community: Indie-Developer</title>
      <link>https://dev.to/securityf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/securityf"/>
    <language>en</language>
    <item>
      <title>Why there is no Python inside an ApkPy APK</title>
      <dc:creator>Indie-Developer</dc:creator>
      <pubDate>Sat, 24 Oct 2026 19:01:39 +0000</pubDate>
      <link>https://dev.to/securityf/why-there-is-no-python-inside-an-apkpy-apk-2ecm</link>
      <guid>https://dev.to/securityf/why-there-is-no-python-inside-an-apkpy-apk-2ecm</guid>
      <description>&lt;p&gt;When I show ApkPy to someone, the first question is almost always the same: how does this run Python on Android?&lt;/p&gt;

&lt;p&gt;It doesn't. ApkPy reads &lt;code&gt;writehere.py&lt;/code&gt; and writes Java and XML. The APK from &lt;code&gt;apkpy run&lt;/code&gt; has activities, layouts, drawables and a manifest, the same as an app built by hand in Android Studio. There is no Python interpreter inside, no WebView, and no CPython compiled as a library.&lt;/p&gt;

&lt;p&gt;I chose translation over embedding because of size. In the benchmark I published, the same 100-note app was 5.37 MiB in debug and 1.48 MiB in the signed release. With an interpreter inside, the starting point would be different. And because the generated code is plain Java, the camera and background audio are Android APIs, not bridges to them.&lt;/p&gt;

&lt;p&gt;The cost shows up when I write Python ApkPy cannot translate yet. The build stops on that line and says what to write instead.&lt;/p&gt;

&lt;p&gt;1.14.0, out on October 20, was mostly about that. Most of the Python people write every day now goes through: &lt;code&gt;a, b = parts&lt;/code&gt;, &lt;code&gt;for key, value in d.items()&lt;/code&gt;, &lt;code&gt;items.pop()&lt;/code&gt;, &lt;code&gt;sorted()&lt;/code&gt;, comprehensions inside functions, f-string widths (&lt;code&gt;{n:05d}&lt;/code&gt;), &lt;code&gt;*args&lt;/code&gt;, functions inside functions, recursion, &lt;code&gt;try/except&lt;/code&gt; and &lt;code&gt;for ... else&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Some of it was less visible than new syntax. The generated Java is now checked against CPython on the same inputs, accents and emoji included.&lt;/p&gt;

&lt;p&gt;1.14.0 also tightened installation. &lt;code&gt;apkpy setup&lt;/code&gt; now checks the sha256 of everything it downloads.&lt;/p&gt;

&lt;p&gt;The Python that translates is listed on Compatibility and limits.&lt;/p&gt;

&lt;p&gt;If you want to try it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--upgrade&lt;/span&gt; apkpy
apkpy start hello
&lt;span class="nb"&gt;cd &lt;/span&gt;hello
python writehere.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;writehere.py&lt;/code&gt; opens the Previewer. &lt;code&gt;apkpy run&lt;/code&gt; generates the Android project and builds a debug APK next to it.&lt;/p&gt;

</description>
      <category>python</category>
      <category>android</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
