Can I create an android APK from a single file, or do I need the full file structure typicaly created with "briefcase create"? #1159
-
If I have a simple single file app like: import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
class HelloWorld(toga.App):
def startup(self):
"""
Construct and show the Toga application.
Usually, you would add your application to a main content box.
We then create a main window (with a name matching the app), and
show the main window.
"""
main_box = toga.Box()
main_box.style=Pack(direction=COLUMN)
main_box.add(toga.TextInput(placeholder="yoo"))
main_box.add(toga.TextInput(placeholder="book"))
web = toga.WebView(url='https://google.com')
main_box.add(web)
self.main_window = toga.MainWindow(title=self.formal_name)
self.main_window.content = main_box
self.main_window.show()
def main():
return HelloWorld("foobar",
"org.foo.bar")
main().main_loop() Can I somehow take this file and package it to an android apk? Or will I need the file structure typically created with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So... yes, to both. The whole reason Briefcase exists is to package Python code as redistributable artefacts - that means AAB files on Android. APK files are produces as an intermediate artefact; there's an open issue (#1136) to expose APK as an output option. So, yes, you can take your file and package it for use on Android. You do that by creating the file structure that However, you don't need to distribute the contents of the folders generated by |
Beta Was this translation helpful? Give feedback.
So... yes, to both.
The whole reason Briefcase exists is to package Python code as redistributable artefacts - that means AAB files on Android. APK files are produces as an intermediate artefact; there's an open issue (#1136) to expose APK as an output option. So, yes, you can take your file and package it for use on Android.
You do that by creating the file structure that
briefcase create
provides. The files produced by Briefcase are the project structure for building the AAB/APK files needed on Android. You can't get the APK without producing those files.However, you don't need to distribute the contents of the folders generated by
briefcase create
- you only need to distribute the AAB…