APK How to use Android Bundle for fix GooglePlay Error - python

I'm just finished my coding and trying to upload to Google Play. Actually it's hard to upload just like coding:) So, I had to learn something about SDK and architect. I figured out how to fix'em and use. But at the end, when I'm trying to upload on GooglePlay, I'm getting this error.
ERROR (Actually warning):
Unoptimized APK Warning:
This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices.
Resolution:
Use the Android App Bundle to automatically optimize for device configurations, or manage it yourself with multiple APKs.
I didn't see any "pass" button or smt. Like that for this WARNING. So I think I have to fix that first.
I checked websites for solution but couldn't find anything for non coding on Android Studio apks. I mean, I coded this apk on PyCharm then created with buildozer after signed by keytool. The main question is, how can I generate signed bundle apk on Android Studio, with my created APK or coded .py files.

I never built an Android app in this way but I understand your problem [and your frustration]
I gave a look around and I found this:
If you don't want to use Android Studio or Gradle tasks to build
bundles — for example, if you use a custom build toolchain — you
can use bundletool from the command line to build an app bundle from
pre-compiled code and resources. If you haven't already done so,
download bundletool from the GitHub repository

Related

pydroid3 python program converted to android app with buildozer will not start on android How can I debug?

I created a kivy app in python using pydroid3 It is quite simple, a single button. It works on the android device when run from pydroid3.
I successfully converted the python app to an android app using bulldozer.
Primary Question
I cannot get any debug feedback from the android device as to why the application crashes at start-up.
Can someone help find the location of some sort of android logs similar to syslog or PHP log in Ubuntu.
Here is what I have done to solve this problem myself:
I found documentation on how to properly configure the conversion with buildozer.spec. Soon I realized that I was adding all the python modules involved in the program - but most documentation says that buildozer scans the original files and imports the necessary modules, but still after numerous failures, I added as many as I determined needed to be included.
Each time I start the app on the android 10 device (a radio head), it just crashes upon opening. No error messages etc. I find it unexpected that there is no way to view some kind of Syslog in android. But still, I continued.
I installed android desktop (AD) on my Mac laptop and then connected it to the android head unit and setup the unit to allow USB debugging. I was able to get AD to spew out endless lines of real-time data in the Logcat display.
I was not able to identify anything related to my app in the output provided by logcat: a search using the filter resulted in nothing associated with my app's name. Further, nothing shows up searching for "error" "failure, "failure to load," etc -- that might have given me a clue.
Next Question
Are there any documents related to how to create a program in python, using buildozer, and then install and debug the app in android?
I am sure this is one simple missing module or a similar issue that should be glaring in an error log somewhere.
Thanks for any help.
Jack
.
see the information above

Is it possible to use python and kotlin to build android project?

I'm building an android application and I have some scripts in python I want to use (and not to translate) in this very project.
Right now I'm using 'Chaquopy' to make it work but I dont like the SDK it self, sometimes it crushes my app, and it restricted to use 5 minutes of the app.
the only choice for now is either to pay for it or to publish my code (which is not ready yet) in GitHub - and keep it up to date to avoid the restrictions.
So here I ask if anyone can guide me to other packages that provide the same service without the this hassle...
my python scripts job - downloading a GZ file, getting the file inside it, reading and tranfersing XML to JSON and return to my kotlin JSON text.
I read about Kivy but it seems to build full Python application in android and I can't use it as kotlin+python in the same project..
I'd appreciate any help/guidelines
thanks.

create android, iOS libraries from python, including dependencies

We working on a project which involves ML/AI integration to the native mobile application. We are programing our ML/AI code in python. Python code has dependencies, that we need to include in our mobile application.
We have tried with kivy but they only create .apk files and apk files can't be called from other apks. So, we need to create libraries that can be included in the android and ios projects.
Also, we tried chequopy but that doesn't support mediapipe which is in heart of our implementation.
Any guidance in that direction will go long way for us.
If your app was entirely self-contained in python including dependencies using recipes should be possible. If rewriting the native app is not an option maybe one idea is to serve the ML over an HTTP API running on a local server (eg flask). Quite cumbersome as users would need to install two apps

How to write android applications in python on an android device?

I am currently learning Python as part of my job and was interested in the possibility of creating android applications using what I am learning. Unfortunately I only have access to a computed at work and the system is pretty locked down in that I cannot export work I create etc and the only device I have during my leisure time is my android phone.
I have heard about the possibility of using Kivy but have only seen reference to this being used on MacOS, Linux or Windows making me think my only choice would be running a virtual machine which would be less convenient than running a native tool. I have also seen that AIDE is a great tool for android app development on mobile but can only be used with C++/Java which would involve learning additional languages and PyDroid3 being a great python tool but don't know how this could be used to create android apps.
Any experience or knowledge in this area would be much appreciated. I understand the best scenario would be to either buy a laptop/pc and use PyCharm and/or Kivy or to learn Java and used the official Android development suite but in my current situation this is not possible.
Just download pydroid3 from play store and follow the steps to create an android app.
Install kivymd module using pip in pydroid3.
Watch kivymd tutorials on youtube to learn kivymd module , you can also refer to kivymd documentation on google.
Develop application using kivymd module in pydroid3.
Convert your python file to apk using kivy buildozer in google colab in chrome on your mobile phone.
I haven't used kivymd but I have used kivy in pyroid3 and it works really well on a phone. Also when you run the code it gives a really good indication of how the final app will look on the phone. But that said I have only used Buildozer to compile the .APK and this only works in Linux so for me that ment virtual Linux system.

How do I connect to an external Oracle database using the Python cx_Oracle package on Google App Engine Flex?

My Python App Engine Flex application needs to connect to an external Oracle database. Currently I'm using the cx_Oracle Python package which requires me to install the Oracle Instant Client.
I have successfully run this locally (on macOS) by following the Instant Client installation steps. The steps required me to do the following:
Make a directory called /opt/oracle
Create a symlink from /opt/oracle/instantclient_12_2/libclntsh.dylib.12.1 to ~/lib/
However, I am confused about how to do the same thing in App Engine Flex (instructions). Specifically, here's what I'm confused about:
The instructions say I should run sudo yum install libaio to install the libaio package. How do I do this on GAE Flex? Or is this package already available?
I think I can add the Instant Client files to GAE (a whopping ~100MB!), then set the LD_LIBRARY_PATH environment variable in app.yaml to export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH. Will this work?
Is this even feasible without using custom Docker containers on App Engine Flex?
Overall I'm not sure if I'm on the right track. Would love to hear from someone who has managed this before :)
If any of your dependencies is not available in the base GAE flex images provided by Google and cannot be installed via pip (because it's not a python package or it's not available in PyPI or whatever other reason) then you can't use the requirements.txt file to get it installed in your GAE flex app.
The proper way to satisfy such dependencies would be to build your own custom runtime. From About Custom Runtimes:
Custom runtimes allow you to define new runtime environments, which
might include additional components like language interpreters or
application servers.
Yes, that means providing a custom Docker file. In your particular case you'd be installing the Instant Client and libaio inside this Dockerfile. See also Building Custom Runtimes.
Answering your first question, I think that the instructions in the oracle website just show that you have to install said library for your application to work.
In the case of App engine flex, they way to ensure that the libraries are present in the deployment is with the requirements.txt textfile. There is a documentation page which does explain how to do so.
On the other hand, I will assume that "Instant Client Files" are not libraries, but necessary data for your App to run. You should use Google Cloud Storage to serve them, or any other alternative of Storage within Google Cloud.
I believe that, if this is all what you need for your App to work, pushing your own custom container should not be necessary.

Categories