Behind the scenes – a look at the code
Take a moment to examine the directory structure of the new app. The code is now spread over several directories. The code is distributed as shown in the following table:
Directory |
Content |
---|---|
|
The |
|
Common code across all platforms for business logic |
|
Android phone specific layout code |
|
iPhone-specific layout code |
|
Browser-based HTML5 specific layout code |
|
Android and iOS tablet layout |
Tip
Given the differences between Android and iOS tablets it can be a good idea to have separate tablet layouts.
This is not a full MVC implementation; that will come in the next example on Alloy but it does show how to split out code for different platforms. Splitting the common business logic from the presentation logic is the first step towards MVC. As there is no storage in this app...