Apps/Games running in the background for mobile

chongyunxiang

  • Posts: 278
Hi,

Is it possible to make games on Stencyl that runs in the background when player switches to other apps? Like keeping it on and running in the background, not closed entirely. Because I want to create a system in the game that counts the players steps, like those health apps.

Will doing an Extension be feasible?

squeeb

  • Posts: 1617
Yes.. an extension will work.  Nobody has made one to my knowledge.   This question has been asked many times.  I know the code and what it does to make an app run in the background natively... I dont know how to get it into an extension with blocks into stencyl

chongyunxiang

  • Posts: 278
Is there someone who can help you get it into an extension? I think these and the mobile phone sensors (gyro,pedo,accelerometer) are all pretty essential tools and having it as an extension will make it easier to work with.

squeeb

  • Posts: 1617
Is there someone who can help you get it into an extension? I think these and the mobile phone sensors (gyro,pedo,accelerometer) are all pretty essential tools and having it as an extension will make it easier to work with.
I agree!

Luyren

  • *
  • Posts: 2799
Is there someone who can help you get it into an extension? I think these and the mobile phone sensors (gyro,pedo,accelerometer) are all pretty essential tools and having it as an extension will make it easier to work with.
For the record, you already have blocks for the accelerometer.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

chongyunxiang

  • Posts: 278
Is there someone who can help you get it into an extension? I think these and the mobile phone sensors (gyro,pedo,accelerometer) are all pretty essential tools and having it as an extension will make it easier to work with.
For the record, you already have blocks for the accelerometer.

That's nice! I'm looking at the pedometer. Are there blocks for it?

Luyren

  • *
  • Posts: 2799
That's nice! I'm looking at the pedometer. Are there blocks for it?
From what I've read, cellphones use GPS data or the accelerometer to count steps. There doesn't seem to be a "pedometer sensor." You could look into how to use the accelerometer to count steps.

Answering your question: there isn't a block for pedometer, unless there's an extension somewhere that does that.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

squeeb

  • Posts: 1617
I think the big question was how to make stencyl apps run in the background. 
You can then use the accelerometer blocks to make a pedometer to count steps... or make an extension that can use the phone's pedometer counting.

designpeg

  • *
  • Posts: 731
Hi, rather than getting your app to run in the background to collect pedometer data, could you not use existing collected data from https://developer.apple.com/healthkit/  or the android equivalent?  and just use your app to display this?

squeeb

  • Posts: 1617
^^ that's the other option... would be an extension as well

johnmcqueen

  • Posts: 2
I think the option that is above works, and the stencyl apps will run in the background, accelerometer should be the best option. What other the different variants we can use to run stencyl apps in the background not as an extension?