1

I know that both Android and iOS apps can be built using the MVC pattern. I am unsure how close the classes can be between Android and iOS.

I am in a group and the person doing the iOS application and myself doing the Android app are tasked with creating class diagrams for the application and the better design will be chosen and used on both.

However, from my research it seems that it may be best to have non-trivial differences in the classes of the applications because of the differences in the two platforms (mvp seems better in Andorid, mvc for iOS; differences in how applications deal with getting sent to the background or killed; etc.)

So how close can the class diagrams be? Can the diagrams only be the same at a higher level, or can they be the same with the differences me masked in the implementation?

Community
  • 1
  • 1
Portablejim
  • 824
  • 1
  • 12
  • 21

2 Answers2

0

I think the best approach is to break your app up into functional pieces, or screens. For example "login screen", "profile screen", "activity feed"

The UI implementations will be quite different--I don't think there will be much sharing there.. but I think some of your data storage and model classes can be similar.. So you might have a concept of Users, "Activity Items", etc.

nielsbot
  • 15,922
  • 4
  • 48
  • 73
0

As for class design, you can share just about anything.

But for sharing actual code, you have a language and API incompatibility: Controllers and views would be in ObjC++ for iOS and Java for android. Model can be shared and written in C++, but it will need a complete JNI (java native interface) to work on android.

For typical controllers, each API has their own starting points, for very custom controllers (like for a game) you could also consider c++ with JNI.

Kris Van Bael
  • 2,842
  • 1
  • 18
  • 19