How to code sharing between Android and iOS

后端 未结 6 1021
故里飘歌
故里飘歌 2020-12-12 13:51

I\'m moving away from strict Android development and wanting to create iPhone applications. My understanding is that I can code the backend of iOS applications in C/C++ and

6条回答
  •  长情又很酷
    2020-12-12 14:16

    I posted this same answer to a similar question but I think it's relevant so...

    I use BatteryTech for my platform-abstraction stuff and my project structure looks like this:

    On my PC:

    • gamename - contains just the common code

    • gamename-android - holds mostly BatteryTech's android-specific code and Android config, builders point to gamename project for common code

    • gamename-win32 - Just for building out to Windows, uses code from gamename project

    On my Mac:

    • gamename - contains just the common code

    • gamename-ios - The iPhone/iPad build, imports common code

    • gamename-osx - The OSX native build. imports common code.

    And I use SVN to share between my PC and Mac. My only real problems are when I add classes to the common codebase in Windows and then update on the mac to pull them down from SVN. XCode doesn't have a way to automatically add them to the project without scripts, so I have to pull them in manually each time, which is a pain but isn't the end of the world.

    All of this stuff comes with BatteryTech so it's easy to figure out once you get it.

提交回复
热议问题