5 ms·
Activities and fragments are pretty much just view controllers in iOS. People make view controllers meant to be reused and embedded into other view controllers
by mahyarm 11y ago
Activities and fragments are pretty much just view controllers in iOS. People make view controllers meant to be reused and embedded into other view controllers all the time. Parts of intents are a navigation mechanism, the other part starting an app with an app specific URL. Working in such an environment with a C++ business logic layer and the iOS and Android UXs, the architectural differences weren't that big of a deal.
Also the business logic layer shouldn't care about the UI that much. It mostly should be a set of service objects that you interact with that give you a data set to render. The service objects handle persistence and network operations themselves. From that you build your own independent apps. Coupling the UX to the C++ layer results in pain unless your rendering the UI yourself in C++, like with most games.
- nostrademons 11y agoI've found the trickiest parts of cross-platform app development is that some features on a platform just have no analogue on other platforms. For example, notifications on Android can have BigViews in either text, list, or inbox styles. They're also supposed to collapse, although some apps (I'm looking at you, Facebook) don't bother. The equivalent on iOS is just badging the icon and showing a short 1-line text string as an alert. That means that some information which would've gone straight into the notification on Android needs to be shown on app launch in iOS, which often completely changes the data structures you'd use to represent it. Oftentimes this can ripple through the app as well, where because you need to launch the app to see it on iOS, you might as well add extra interactivity to this data, but that's not allowed by the Android platform as long as you want to keep it in a notification. This doesn't matter if all your cross-platform C++ or Xamarin library does is format strings, provide predicates, and clean data - which is probably what it should do. But it means that the dream of a business logic layer that just hands off objects to the UI to render is just a dream. You need to hand off wildly different objects for a short notification on Android vs. an inbox-style notification vs. an iOS notification vs. an Intent to start an Activity on Android vs. an options dictionary for application:didFinishLaunchingWithOptions:.