I am trying to build a solution that listens to data coming from an ESP32. The ESP and my phone are in my home network. They are conencting nicely and I can see the data coming in. The ESP is acting as the server and my solution is connecting to this server as needed. Once I have actively connected to the ESP, it is critical that the app keeps running until I actively close the connection. The problem I have is that my phone/OS is killing the app/process after a while. That makes my app unuseable.
I put everything in the app I could find in the forum and other sources. The last idea I found was to run the app as a foreground service. Also that is not working and the OS is still killing the app randomly after some time.
I have attached my app.
I would appreciate any help and support. Please let me know if it is possible to do what I am aiming to do, or what I am doing wrong, or what I am missing.
Many thanks
René
As I wrote in the other thread, the first step is to switch to B4XPages.
An app with a foreground service should be kept running, though practically the OS might still kill the process.
BTW, it looks like you are creating a notification with the same id as the foreground notification.
Mann thanks for the Response. I really appreciate this and without your help and the support from this forum I wouldn't have been able to create my little solutions. You have my deepest admiration for what you have achieved.
Now, please forgive me my ignorance. I was and I am fully focussed on B4A, since I have Android phones and tablets. What is the difference between B4A and B4X, why would the app not be killed in B4X but it is being killed in B4A?
Is there something like a tutorial I could use to make myself familiar with the differences?
As I wrote in the other thread, the first step is to switch to B4XPages.
An app with a foreground service should be kept running, though practically the OS might still kill the process.
BTW, it looks like you are creating a notification with the same id as the foreground notification.
many thanks for your advise. I moved my app to B4Xpages and made good use of your Location app as basis for what I want achieve. It is now running really smootly. Great job. Normally I would say, let me know how I can help as payback, but what you and many other here are doing is far over my head. And it is this community that allows little people like me to achieve amazing things. Thanks to all.