Closed bharatkhadodra1996 closed 3 months ago
You can download files at runtime using any HTTP library such as requests
, as long as your app has the INTERNET permission.
Having downloaded it, you can extract it into a directory and add the directory to sys.path
, or possibly add the ZIP to sys.path
directly if its internal structure is suitable.
Ok but in this case, I will have to code in python to download files. I need a solution in android because the zip file I am using already contain python.exe and other dependencies. So is it possible to download the zip file with android and then use it ?
Chaquopy doesn't use any python.exe, so I don't know what you mean by that. If you're trying to use a python.exe you got from somewhere else, that's very unlikely to work.
Of course you can download a ZIP with Java or Kotlin using their own standard libraries. But you'll still have to edit sys.path
in order to use it, so it would be easier to do the whole thing in Python.
I am using Pychubby python project in my android application. I have stored this project in server. Here is my gradle code.
python { pip { install "https://www.bharatk.com/myfiles/pychubby_master_1.zip" } }
Now my question is when I build apk, it includes this file at building time but I want to download this zip file at runtime when user install the application. So is that possible and if yes then how ?