# Technical Documentation: kickstarter/android-oss

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/kickstarter/android-oss)

### Overview (`README.md`)

<a href="https://www.kickstarter.com"><img src=".github/ksr-wordmark.svg" width="36%" alt="Kickstarter for Android™"></a>

[](https://circleci.com/gh/kickstarter/android-oss)
[](https://codecov.io/gh/kickstarter/android-oss)
[](https://ktlint.github.io/)

Welcome to Kickstarter's open source Android app! Come on in, take your shoes
off, stay a while—_explore_ how Kickstarter's native squad has built and
continues to build the app, _discover_ our implementation of [RxJava](https://github.com/ReactiveX/RxJava) in logic-
filled [view models](https://github.com/kickstarter/android-oss/tree/master/app/src/main/java/com/kickstarter/viewmodels),
and maybe even _create_ an issue or two.

We've also open sourced our iOS app, written in Swift:
[check it out here](https://github.com/kickstarter/ios-oss). Read more about our journey to open source [here](https://kickstarter.engineering/open-sourcing-our-android-and-ios-apps-6891be909fcd#.o1fe86s6w).

## Getting Started

_Follow these instructions to build and run the project with mock data.._

1. Clone this repository.
2. Download the appropriate [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
for your system. We are currently on JDK 8.
3. [Install Android Studio](https://developer.android.com/sdk/index.html).
4. `cd` into the project repo and run `make bootstrap` to bootstrap your Android
   development environment. Keep an eye on the output to see if any manual steps
   are required.
5. Import the project. Open Android Studio, click `Open an existing Android
   Studio project` and select the project. Gradle will build the project.
6. Run the app. Click `Run > Run 'app'`. After the project builds you'll be
   prompted to build or launch an emulator.
   
## Documentation

While we're at it, why not share our docs? Check out the
[native docs](https://github.com/kickstarter/native-docs) we have written so far
for more documentation.

## Contributing

We intend for this project to be an educational resource: we are excited to
share our wins, mistakes, and methodology of Android development as we work
in the open. Our primary focus is to continue improving the app for our users in
line with our roadmap.

The best way to submit feedback and report bugs is to open a Github issue.
Please be sure to include your operating system, device, version number, and
steps to reproduce reported bugs. Keep in mind that all participants will be
expected to follow our code of conduct.

## Code of Conduct

We aim to share our knowledge and findings as we work daily to improve our
product, for our community, in a safe and open space. We work as we live, as
kind and considerate human beings who learn and grow from giving and receiving
positive, constructive feedback. We reserve the right to delete or ban any
behavior violating this base foundation of respect.

## Find this interesting?

We do too, and we’re [hiring](https://www.kickstarter.com/jobs?ref=gh_android_oss)!

## License

```
Copyright 2020 Kickstarter, PBC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

---

### Overview (`fastlane/README.md`)

fastlane documentation
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```sh
xcode-select --install
```

For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

### alpha

```sh
[bundle exec] fastlane alpha
```



### external

```sh
[bundle exec] fastlane external
```



### internal

```sh
[bundle exec] fastlane internal
```



----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

---

### Overview (`app/src/main/java/com/kickstarter/features/socialshare/README.md`)

# Social Share

## Overview

The Social Share feature lets users share a Kickstarter project with their network directly from within the app. When a user taps the share button on a project a bottom sheet slides up presenting a grid of sharing destinations alongside a preview card of the project.

### Supported platforms

| Icon | Destination | Requires app installed? |
| :--- | :--- | :--- |
| X | X (Twitter) | Yes |
| Instagram | Instagram Feed | Yes |
| Instagram | Instagram Stories | Yes |
| Facebook | Facebook Feed | Yes |
| Facebook | Facebook Stories | Yes |
| WhatsApp | WhatsApp | Yes |
| Messages | SMS / iMessage | No (native) |
| Email | Email | No (native) |
| More | Native system share sheet | No (native) |
| Copy Link | Clipboard | No |

### Architecture

The feature is structured as a self-contained package under `features/socialshare/`:

- **`SocialShareService` / `AndroidSocialShareService`** — interface that abstracts all Android framework calls (PackageManager, ClipboardManager, FileProvider, intent construction) so the ViewModel never holds a `Context`.
- **`SocialShareViewModel`** — on creation it detects which platform apps are installed and begins caching the project image in the background. Exposes `onPlatformSelected`, `onCopyLinkClicked`, and `onCopiedToastShown`.
- **`SocialShareSheet`** — a `ModalBottomSheet` composable. It reads the ViewModel through `LocalSocialShareViewModel` (a `CompositionLocalProvider`) so the ViewModel is always created by the caller with the correct `shareData` rather than inside the composable itself.
- **`ShareImageCache`** — downloads the project image and writes it to the app cache as a `content://` URI via `FileProvider`, which is required to grant read permission to third-party apps.
- **`SocialShareIntentBuilder`** — constructs the correct `Intent` per platform.

### How to integrate

Create the ViewModel where you have access to `shareData`, then wrap the sheet in a `CompositionLocalProvider`:

```kotlin
shareData?.let { data ->
    val shareViewModel = remember(data) {
        SocialShareViewModel(
            shareService = AndroidSocialShareService(context.applicationContext),
            shareData = data
        )
    }
    CompositionLocalProvider(LocalSocialShareViewModel provides shareViewModel) {
        SocialShareSheet(
            shareData = data,
            isVisible = true,
            onDismiss = { shareData = null },
            onIntentReady = { startActivity(it) }
        )
    }
}
```

---

## Intent Content Summary

This section summarizes the content included in the intents generated by `SocialShareIntentBuilder` for each platform.

| Platform | Includes Image? | Includes Link? | Includes Text (Name)? | Notes |
| :--- | :--- | :--- | :--- | :--- |
| **X (Twitter)** | ✅ | ✅ | ✅ | Supports both image and text/link via `ACTION_SEND`. |
| **WhatsApp** | ✅ | ✅ | ✅ | Text is rendered as a caption beneath the image. |
| **Messages (SMS)** | ❌ | ✅ | ✅ | Text-only via `ACTION_SENDTO` for reliability across OEMs. |
| **Email** | ✅ | ✅ | ✅ | Image as inline attachment; falls back to `mailto:` if no image. |
| **Instagram Feed** | ✅ | ✅ | ✅ | Uses `EXTRA_TEXT`; behavior depends on Instagram app version. |
| **Facebook Feed** | ✅ | ✅ | ✅ | Uses `EXTRA_TEXT`; behavior depends on Facebook app version. |
| **Native Chooser** | ✅ | ✅ | ✅ | Universal fallback for any app not listed explicitly. |
| **Stories (IG/FB)** | ✅ | ❌ | ❌ | Custom `ADD_TO_STORY` actions do not have a text/link slot. |

---

--- METRICS ---
- Files Extracted: 3
- Estimated Token Budget: ~2007 tokens
- Canonical Reference: https://codewiki.google/github.com/kickstarter/android-oss
