Skip to content

orcinusbr/orca-android

Repository files navigation

About

Orca is a beautifully designed, fully functional Mastodon client that offers you the best experience you could have.

As it's still in development, it currently supports searching for profiles, favoriting, reposting and sharing posts from the feed. The application is divided into modules that categorize each context, which often have submodules. Screens such as the feed and the profile details can be found within the :feature module, while core-level logic regarding authorization/authentication and read/write operations on profiles or posts are located at :core. As you will notice, :core has lots of submodules, but the one in which calls to the actual API take place is :core:mastodon.

Note that Orca isn't a fork of the official app. Its overall structure has been built from the ground up to provide maximum developer-facing flexibility, making it easy for each component to be tested in isolation and allowing for a pleasant, readable core-level API that's exposed to other modules, mainly :feature ones.

Structure

Each module represents the context to which its underlying structures are related.

Context Description
Composite Exposes APIs that rely on core and/or platform modules.
Core Coordinates and executes actions tightly related to the core purpose of the application, which is reading and writing profiles and posts. Contains two main submodules (often referred to as "core variants" in the source code): :core:sample, which doesn't make any HTTP requests and targets offline usage for demonstration purposes, providing sample posts and profiles to browse through; and :core:mastodon, whose structures call the Mastodon API and convert the DTOs it returns into :core objects.
Extension Provides extensions built upon Kotlin API (not tied to the platform) that ease development.
Feature Each submodule within this context represents a screen that can be navigated to. One notable exception is the authorization screen, from which the user can input the instance of their account and then sign in into the app: since it's strongly related to the Mastodon API, it is part of :core:mastodon, and is shown by the HttpAuthorizationActivity.
Platform Contains platform-dependent (that is, Android-only) utilities for general purpose use that facilitate the overall development process.
Standard Similarly to the platform context, provides utilities, but doesn't depend on platform-specific structures. Differs from the extension context in that it provides new APIs instead of just making it easier to use currently existing ones.

Contributing

Pre-requisites

API keys

In order to build the project, you have to first obtain a few API keys. Except for the GitHub personal access token, all of them are completely optional if you only intend to build the demo version of the application (which doesn't make any network calls, as stated in the Structure section).

Each item links to a documentation explaining how to obtain the respective key, and, below, how they should be added to the root local.properties file.

github.username=your-username
github.token=your-token
  • Mastodon (replace the mastodon.example that's mentioned in the documentation by your instance):
mastodon.clientSecret=your-token

Building

Clone the repository to your machine, open it in Android Studio and then build it. If the previous steps were followed, this process shouldn't throw any errors and the project should be built successfully.

Code style

The project follows a Kotlin-adapted version of the Google Java code style, and the build workflow will automatically fail if any change that isn't conformant to this specific style is pushed.