Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

App pause behavior
Started by laurasweet8888 Jan 06 2020 07:35 AM

- - - - -
7 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 125 posts
  • Corona SDK

All, 

 

   Happy 2020 everyone!  I have a question on how an app is supposed to behave.  

 

I have written an app that uses sockets to send mqtt messages to a broker which includes all the phone sensors.  It seems to work great.  I am in early testing phase.  The app stops sending events when the phone screen dims.  So the user has to keep touching the screen to keep the events flowing.  

 

  Qs: 

 

1.  Is this how it is supposed to work?   Is there a way to turn that behavior off?  

 

2.  If 1. == true then Is there a trick to keeping the screen from dimming?  

 

L

 



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,175 posts
  • Corona SDK

1) Yes, Corona apps don't support running in the background. I don't think that there are any easy ways of disabling that.

 

2) http://docs.coronalabs.com/api/library/system/setIdleTimer.html


  • laurasweet8888 likes this

[TOPIC: post.html]
#3

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 125 posts
  • Corona SDK

Thanks,  for the info. 

 

Just so I understand,  if I wanted to create a music application I would have to burn the screen all the time to let the music play?  



[TOPIC: post.html]
#4

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,175 posts
  • Corona SDK

Yep.

 

There may be some ways to get the app to keep playing music (or remain active) even when suspended, but that'd require Corona Native and I'm not sure if it'd be possible even with that.



[TOPIC: post.html]
#5

laurasweet8888

[GLOBAL: userInfoPane.html]
laurasweet8888
  • Contributor

  • 125 posts
  • Corona SDK

Maybe leaving the screen on, dimmed with a screen saver of some kind.  

 

Is there a way to know if the phone is plugged in?   Maybe only leave it play when charging or above 50% charge.  



[TOPIC: post.html]
#6

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 170 posts
  • Corona SDK

Souns like a bad idea but yes it can be done. Google for it.

[TOPIC: post.html]
#7

ray6

[GLOBAL: userInfoPane.html]
ray6
  • Observer

  • 11 posts
  • Corona SDK

A followup question: is there a way to set the timeout value for the idle timer?



[TOPIC: post.html]
#8

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,205 posts
  • Corona SDK

Corona is the wrong tool for what you want.  You'll need to go to native development to allow your app to run in the background.


  • ray6 likes this


[topic_controls]
[/topic_controls]