15 Replies Latest reply on Jun 30, 2017 1:23 AM by David Marston

    Android to Ios

    David Marston

      Hi,

       

      I'm just about to finish my first app ever and I'm really happy with it. Been a steep but fun learning curve and the result has been worth the effort.

       

      Now the question is an obvious one (and I have searched for an answer before starting this thread):

       

      To convert what I've done from Android to Ios, could I just copy all layers from the Android app I've done to the new Ios one.

       

      Will the Actionscript 3 code I've used work just as well in the Ios app.

       

      Is it just a matter of scaling to the Ios stage size?

       

      Or is it a lot more complicated than that?

       

      If anyone has any pointers to tutorials or guides for doing that I'd appreciate it.

       

      Many thanks!

        • 1. Re: Android to Ios
          David Marston Level 1

          I've just read something that states that you need a Mac to create an Ios app!!!

           

          Is that true:

          • 2. Re: Android to Ios
            Colin Holgate MVP & Adobe Community Professional

            When you make an iOS version the provisioning and certificates are different, but as much as all of your code will work. Only things that are Android specific would have a problem.

             

            It is possible to take the same FLA and keep swapping between Android and iOS in the Properties panel, and publish both versions from the same FLA. But, you’ll find yourself having to re-enter icon paths a lot.

             

            Its simpler to duplicate the FLA, give it a slightly different name (like, MyGame_iOS.FLA), then open the FLA. Once its open you change the platform to be AIR for iOS in Properties, go into the iOS publishing settings to select your certificate and provisioning files, and Save. The other options in publsihing settings should hopefully be the same as they were in the Android version.

            1 person found this helpful
            • 3. Re: Android to Ios
              Colin Holgate MVP & Adobe Community Professional

              You don’t need a Mac to create an iOS app in Animate, everything should be possible on Windows. You will need to do some research to find out how to make the certificate file.

               

              You will need to use Application Loader to submit the app to Apple, and that only works on Macs. If you know anyone who owns a Mac you could send the file to them, run Application Loader, and log into your account.

              • 4. Re: Android to Ios
                David Marston Level 1

                That sounds quite straight forward thanks.

                 

                I'm just reading something at the moment which says I need to "

                INSTALL A VIRTUAL PC APPLICATION WITH MAC OS X

                Another option is to simulate an installation of Mac OS X on Windows.

                It’s fairly easy to do with virtualization software like VirtualBox.  VirtualBox is free and open source"

                (You can read this article here if you want:
                How to Develop iOS Apps on Windows PCs by Using a Free Software Solution

                 

                 

                Is this good advice or unnecessary. Sounds from what you've said it is.

                 

                Thanks again.

                • 5. Re: Android to Ios
                  Colin Holgate MVP & Adobe Community Professional

                  A lot of things in that article will be of use, but I'm not so sure about the VirtualBox solution. Apple don't sell macOS, like they used to, so I'm not sure how you could get a legal copy of the system into your VirtualBox.

                   

                  The remote Mac thing seems more viable, so long as that Mac has Xcode installed, that is recent enough too. I'm not sure how you would get your files over to that Mac in order to upload them.

                   

                  Are you charging for your app, and is it going to be a big hit? You should submit the Android version to Amazon as well as Google Play, that would double the number of sales. If you did make any money from it you could treat yourself to a Mac, and save some hassle.

                  2 people found this helpful
                  • 6. Re: Android to Ios
                    David Marston Level 1

                    Hi,

                     

                    I'm hoping it'll make some money obviously. I've put a fair bit of time in to it and it's getting good feedback already from the people who've tested it for me. So fingers crossed.

                     

                    If it makes life easier I have the option to work at a friend's place who has nothing but macs. Maybe I'll just do that . . . it's even a bit sociable!!

                     

                    That is really great advice about Amazon. It never occurred to me. So now I've got to go and suss out how to submit an app to amazon.

                     

                    Been like this every step of the way. Interesting though.

                     

                    So thanks v much.

                     

                    Fingers crossed.

                    • 7. Re: Android to Ios
                      Colin Holgate MVP & Adobe Community Professional

                      It used to be that Google publishing would happen within an hour, and there was no review, Amazon would carefully review in about 5 days, and Apple would get around to reviewing in about 8 days. Now Google do review apps, so although they may get started on it sooner than Amazon or Apple, you could be told reasons for rejection.

                       

                      By far the hardest store to submit to is Samsung. They really QA your app, and will send you overhead video of the tester doing something that makes them reject the app. One time it took me three weeks to submit repeated builds until Samsung were happy. But, I know to do all those things I fixed on every app now.

                      • 8. Re: Android to Ios
                        David Marston Level 1

                        That sounds frustrating!!

                         

                        Without taking up too much of your time, is it possible to give me a hint as to what normally is rejected or causes a problem?

                         

                        Hopefully it'll be worth it in the long run.

                        • 9. Re: Android to Ios
                          Colin Holgate MVP & Adobe Community Professional

                          Here's one example report I would get, and this was for an app being used by young kids:

                           

                          "If the user sets an alarm to go off in one minute, goes into your app to continue playing, and then the alarm overlay appears, your app does not redraw itself when the alarm is cancelled."

                           

                          Now, you can imagine that the number of kids who would do such a thing is low, and you could easily switch to another app and come back to fix it. But, they still had a good point. I think that one turned out to be a Stage3D context issue, that could be worked around by changing the stage quality.

                           

                          Another thing to come up Is how you handle the Back button. In a normal AIR app the Back button would exit the app to go back to the home screen, and Samsung felt that was unexpected behavior. Again they had a good point, and it is something you should think about. In general I use the Back button from within a section to go back to the contents page, and if they are already on the contents page then I would let it exit to the home screen.

                          • 10. Re: Android to Ios
                            David Marston Level 1

                            Ok, your app sounds quite a bit more complicated than mine!!

                             

                            How do you handle the back button? I presume you're talking about the back button on the phone?

                             

                            At the moment, with my app, if you hit the phone back button you leave the app. I know that's not ideal at all but I figured I could live without that.

                             

                            Is that  a no no?

                             

                            Thanks

                            • 11. Re: Android to Ios
                              Colin Holgate MVP & Adobe Community Professional

                              It would be a no no for Samsung, but their download figures are not as good, so I'm not suggesting you submit to them!

                               

                              This discussion includes some code on how you trap the Back button (which on Android is not always a physical button):

                               

                              Handling the Back button in AIR for Android | Grindhead Games: Casual Game Development

                              1 person found this helpful
                              • 12. Re: Android to Ios
                                David Marston Level 1

                                Thanks, I'll check that out.

                                • 13. Re: Android to Ios
                                  David Marston Level 1

                                  I posted this reply yesterday. Was it taken down by moderators because of the code I've referenced in this message. No notification about that though so I'm trying again (maybe I'm just cracking up!).

                                   

                                  So, further to the link sent by Colin. Can I just insert AS3 code at the point where it says "handle button press here". Such as go to frame and stop or any Actionscript?

                                   

                                  NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true)

                                   

                                  protected function onKeyDown(event:KeyboardEvent):void

                                  {

                                      if( event.keyCode == Keyboard.BACK )

                                      {

                                          event.preventDefault();

                                          event.stopImmediatePropagation();

                                          //handle the button press here.

                                      }

                                  }

                                   

                                   

                                  NB for moderators. If this post isn't acceptable because of the code I've inserted can you please let me know. I was hoping to have had a response to this question when I posted it yesterday.

                                   

                                  Thanks.

                                  • 14. Re: Android to Ios
                                    Colin Holgate MVP & Adobe Community Professional

                                    I'm a moderator here too, and the automatic system can sometimes block even an innocent post from an Adobe staff member! I'm sure it wasn't anything you included in your post, just the system being sensitive right then.

                                     

                                    That example code is from an object oriented programming style that you can use. The 'protected' part isn't needed for timeline code.

                                     

                                    For timeline code you would have this in your first frame script:

                                     

                                    import flash.events.KeyboardEvent;

                                    import flash.ui.Keyboard;

                                    import flash.desktop.NativeApplication;

                                    NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true)

                                     

                                    function onKeyDown(event:KeyboardEvent) {

                                        if( event.keyCode == Keyboard.BACK ) {

                                            event.preventDefault();

                                            event.stopImmediatePropagation();

                                            //handle the button press here.

                                        }

                                    }

                                     

                                    Where the example says "handle the button press here", that's where you would put your own code that would for example take the user back to the contents page, or the previous section they were in.

                                     

                                    For the case where you want the app to exit, if you're on the contents page let's say, the function could be:

                                     

                                    function onKeyDown(event:KeyboardEvent) {

                                       if(currentLabel == "Contents") return;

                                        if( event.keyCode == Keyboard.BACK ) {

                                            event.preventDefault();

                                            event.stopImmediatePropagation();

                                            //handle the button press here.

                                        }

                                    }

                                     

                                    That should have the effect of letting the system handle the back button if you are on the frame labelled Contents.

                                    1 person found this helpful
                                    • 15. Re: Android to Ios
                                      David Marston Level 1

                                      OK, thanks Colin.

                                       

                                      What I'm going to try and do is have a menu appear which, when the user hits the back button on their phone, gives them a navigation menu which gives them the option to go to any point in the project OR exit.

                                       

                                      That's useful.

                                       

                                      Thanks for your feedback.