Running an application in the background

Write a short description

Hi,

i’m new in using kodular but very happy with this cool API.

What i want to create is a app which runs in the background (means keeps running also if user closes the app window). The app should call an URL every x seconds and - if the URL respond is “1” - show an alert message.

What I have already accomplished:
When you start the app, the URL is called every 20 seconds and an alert message is displayed when the return value is “1”.

But:
As soon as you start another app or the app comes out of focus, the alarm message is no longer displayed (out of focus)–> But the alarm message should immediately come to the foreground when pending.

In addition, the app should still work when you close it, i.e. the call of the URL every x seconds should also continue to take place in the background.

I have already googled and apparently the Background Task Extension is exactly what I am looking for. But: I can’t find a suitable tutorial.
Do you have an example for me?

By the way:
Another problem is, that the app (as it is at the moment) works with the companion app but if i export, the following error message is in the log file:

Kodular is unable to compile this project.
The compiler error output was
________Preparing application icon
________Creating animation xml
________Creating fragment xml
________Creating listview xml in res/layout/..
________Creating listview xml in res/layout-v21/..
________Creating xml in res/drawable/..
________Creating splash png in res/drawable/..
________Creating colors xml
________Creating styles xml
________Creating drawables xml v21
________Checking for firebase
________Creating provider_path xml
________Creating network_security_config xml
________Generating adaptive icon file
________Generating round adaptive icon file
________Generating adaptive icon background file
________Generating manifest file
________Attaching native libraries
________Attaching Android Archive (AAR) libraries
________Attaching component assets
________Invoking AAPT
YAIL compiler - AAPT execution failed.

Would be great to get help her too.

Best wishes
Daniel

1 Like

It seems more more people are facing this issue. What I do is, after opening project, I build apk at first chance. if I get this error then I delete the project and try again. sometimes it takes 6/7 tries.

Hi,

the problem why my app has not been exported was that there was not Theme selected in the project settings. After i selected the default Theme exporting worked.

But can u help me getting the background thing working ?

Best wishes

Daniel

you mean background task? I may help. upload your aia file here.

This is the best way fot you to do what you need. But it is not easy. If you are still new in kodular i is probably better if you pay someone (may be the developer of the extension) to do what you need while you learn how to use it properly.
Anyway, the best place for you to get tips and help is in the topic about the extension:

If you read the entire topic or search by the keywords you will find a lot of tips to help and you can post there or create a new thread if you have a specific problem.

But just say that you know that the extension exists is not enought for someone to help you. You must try something and then if you have problems you show your blocks so others can try to help you

2 Likes

Hi,

thank you for your answer.
I will try my best and come back with some blocks :wink:

Best wishes
Daniel

1 Like