Run on background, change screensaver and more.

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ermask
Posts: 2
Joined: Wed Feb 26, 2014 10:45 pm

Run on background, change screensaver and more.

Post by Ermask » Sat Mar 01, 2014 9:33 pm

Hi ppl. I'm new to livecode, so i want to know if i can do some things with it on android. I have different questions and if someone is able to answer me and say what command or function i need to use, it will be very helpfull. Don't need to write full examples. Only the functions and, hopefully, i'll be able to learn the rest.

-Ii's possible to make an app that runs on the background?

-its possible to make an app that check the clock, and date to trigger events (like an alarm)

-it's possible to make an app that changes the background picture?

-And finally, its possible to change the screen saver with and app?

I'll be very glad if someone can help me with something. As i said, only the main commands or functions means a lot to me.
Thanks for your help guys.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Run on background, change screensaver and more.

Post by Simon » Sat Mar 01, 2014 10:52 pm

HI Ermask,
Welcome to the forum :)
I can answer some of your questions
-Ii's possible to make an app that runs on the background?
No, apps are automatically removed from memory when the device requires the space. For iOS there is http://mergext.com/home/mergbgtask/ and an unsupported hack.
-its possible to make an app that check the clock, and date to trigger events (like an alarm)
Yes, look up localNotification
-it's possible to make an app that changes the background picture?
The background picture of the device? Not that I know of.
-And finally, its possible to change the screen saver with and app?
Do Android devices have a screen saver? Neither of the two I own do, they just go black.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Ermask
Posts: 2
Joined: Wed Feb 26, 2014 10:45 pm

Re: Run on background, change screensaver and more.

Post by Ermask » Sun Mar 02, 2014 12:21 am

Thanks for the fast reply, and for all the info you gave me. Really usefull for me. But it makes me to ask another question. About the run on background.
For example, whatssap runs when andriod starts runing too. It does like a service. Is there a way to do the same with livecode?
I saw some apps that works like schedule, giving you messages or advices at the fixed hour and day you choose, and they just start running at the same time you turn on the phone. That is something i'm looking for.
Thanks again for your help.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Run on background, change screensaver and more.

Post by Simon » Sun Mar 02, 2014 1:08 am

Hi Ermask,
Very sorry it's mobileCreateLocalNotification one uses to create an "Alarm". If you read the info on that you'll see that it is not your app running in the background but a message held by the OS.

A simple example of the current state of liveCode in regards to background running.
I build an app that just counts up forever.
Start it up and I can see it counting.
Select another app
Is my app still counting? Maybe, you couldn't rely on it as the new app may need all the memory available to run and Android will happily shut down my app. Currently we have no way of stopping the OS from doing that.

As for background running like whatsapp I don't see a way of currently doing that. I think it polls the server when it's not actually running. Still I don't know how one would do that.

Also look up urlWakeUp.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply