Converting from iOS to Android

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jnmediaGAd195
Posts: 58
Joined: Mon Dec 05, 2011 5:35 pm

Converting from iOS to Android

Post by jnmediaGAd195 » Fri Aug 10, 2012 12:45 am

My app, Number Wizard, is in the App Store and I would like to convert it to Android. I was able to load it on to a Kindle Fire but I have the following issues:
1. The picklists don't work.

put " Reset Current Score" & cr & " Reset High Scores" & cr & " Reset All" into optionList
iphonePick optionlist, 1
put the result into chosenItem

According to the Dictionary, this is Android-compatible or does it need to be converted to mobilePick?

2. Animation does not work.
put 131 into tCounter
repeat until tCounter = -1
put ("smile_" & tCounter) into tName
set the width of image tName to the width of button "drawFace"
set the height of image tName to the height of button "drawFace"
set the icon of button "drawFace" to the id of image tName
show button "drawFace"
wait for 0.03 second
subtract 6 from tCounter
end repeat

3. It's a math app. It executes one problem and goes away. This could be related to the animation issue because the next thing that is supposed to happen is animation and it never occurs.

Any help is greatly appreciated.

Judy

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting from iOS to Android

Post by Klaus » Fri Aug 10, 2012 11:37 am

Hi Judy,

I do not develop for Android, but here some general hints.
jnmediaGAd195 wrote:My app, Number Wizard, is in the App Store and I would like to convert it to Android. I was able to load it on to a Kindle Fire but I have the following issues:
1. The picklists don't work.

put " Reset Current Score" & cr & " Reset High Scores" & cr & " Reset All" into optionList
iphonePick optionlist, 1
put the result into chosenItem

According to the Dictionary, this is Android-compatible or does it need to be converted to mobilePick?
Did you try if this works with "mobilepick"? 8)
jnmediaGAd195 wrote:
2. Animation does not work.
put 131 into tCounter
repeat until tCounter = -1
...
end repeat
Try this and see my comments:

Code: Select all

put 131 into tCounter

## Reset icon in button and only show the button once
set the icon of btn "drawFace" to empty
show button "drawFace"

## Check fo SMALLER AND EQUAL -1, the subtraction might result in NOT exactly -1! :-)
repeat until tCounter <= -1
      lock screen
      put ("smile_" & tCounter) into tName
      set the width of image tName to the width of button "drawFace"
      set the height of image tName to the height of button "drawFace"
      set the icon of button "drawFace" to the id of image tName
      unlock screen
      wait for 0.03 second
      subtract 6 from tCounter
end repeat
jnmediaGAd195 wrote:3. It's a math app. It executes one problem and goes away.
Sorry, don't understand.

Best

Klaus

jnmediaGAd195
Posts: 58
Joined: Mon Dec 05, 2011 5:35 pm

Re: Converting from iOS to Android

Post by jnmediaGAd195 » Fri Aug 10, 2012 2:13 pm

Klaus,
Thanks for the info.
1. I tried mobilePick and it seems to be working so I think I am good to go. I was a little hesitant to start changing code. My thing is that if I have to change a lot of code, I'm not going to bother porting it to Android.
2. I figured out that the issue wasn't with the animation but with the command I was using to generate sound. I replaced iPhonePlaySoundOnChannel with mobilePlaySoundOnChannel and it's working. :)
3. I put in an answer to the first math problem and checked my answer. The next problem should be generated and it's not. I looked to see if there was anything iPhone-specific that I am doing in the code but it's pretty generic code. I'm still kind of puzzled by this.

Thanks for your help. Much appreciated. :)

Judy

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Converting from iOS to Android

Post by Klaus » Fri Aug 10, 2012 2:27 pm

Hi Judy,
jnmediaGAd195 wrote:Klaus,
Thanks for the info.
1. I tried mobilePick and it seems to be working so I think I am good to go. I was a little hesitant to start changing code. My thing is that if I have to change a lot of code, I'm not going to bother porting it to Android.
Just use the FIND & REPLACE feature in LiveCode to replace this kind of stuff in your scripts.
I don't think there are too many changes neccessary.
jnmediaGAd195 wrote:2. I figured out that the issue wasn't with the animation but with the command I was using to generate sound. I replaced iPhonePlaySoundOnChannel with mobilePlaySoundOnChannel and it's working. :)
No comment 8)
Glad you got it working!


Best

Klaus

jnmediaGAd195
Posts: 58
Joined: Mon Dec 05, 2011 5:35 pm

Re: Converting from iOS to Android

Post by jnmediaGAd195 » Fri Aug 10, 2012 2:35 pm

"Stupid Developer Error" on why the next problem wouldn't generate. I fixed the last of the iPhone-specific code, copied it to the Kindle but didn't install it. Wow!

Number Wizard, coming to a Kindle Fire near you! :)

Post Reply