Hasty Briefsbeta

Bilingual

Using Go for Mobile Apps: A retrospective on a year of development with Gomobile

a day ago
  • #flutter
  • #cross-platform-development
  • #go-mobile
  • The author chose Go Mobile for developing Digital Carrot due to Go's cross-platform capabilities and strong system libraries like Expr and Goja for customization.
  • Go Mobile handles all business logic, with Flutter used for the UI, communicating via binary-encoded Protobuf messages through platform channels to ensure seamless data handling.
  • A single API function with a large oneof block simplifies communication, avoiding the need to define multiple platform channels and reducing duplication across Swift and Kotlin.
  • Go to Swift/Kotlin communication involves Go interfaces implemented in platform code, though it supports only primitive data types and Protobuf isn't widely used here.
  • Benefits include seamless integration with the Go-based sync server, strong separation between business and presentation layers, access to extensive Go and Dart libraries, and network-capable APIs for flexible deployment.
  • Drawbacks include performance overhead from Protobuf serialization, increased complexity in adding new logic, larger app sizes due to Go binaries, and challenges with bi-directional communication and async handling in Flutter.
  • Issues encountered include Go Mobile bugs like incorrect time zones (GMT default) and broken DNS lookup on iOS, requiring workarounds like linking libresolv in XCode.
  • Overall, the author is satisfied with Go Mobile and would use it again for niche cases, especially with teams familiar with Go or apps relying heavily on Go services and shared business logic.