Mobile Application Solution Architecture for multiple OS - Windows Phone 7, Android, iPhone, BB
I need to build one mobile applicati开发者_Go百科on starts with windows phone 7 and then need to convert the application to other platforms like Android, iPhone , BB.
The application contains many screens with data capture and all the data stores it in local storage and finally it is passed to central server.
I would like to know how the architecture needs to be designed and what are all the things which needs to be kept common and which can be re used when developing for the other platforms, apart from the central web services.
Thanks in advance
First and foremost there is no 1 solution that is going to get you everywhere. You could use something like PhoneGap (which is not available for WP7.. and won't arrive until after Mango). That is one way.. I suspect that you will get something less than a full on native experience.
One thing you could use is Monotouch which will get you C# in iOS, and Android (it does cost money, BTW). This also leaves out BB, so it might not be a fully viable solution for you.
Let me lay out an approach you can take.
Your app will fall into 2 areas: Business/Domain type classes, and UI classes. (I assume here that you will initially get your data from a server and then collect additional data from the user and then eventually sync back up with the server). You need to think long and hard about the business/domain classes. You want them in such a way that they don't rely on any mechnism that is built into WP7 (your first platform). These classes shouldn't really inherit from anything.. just POCOs. It should then be trivial to port these classes to ObjectiveC or to Java (even easier really) -- sorry my BB knowledge is zero, but it shouldn't be that hard to convert to whatever BB uses. You could additionally define some interfaces that will handle say the storage of the object locally. Again you will need to tread carefully. (ObjectiveC is a different kind of beast, just a warning if you don't already know).
After this initially porting of code you will have your domain in place and then all your efforts (which will be the majority of your work) will be focused on the individual platform. This is the best course, because with the domain ported you can start to think about the design paradigms for that platform and built a native app that acts like other apps do on that platform.. building a WP7 app's UI on iOS will not get you much love nor will it do in the Android or BB space. You will actually feel freed to use the individual strengths of the platform.
Anyway, I know there isn't much good news here (but I hate to see a question not given some thought). I more or less have outlined my company's development strategy (we have abandoned HTML5 as a cross-platform strategy and have embraced native development which means we all have to learn all the platforms.. in our case just iOS, Android, and WP7)
精彩评论