Skip to content

"O Vício em HQs" (The Comic Addiction) is a cross-platform mobile application (Android and iOS) developed in C# and Xamarin.Forms for comic book collectors. The app allows users to manage comic collections, catalog items through different methods, synchronize data with a server, and track collection goals.

Notifications You must be signed in to change notification settings

binharademo/appnvicio

Repository files navigation

O Vício em HQs - Comic Collection Management App

Overview

"O Vício em HQs" (The Comic Addiction) is a cross-platform mobile application (Android and iOS) developed in Xamarin.Forms for comic book collectors. The app allows users to manage comic collections, catalog items through different methods, synchronize data with a server, and track collection goals.

April 2016 to Febulary 2018

Main Features

  • Collection Management: Create, view, edit, and delete comic collections
  • Comic Cataloging: Add comics to collections by title, barcode, or search
  • Data Synchronization: Sync collections between local device and remote server
  • Authentication: Traditional login and Facebook integration
  • Detailed View: Complete information for each comic (cover, description, publisher, etc.)
  • Collection Goals: Set and track goals for collections
  • Reading States: Mark comics as "read", "want to read", "currently reading", etc.
  • Offline Functionality: Local persistence with synchronization when connected

Architecture and Technologies

Technology Stack

  • Framework: Xamarin.Forms 2.3.4.247
  • Architectural Pattern: MVVM (Model-View-ViewModel) with Prism
  • Dependency Injection: Unity 4.0.1
  • Local Persistence:
    • Realm 1.6.0 (primary)
    • SQLite.Net-PCL 3.1.1 (secondary)
  • Serialization: Newtonsoft.Json 10.0.2
  • Analytics and Monitoring: Microsoft.Azure.Mobile 0.15.0
  • Barcode Reading: ZXing.Net.Mobile 2.2.9
  • UI/UX:
    • Acr.UserDialogs 6.3.10
    • CarouselView.FormsPlugin 4.2.9
    • Behaviors.Forms 1.2.0
  • Connectivity: Xam.Plugin.Connectivity 2.3.0

Project Structure

src/
├── OvicioHqApp/                 # Main project
│   ├── OvicioHqApp/             # Shared logic
│   │   ├── ViewModels/          # Presentation logic
│   │   ├── Views/               # XAML interfaces
│   │   ├── Services/            # Application services
│   │   ├── Controls/            # Custom controls
│   │   └── Base/                # Base classes
│   ├── OvicioHqApp.Droid/       # Android implementation
│   └── OvicioHqApp.iOS/         # iOS implementation
├── OVicioHqCore/                # Shared project
│   ├── Models/                  # Data models
│   ├── Repository/              # Data access
│   └── WebServices/             # API communication
└── Components/                  # Shared components

Programming Patterns

MVVM (Model-View-ViewModel)

  • Clear separation between UI (Views), presentation logic (ViewModels), and data (Models)
  • Two-way binding between Views and ViewModels
  • Commands to encapsulate user actions

Dependency Injection

  • Unity container for dependency registration and resolution
  • Facilitates unit testing and component decoupling

Repository Pattern

  • Data access abstraction through repositories
  • Implementation in CollectionManager for CRUD operations

Service Pattern

  • Specialized services for specific functionalities
  • Authentication, API communication, credential storage

Navigation

  • Service-based navigation through Prism
  • Structured navigation flow with MasterDetail and NavigationPage

Technical Analysis

Strengths

  1. Separation of Concerns

    • Clear division between layers (UI, logic, data)
    • Consistent use of MVVM pattern
  2. Code Reuse

    • Shared project for common code
    • Base classes to reduce duplication
  3. Hybrid Persistence

    • Realm for efficient local storage
    • Synchronization with server when connectivity is available
  4. Offline-First Experience

    • Complete functionality without connection
    • Automatic synchronization when connected
  5. Structured Navigation

    • Use of Prism navigation service
    • Well-defined navigation flows

Improvement Opportunities

  1. Dependency Updates

    • Some libraries are using older versions
    • Migration to more recent versions of Xamarin.Forms
  2. Error Handling

    • Implement more robust exception handling
    • Improve user feedback in failure cases
  3. Code Documentation

    • Add comments to critical parts
    • Document complex flows and architectural decisions
  4. Automated Testing

    • Implement unit tests for ViewModels
    • Add integration tests for main flows

Development Environment Setup

Prerequisites

  • Visual Studio 2017 or higher
  • Xamarin SDK
  • .NET Framework 4.5
  • Android SDK (for Android development)
  • Xcode (for iOS development, macOS only)

Initial Setup

  1. Clone the repository
  2. Open the OvicioHqApp.sln solution in Visual Studio
  3. Restore NuGet packages
  4. Configure API keys in the App.xaml.cs file for:
    • Azure Mobile Center
    • Facebook (if applicable)

Building and Running

  • For Android: Select the OvicioHqApp.Droid project as the startup project
  • For iOS: Select the OvicioHqApp.iOS project as the startup project (requires Mac)

Conclusion

"O Vício em HQs" is a well-structured application that follows best practices for mobile development with Xamarin.Forms. The MVVM architecture with Prism provides a solid foundation, with clear separation of concerns and ease of maintenance.

The use of Realm for local persistence, combined with server synchronization, allows for a good experience both online and offline. Integration with services such as barcode reading and social login enhances the app's functionality.

The code demonstrates a good level of maturity in Xamarin development, with appropriate use of patterns and recommended practices.

About

"O Vício em HQs" (The Comic Addiction) is a cross-platform mobile application (Android and iOS) developed in C# and Xamarin.Forms for comic book collectors. The app allows users to manage comic collections, catalog items through different methods, synchronize data with a server, and track collection goals.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published