Problem with Android Standalone Application
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Problem with Android Standalone Application
Hello,
i have a little program and wanted to test in on my android phone so i tried to make the apk but i get this error message: "There was an error while while saving the standalone application could not compile application class". i also attached a screenshot of my standalone settings
There is no problem with the mac and windows Standalone Application tho.
i hope some can help me
best regards,
Mark
i have a little program and wanted to test in on my android phone so i tried to make the apk but i get this error message: "There was an error while while saving the standalone application could not compile application class". i also attached a screenshot of my standalone settings
There is no problem with the mac and windows Standalone Application tho.
i hope some can help me
best regards,
Mark
Re: Problem with Android Standalone Application
i am using live code community 8 (rc1) and i installed the android studio and installed the android sdk 4.0.3 (i guess you need this for LC 8?).
If i try to set the preferences in mobile support and choose the android/sdk path it gives me an error.
Note: I used this version 3-4 years ago and at this time i could make an android apk but it's been quite a while and i don't really remember what i did. And now i don't know what to do
If i try to set the preferences in mobile support and choose the android/sdk path it gives me an error.
Note: I used this version 3-4 years ago and at this time i could make an android apk but it's been quite a while and i don't really remember what i did. And now i don't know what to do

-
- Livecode Staff Member
- Posts: 861
- Joined: Fri Feb 06, 2015 4:03 pm
Re: Problem with Android Standalone Application
Hello MarkoSato,
There are lots of newer LiveCode versions, I would suggest you download the latest (9.6 RC-1, released yesterday):
https://downloads.livecode.com/livecode/
Your android sdk tools are probably out of date, so I would suggest you have a look at this lesson, for installing Android Studio:
http://lessons.livecode.com/m/2571/l/62 ... oid-studio
Kind regards,
Panos
--
There are lots of newer LiveCode versions, I would suggest you download the latest (9.6 RC-1, released yesterday):
https://downloads.livecode.com/livecode/
Your android sdk tools are probably out of date, so I would suggest you have a look at this lesson, for installing Android Studio:
http://lessons.livecode.com/m/2571/l/62 ... oid-studio
Kind regards,
Panos
--
Re: Problem with Android Standalone Application
Hey,
thanks for the reply.
So now i installed LC 9.5.1 stable because i read that the stable versions are better.
Then i reinstalled Java JDK 8u251, installed android studio and choose sdks 9.0 and now if i choose the path in the preferences it actually worked.
But now i get another error message if try to "save as a standalone Applikation":
hope you can help me again
Kind Regards,
Marko
thanks for the reply.
So now i installed LC 9.5.1 stable because i read that the stable versions are better.
Then i reinstalled Java JDK 8u251, installed android studio and choose sdks 9.0 and now if i choose the path in the preferences it actually worked.
But now i get another error message if try to "save as a standalone Applikation":
hope you can help me again
Kind Regards,
Marko
- Attachments
-
- errr.png (18.67 KiB) Viewed 8551 times
-
- Livecode Staff Member
- Posts: 861
- Joined: Fri Feb 06, 2015 4:03 pm
Re: Problem with Android Standalone Application
Hello MarkoSato,
A rough guess is that you have more Java versions installed in your system, so LC does not use version8 as it should.
What do you see in this folder:
/Library/Java/JavaVirtualMachines/ ?
Kind regards,
Panos
--
A rough guess is that you have more Java versions installed in your system, so LC does not use version8 as it should.
What do you see in this folder:
/Library/Java/JavaVirtualMachines/ ?
Kind regards,
Panos
--
Re: Problem with Android Standalone Application
hello,
sry for the late reply.Yes that was the problem, i had more than 1 version, i deleted all, reinstalled now it works.
Now i have the problem that i don't have sound in my mobile application.
I copied files ind the standalone application in the folder "Sound" that i made and in the script i have this code:
"play (specialfolderpath("resources") & "/Sound/levelclick.wav")".
Do i have to do something else or something different?
PS: i also found a very interesting problem.
i have a background image which is on the whole screen of the program. Now if i click on a textfield, on mobile the keyboard opens. For some reason i cannot click anywhere else (the background) so that the keyboard should disappear again. I tried another card with the same constellation without the background image and the problem was solved. So why is it, if I have a background image i cannot click away from my textfield, so the user is stuck on this textfield? With this problem i can't really use my application on mobile. Thanks for the help
Kind Regards
Marko
sry for the late reply.Yes that was the problem, i had more than 1 version, i deleted all, reinstalled now it works.
Now i have the problem that i don't have sound in my mobile application.
I copied files ind the standalone application in the folder "Sound" that i made and in the script i have this code:
"play (specialfolderpath("resources") & "/Sound/levelclick.wav")".
Do i have to do something else or something different?
PS: i also found a very interesting problem.
i have a background image which is on the whole screen of the program. Now if i click on a textfield, on mobile the keyboard opens. For some reason i cannot click anywhere else (the background) so that the keyboard should disappear again. I tried another card with the same constellation without the background image and the problem was solved. So why is it, if I have a background image i cannot click away from my textfield, so the user is stuck on this textfield? With this problem i can't really use my application on mobile. Thanks for the help
Kind Regards
Marko
Re: Problem with Android Standalone Application
Hi Marko,
as a workaround, add this script to your backgroundimage to force this behavior:
Should make the virtual keyboard go away, at least worth a try.
Best
Klaus
as a workaround, add this script to your backgroundimage to force this behavior:
Code: Select all
on mouseup
focus on NOTHING
end mouseup
Should make the virtual keyboard go away, at least worth a try.

Best
Klaus
Re: Problem with Android Standalone Application
Another way is to disable the image, then taps will go through to the card.
Did you copy the whole sound folder into the Copy Files pane of the standalone settings? If so then the file path is correct. Wav files are supported on Android devices if they have the correct format. Supported formats are here: https://developer.android.com/guide/top ... ia-formats
I have had good luck with mp3 files too.
Did you copy the whole sound folder into the Copy Files pane of the standalone settings? If so then the file path is correct. Wav files are supported on Android devices if they have the correct format. Supported formats are here: https://developer.android.com/guide/top ... ia-formats
I have had good luck with mp3 files too.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with Android Standalone Application
Is the "play" command supported on Android? What if you use mobilePlaySoundOnChannel instead?
Re: Problem with Android Standalone Application
Oh right, good catch. I didn't notice that. Play is supported on mobile but only for a very few formats. I've always used a player control and that works fine.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with Android Standalone Application
Hey,
thanks, background problem fixed with focus on NOTHING.
Sound works now on mobile but I get an error in LiveCode if i click on the button.
The code i found on the internet and used:
Error: can't find handler near mobilePlaySoundOnChannel, char1
thanks, background problem fixed with focus on NOTHING.
Sound works now on mobile but I get an error in LiveCode if i click on the button.
The code i found on the internet and used:
Code: Select all
put specialFolderPath("engine") & "/Sound/levelclick.wav" into tSoundFile
mobilePlaySoundOnChannel tSoundFile, "current", "now"
Re: Problem with Android Standalone Application
Hi Marko,
you see the error in the IDE, right?
Unfortunately LC will throw an error it if encounters a MOBILE command on the desktop, so you need to do like this:
Important hint:
On iOS
-> specialfolderpath("engine")
happens to be the same as
-> specialFolderPath("resources")
So in your own interest, please stick with specialFolderPath("resources") on ALL platforms.
Best
Klaus
you see the error in the IDE, right?
Unfortunately LC will throw an error it if encounters a MOBILE command on the desktop, so you need to do like this:
Code: Select all
...
if the environment = "mobile" then
put specialFolderPath("resources") & "/Sound/levelclick.wav" into tSoundFile
mobilePlaySoundOnChannel tSoundFile, "current", "now"
end if
...
On iOS
-> specialfolderpath("engine")
happens to be the same as
-> specialFolderPath("resources")
So in your own interest, please stick with specialFolderPath("resources") on ALL platforms.
Best
Klaus
Re: Problem with Android Standalone Application
Hey,
thanks Klaus, I did as you said now it works without problems.
A little question. Is it normal that the sounds are a little bit delayed on mobile?
Kind regards
Marko
thanks Klaus, I did as you said now it works without problems.
A little question. Is it normal that the sounds are a little bit delayed on mobile?
Kind regards
Marko
Re: Problem with Android Standalone Application
.... ) & "/Sound/levelclick.wav".
Is Sound a folder the developer creates or is that a default Android folder where audio is stored?
If the developer creates it, how?
Thanks
Vincent
if the environment = "mobile" then
put specialFolderPath("resources") & "/Sound/levelclick.wav" into tSoundFile
mobilePlaySoundOnChannel tSoundFile, "current", "now"
end if
Is Sound a folder the developer creates or is that a default Android folder where audio is stored?
If the developer creates it, how?
Thanks
Vincent
if the environment = "mobile" then
put specialFolderPath("resources") & "/Sound/levelclick.wav" into tSoundFile
mobilePlaySoundOnChannel tSoundFile, "current", "now"
end if
Re: Problem with Android Standalone Application
Hi Vincent,
everything will reside inside of your APP bundle, so you need to create this folder.
However just add your complete "Sound" folder inclusive sounds to your standalone via "Copy files" tab
in the "Standalone Application Setting", then the folder will be present in your runtime!
Please use the CODE tags after pasting your code here. This way the formatting will be preserved
and makes it better readable.
And there is nothing wrong with creating a new thread instead of using an old one like this. 
Best
Klaus
everything will reside inside of your APP bundle, so you need to create this folder.
However just add your complete "Sound" folder inclusive sounds to your standalone via "Copy files" tab
in the "Standalone Application Setting", then the folder will be present in your runtime!
Please use the CODE tags after pasting your code here. This way the formatting will be preserved
and makes it better readable.
Code: Select all
...
if the environment = "mobile" then
put specialFolderPath("resources") & "/Sound/levelclick.wav" into tSoundFile
mobilePlaySoundOnChannel tSoundFile, "current", "now"
end if
...

Best
Klaus