Good day
I want to build cross-platform mobile app with python kivy.The problem is that I don't have mac to test project on ios emulator.Do you have any idea.Or can i just test it only on android phone and will it work the same in iphone?
i have used kivy before, sometimes the code runs well on a platform don't guarantee that it will do the same in another, so it is always a good practice to test your app on both platform. if you don't have access to a mac, i recommend you using services such as MacInCloud VirtualMacOSX XCodeClub or other alternatives to test and build your app for ios. (if you are lucky you may find free trial on some of the alternatives)
Related
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
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.
I need to develop a daemon service which also has presence in System Tray. The system tray icon allows users to customize/access some options through right click menu. It might open a window as well manage those options in a better way.
The app would mostly be communicating with a RESTful service, posting and downloading files.
Now I know that for any daemon service, it needs to be native. However we don't have the luxury to maintain 3 different dev pipelines, specially since the app is experimental(but might land up in hands of users)
I have experience in Java/Scala, followed by C++/Python/JS. I would prefer java/Scala (existing codebase) but open to frameworks in other languages.
I was thinking of doing a scala based app with swing for windowing, but it is not pretty.
Any ideas?
We have an App, same base code, running on Windows, OSX and Linux (with system tray) using these two set of components:
The Tanuki Java Service Wrapper to handle the lifecycle of the app. It also allows installing the component as a "native" windows service. Version 3.2.3 is under LGPL if that helps.
The Java 6 java.awt.SystemTray which is supported on most platforms. On OSX, we use a modified version of macify to implement OSX specific gimmicks like doc icons
You could go with JavaFX and the ScalaFX bindings. They look to be very actively maintained, and the syntax seems pretty clean. Only trouble is that it seems to have poor support for using the system tray - see this discussion for details and some workarounds.
You can use Real Studio to create a Windows Service and OS X/Linux daemons. Real Studio creates native apps for Windows, OS X and Linux.
Does Apple accept Python applications for distribution on the new Mac App Store?
If so, how should the application be packaged? Is py2app sufficient? Something else?
I packaged Pennywise, which is available on the Mac App Store. It's based on Virgil's moneyGuru, which uses Python, PyObjC, and py2app.
You will have to follow Apple's process for preparing an application for submission to the Mac App Store. Most importantly, you will want to add the proper keys to your Info.plist, and remove any automatic updating mechanism, e.g. Sparkle. It's not strictly required, but you will probably also want to implement receipt checking. Using Xcode will make the submission process much easier. You can look at the moneyGuru source code for an example of how to use Xcode as the final part of the build process.
Py2app embeds a copy of the Python framework in the bundle, so I don't know whether Apple would approve an application that only linked to the system framework. While the primary binary can't support PPC, Apple does not seem to check the architectures of binaries in embedded frameworks.
One final caveat: I wouldn't recommend this process for writing new applications. Using Python, PyObjC, and py2app seriously complicates the build process and introduces additional dependencies.
I know it's possible because I know of at least one Python-based app that is in the app store ("Pennywise", which is based on my own app, moneyGuru, which uses Python + PyObjc + py2app). I didn't do it myself, so I'm not sure of the details.
I wrote a comprehensive article explaining how to build and submit a Python app to the Mac App Store. It includes source code and build scripts for a barebones example app that I have successfully submitted.
Submitting a Python App to the Mac App Store
Yes, it is possible, as long as you adhere with the full set of approval guidelines. This means that the python interpreter will have to be bundled into your application, for example.
See here for a full list of requirements:
https://developer.apple.com/appstore/mac/resources/approval/guidelines.html
It is quite possible. My app is currently listed:
http://itunes.apple.com/us/app/quickwho/id419483981?mt=12&ls=1#
Bundled up with py2app, no worries.
Apple provides the Build Applet tool for Python with Xcode so it should be supported by the App store. MacOS X 10.6.6 includes Python 2.5 and 2.6 as part of the default install, you can specify /usr/bin/python2.5 and /usr/lib/python2.5.
I have a Django application that I would like to deploy to the desktop. I have read a little on this and see that one way is to use freeze. I have used this with varying success in the past for Python applications, but am not convinced it is the best approach for a Django application.
My questions are: what are some successful methods you have used for deploying Django applications? Is there a de facto standard method? Have you hit any dead ends? I need a cross platform solution.
I did this a couple years ago for a Django app running as a local daemon. It was launched by Twisted and wrapped by py2app for Mac and py2exe for Windows. There was both a browser as well as an Air front-end hitting it. It worked pretty well for the most part but I didn't get to deploy it out in the wild because the larger project got postponed. It's been a while and I'm a bit rusty on the details, but here are a few tips:
IIRC, the most problematic thing was Python loading C extensions. I had an Intel assembler module written with C "asm" commands that I needed to load to get low-level system data. That took a while to get working across both platforms. If you can, try to avoid C extensions.
You'll definitely need an installer. Most likely the app will end up running in the background, so you'll need to mark it as a Windows service, Unix daemon, or Mac launchd application.
In your installer you'll want to provide a way to locate a free local TCP port. You may have to write a little stub routine that the installer runs or use the installer's built-in scripting facility to find a port that hasn't been taken and save it to a config file. You then load the config file inside your settings.py and whatever front-end you're going to deploy. That's the shared port. Or you could just pick a random number and hope no other service on the desktop steps on your toes :-)
If your front-end and back-end are separate apps then you'll need to design an API for them to talk to each other. Make sure you provide a flag to return the data in both raw and human-readable form. It really helps in debugging.
If you want Django to be able to send notifications to the user, you'll want to integrate with something like Growl or get Python for Windows extensions so you can bring up toaster pop-up notifications.
You'll probably want to stick with SQLite for database in which case you'll want to make sure you use semaphores to tackle multiple requests vying for the database (or any other shared resource). If your app is accessed via a browser users can have multiple windows open and hit the app at the same time. If using a custom front-end (native, Air, etc...) then you can control how many instances are running at a given time so it won't be as much of an issue.
You'll also want some sort of access to local system logging facilities since the app will be running in the background and make sure you trap all your exceptions and route it into the syslog. A big hassle was debugging Windows service startup issues. It would have been impossible without system logging.
Be careful about hardcoded paths if you want to stay cross-platform. You may have to rely on the installer to write a config file entry with the actual installation path which you'll have to load up at startup.
Test actual deployment especially across a variety of firewalls. Some of the desktop firewalls get pretty aggressive about blocking access to network services that accept incoming requests.
That's all I can think of. Hope it helps.
If you want a good solution, you should give up on making it cross platform. Your code should all be portable, but your deployment - almost by definition - needs to be platform-specific.
I would recommend using py2exe on Windows, py2app on MacOS X, and building deb packages for Ubuntu with a .desktop file in the right place in the package for an entry to show up in the user's menu. Unfortunately for the last option there's no convenient 'py2deb' or 'py2xdg', but it's pretty easy to make the relevant text file by hand.
And of course, I'd recommend bundling in Twisted as your web server for making the application easily self-contained :).