سؤال

I have an application that controls the A/C in my car. I use Kivy + Python for development. Now I need to make it running even if it is minimized. It works on Windows (obviously), but now I want to move it to Android tablet (Nexus 7). So I should use service.

What I have:

The principal scheme

I have an interface that shows the temperature and buttons. I can change temperature and click the buttons on the android device. The script sends via serial a command to arduino and arduino sends it to CAN Bus in the car. Another one device constantly reads the messages from another CAN Bus controller and sends it through the serial to the script.

Then I switch to navigation program (like Google Maps).

I push a button on the front panel in the car to change the driver temperature.

What I need:

I want the script do the makeToast command with a messagge like "Driver temperature: 25.5" and send the message to arduino.

How can I do it? Please send me an example, because I'm new in Android development.

هل كانت مفيدة؟

المحلول

I cannot speak to the QPython part, but for Kivy with python-for-android you will have to make the background part of the app an Android Service. Inastructions for getting started with Android Services in python-for-android are at http://python-for-android.readthedocs.org/en/latest/android/#service-android-service

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top