LiveCode program on mobile

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Re: LiveCode program on mobile

Post by MarkoSato » Wed Jun 01, 2016 9:29 am

anyone? :|

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: LiveCode program on mobile

Post by Klaus » Wed Jun 01, 2016 1:09 pm

Hi Marko,
MarkoSato wrote:...
I have several ".wav" files for every card.
Do I have to set all of them into the special Folder? So that I have several lines for each sound file?
add all of your sounds (or better a complete folder full of sounds) via the "Copy files" tab in the standalone builder settings!
Then they will be accessible via:
specialfolderpath("resources") & "/name_of_sound_file.wav"
OR
specialfolderpath("resources") & "/all_my_sounds_folder/name_of_sound_file.wav"
MarkoSato wrote:

Code: Select all

"on mouseUp
set the beepsound to specialFolderPath("engine") & "/sound.aiff"
beep                 --> what is the "beep" for?
end mouseUp"
But I don't have a "beepsound" , it's just a normal mp3 converted in wav.
What do you think will this script do?

It will tell iOS to NOT use its cheap" build-in BEEP sound but to use YOUR SPECIAL SOUND FILE named "sound.aiiff"
when you scripts read "BEEP"!

There are many ways to play a sound file, setting the BEEP sound is one of them.
When do you want to play a sound?

Remember you can always:
...
play (specialfolderpath("resources") & "/name of your sound file.wav")
...
MarkoSato wrote:*Edit: Beside that,, I have the problem that the application crashes always at the same card. Shortly before the end I have some cards with animations like a "credits" scene, but the app will always close in the same place. I could not figure out what the problem is.
We need to take alook at the script(s) to be able to check what might go on!


Best

Klaus

MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Re: LiveCode program on mobile

Post by MarkoSato » Thu Jun 02, 2016 10:34 pm

Hello,

Klaus you are my hero! I did exactly like you said and the sound works completely fine. Thank you a lot! :D

I still have the problem with the crashing at the same place though
We need to take alook at the script(s) to be able to check what might go on!
What do you mean with this exactly ?

- Also, it takes almost 10-15 seconds after I click the app to open, which is weird.

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: LiveCode program on mobile

Post by Klaus » Thu Jun 02, 2016 10:57 pm

Hi Marko,
MarkoSato wrote:...
I still have the problem with the crashing at the same place though
We need to take alook at the script(s) to be able to check what might go on!
What do you mean with this exactly ?
- Also, it takes almost 10-15 seconds after I click the app to open, which is weird.
please post your script(s) that are probably running when the app crashes!
And your "preopenstack" and/or "openstack" script.


Best

Klaus

MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Re: LiveCode program on mobile

Post by MarkoSato » Fri Jun 03, 2016 3:07 pm

This is the only code on my stack script (I hope you meant this?)

Code: Select all

on preOpenStack
   set the fullscreenmode of me to "exactFit"
end preOpenStack
There is no script or anything like that when the game crashes. It just turns black for few seconds then the app closes itself.
No notification or pop up messages. That is what I thought is weird about it.
It's not even saying "the app doesn't react" or something like that

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: LiveCode program on mobile

Post by Klaus » Fri Jun 03, 2016 5:15 pm

There is no script running when the app exits?
Sorry, no brilliant idea in the moment...

MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Re: LiveCode program on mobile

Post by MarkoSato » Fri Jun 03, 2016 5:20 pm

nope, sadly none. Guess I can't do anything about it.
At least everything else is working :D

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: LiveCode program on mobile

Post by jacque » Sat Jun 04, 2016 4:03 pm

There must be a script running if the stack is a game. Are you running a repeat loop to control it? Repeat loops can cause problems if not properly written.

If it always crashes at the same place, what script was running when that happens? Or if there really is no script at all running, what actions came right before the crash?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Re: LiveCode program on mobile

Post by MarkoSato » Sun Jun 05, 2016 12:46 pm

There is no loop in the whole game.
Right before the crash I have card with an image "To be continued" there you can click a button to go to the next card.
That is the code:

Code: Select all

on mouseUp
    go to the next card
    send "mouseUp" to button "begin" 
end mouseUp
On the next card there is this button "begin"
Code:

Code: Select all

on Intro
   lock screen -- for visual effect
   set the visible of button "beginBackgrnd" to true
   set the currentframe of image "intro.gif" to 1
   set the repeatCount of image "intro.gif" to 2 --Animation 2 mal
   set the icon of button "beginBackgrnd" to 1716 -- "1716" ist die animierte .gif Datei
   unlock screen
   send "resetto" to button "beginBackgrnd" in 2.2 seconds 
   goNext 
end Intro

command goNext
   wait 2.2 seconds with messages
   visual effect dissolve
   go to the next card 
end goNext
So I let the gif running on the button
It always crashes right here, while the animation with 2.2 seconds is running. Normally it should go to the next card but it always crashes there.

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: LiveCode program on mobile

Post by Klaus » Sun Jun 05, 2016 1:20 pm

Hi Marko,

use the official "visual effect" syntax, I heard that "legacy code" may crash on mobile:

Code: Select all

command goNext
   wait 2.2 seconds with messages
   lock screen for visual effect
   go next cd
   unlock screen with visual effect dissolve 
end goNext
Best

Klaus

MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Re: LiveCode program on mobile

Post by MarkoSato » Sun Jun 05, 2016 8:15 pm

Ok I might try it later but to be honest I used this type of visual effect almost on every card.
So it would be weird if it would only crash because of this, then it should have happened way earlier.

MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Re: LiveCode program on mobile

Post by MarkoSato » Wed Jul 13, 2016 12:13 pm

Hey,

Sry for the late reply but I thought I could give an update.

I tried to compansate the program by shorting some of the music and gifs in the project.
After that, I made a new APK and now it works on mobile until the end.
(Only issue is that the mobile is playing the gifs very slow and not as smooth as on PC, but thats a minor problem)

By the way I got the best grade in the university on this project! :D

So thank you again everyone for helping out. This was a great experience for me.

Best regards
Marko

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: LiveCode program on mobile

Post by Klaus » Wed Jul 13, 2016 4:35 pm

Congratulations! :D

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: LiveCode program on mobile

Post by jacque » Wed Jul 13, 2016 5:14 pm

That's great! Congratulations.

I think your experience would make a good guest blog post if you're willing. It would encourage others to try LiveCode and show off your own accomplishments too. If you feel like doing it, write to support@livecode.com and see what they think.

Personally I'd love to see a blog about your journey.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: LiveCode program on mobile

Post by MaxV » Thu Jul 14, 2016 7:40 am

Read this, it could help you: http://livecode.wikia.com/wiki/Android
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”