Note that there are some explanatory texts on larger screens.

plurals
  1. POBest Practices for Shared Android/iOS Development
    primarykey
    data
    text
    <p>I'm working on an app that will run on both Android and iOS, and our team has decided that we want to use a shared library to cut down on code and effort duplication.</p> <p>Most of this is pretty straightforward: we write a library in some language that can go cross-platform (C++ with a native interface, C# with Mono, etc), and then provide platform-specific bindings. The problem, however, is that since our library has to implement complex application logic, it has to do a lot of interacting with the system itself (storing data in files and databases, querying APIs such as location, notification, etc). As best as we can tell, this requires another layer - sitting below our library and above the system - which is written in the platform-specific language, and provides bindings that our library can call to.</p> <p>The problem with this is that the different platforms have fundamentally different design paradigms for performing different tasks. For example, storing app data involves touching fundamentally different system components (databases vs files, different partitions, or files with different filepaths) on the two platforms. We want this platform-specific logic to stay out of the library, but figuring out how to put it in the conversion layer is non-obvious. We can't simply provide API methods - what happens if one platform necessitates performing a given action at a different time, or in a different order? What about listening for system actions, which may, on certain platforms, require spawning different threads?</p> <p>The question is: is there any wisdom about how to solve these problems cleanly? We know that it's been done before - Dropbox, for example, has a common library (libdropbox) written in C++ that backs their Android, iOS, and desktop clients.</p> <p>Thanks!</p> <p>EDIT: We know that single-codebase options like <a href="http://xamarin.com/" rel="nofollow">Xamarin</a> are available, but we're curious to see if there are other options.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload