Reputation: 12437
I wanted to design a library/api that could work for both android and iphone development without having to make two separate libraries, is this possible? Do things like this exist?
Upvotes: 2
Views: 94
Reputation: 29547
Use Apportable to write Objective C for both Android and iPhone.
Upvotes: 0
Reputation: 70663
Java on Android supports calling compiled C code through the NDK. Objective C is a superset of C. So you might be able to develop certain types of library code in C that can be called by either an Android NDK interface or Objective C API.
You can also do a user interface in HTML5 and Javascript on both platforms, so you might be able to develop an MVC app with the Model in a C library and View in a Javascript library, and just use Java on Android or Objective C on iOS as the Controller glue between them.
Upvotes: 0
Reputation: 54780
Depending on what you're doing, some components are sometimes written in C/C++ and compiled natively for each platform. This works on both Android and iPhone and is useful for high performance game engines among other things. Other options include PhoneGap mentioned by Jonathan as well as:
Upvotes: 1