All Projects → cketti → ShareIntentBuilder

cketti / ShareIntentBuilder

Licence: Apache-2.0 License
Share Intent Builder - Android Library for the type-safe creation of Share Intents.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ShareIntentBuilder

Android-Resource-File-Provider
A simple library to easily provide and share files from app resources
Stars: ✭ 15 (-66.67%)
Mutual labels:  share, intent
React Native Share
Social share, sending simple data to other apps.
Stars: ✭ 2,955 (+6466.67%)
Mutual labels:  share, intent
kap-streamable
Kap plugin - Share on Streamable
Stars: ✭ 27 (-40%)
Mutual labels:  share
videojs-share
Share plugin for video.js
Stars: ✭ 24 (-46.67%)
Mutual labels:  share
Godot-Share
Simple share text and/or image module for Godot Engine (Android & iOS)
Stars: ✭ 58 (+28.89%)
Mutual labels:  share
virtual-assistant
Virtual Assistant
Stars: ✭ 67 (+48.89%)
Mutual labels:  intent
iOS interviews
iOS Interviews - 史上最贴心 iOS 面试知识点分享!不只是 iOS !只为技术的执拗 !👍 全网火速更新中 🔥 期待你的讨论,期待你的 issue ! 🌟
Stars: ✭ 25 (-44.44%)
Mutual labels:  share
AppListManager
📱 AppListManager (Android Library) makes managing application and activity lists easy.
Stars: ✭ 59 (+31.11%)
Mutual labels:  intent
Flow
Android wrapper to simplify process for start an Activity
Stars: ✭ 54 (+20%)
Mutual labels:  intent
cockpit-samba-manager
A Cockpit plugin to manage Samba shares and users.
Stars: ✭ 28 (-37.78%)
Mutual labels:  share
sharestapp
Sharestapp lets you to directly share an image/videos/reels post from Instagram to other apps and also allows to save.
Stars: ✭ 13 (-71.11%)
Mutual labels:  share
OneClip
Share your clipboard with people nearby. No Setup, No Signup.
Stars: ✭ 45 (+0%)
Mutual labels:  share
godot-custom-mobile-template
Godot Game Engine Custom Mobile Template
Stars: ✭ 70 (+55.56%)
Mutual labels:  share
go-http-file-server
Simple command line based HTTP file server to share local file system
Stars: ✭ 90 (+100%)
Mutual labels:  share
Pix
🎨 Pix is an online pixel art community where everyone can unleash their creativity on a 16x16 canvas, built with React-Native for iOS devices. 🚀
Stars: ✭ 86 (+91.11%)
Mutual labels:  share
WebClipChangeAppLogo
iOS14利用WebClip更换图标,做到无缝启动App
Stars: ✭ 47 (+4.44%)
Mutual labels:  intent
linkcast
Share links, images, blogs and everything on the web with your friends in one click using this chrome extension Linkcast
Stars: ✭ 13 (-71.11%)
Mutual labels:  share
netflix-list-exporter
💫‎‎‎‏‏‎ An Extension to export your lists from Netflix to Clipboard area and share it with your friends.
Stars: ✭ 60 (+33.33%)
Mutual labels:  share
sharethis-reactjs
Official ShareThis Social Media Sharing Buttons For React.js
Stars: ✭ 32 (-28.89%)
Mutual labels:  share
grenade
[DEPRECATED] Annotation based intent builder for Android activities and services
Stars: ✭ 28 (-37.78%)
Mutual labels:  intent

Share Intent Builder

Build status Maven Central

An Android Library for the type-safe creation of Share Intents.

Usage

Creating a simple share intent is as easy as this:

Intent shareIntent = ShareIntentBuilder.from(activity)
        .text("Text to share")
        .build();

ShareIntentBuilder also supports adding optional extras and directly launching the share action:

ShareIntentBuilder.from(activity)
        .text("Sharing is caring!")
        .subject("Very important message")
        .to("[email protected]")
        .cc("[email protected]")
        .share();

Of course sharing one or multiple data streams (see EXTRA_STREAM) is also supported.

ShareIntentBuilder.from(activity)
        // stream(Uri) will fetch the type using the ContentResolver
        // supplied by the activity (calls getType() on the content provider)
        .stream(MyContentProvider.getUriForItem(42))
        // you can avoid that by explicitly specifying the type
        .stream(Uri.parse("content://com.example.provider/23"), "image/png")
        .share();

According to the documentation supplying both EXTRA_TEXT and EXTRA_STREAM is not allowed. However, some receiving apps support this. So if you really have to, you can use ShareIntentBuilder to do this by calling ignoreSpecification() first.

ShareIntentBuilder.from(activity)
        .ignoreSpecification()
        .text("EXTRA_TEXT content that may or may not be used by the receiving app")
        .stream(Uri.parse("content://com.example.provider/42"), "application/octet-stream")
        .share();

Include the library

The easiest way to add the library to your project is via Gradle. Add the following lines to your build.gradle:

dependencies {
    compile 'de.cketti.share:share-intent-builder:0.0.2'
}

To tell Gradle where to find the library, make sure build.gradle also contains this:

repositories {
    mavenCentral()
}

Note: jcenter() - the new default when creating projects with Android Studio - will work as well.

License

Copyright 2015 cketti

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].