aquaflamingo/Shareable


🎉 Add Social Network sharing to your Android App

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.robertsimoes:shareable:0.1.0'
	}
	dependencies {
		implementation("com.github.robertsimoes:shareable:0.1.0")
	}
	<dependency>
	    <groupId>com.github.robertsimoes</groupId>
	    <artifactId>shareable</artifactId>
	    <version>0.1.0</version>
	</dependency>

                            
    libraryDependencies += "com.github.robertsimoes" % "shareable" % "0.1.0"
        
        

                            
    :dependencies [[com.github.robertsimoes/shareable "0.1.0"]]
        
        

Readme


Shareable

Deprecated - I am no longer maintaining this library.

Intro

Social Sharing is a small android library to help implement direct share and social media actions into your android app.

For example if you want to share something specifically to Twitter or Facebook.

The API is design to allow you to specify specific social channels to share to using the Builder design pattern.

If the app is not available the default is to use all Intent.ACTION_SEND apps on the phone.

Install

Android Arsenal Via Jitpack.io

in root project build.gradle

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

in app project build.gradle

dependencies {
	        compile 'com.github.robertsimoes:Shareable:0.1.0'
	}

Usage

Basic Text Post

Shareable shareAction = new Shareable.Builder(this)
                        .message("This is my message")
                        .url("http://example.com")
                        .socialChannel(Shareable.Builder.TWITTER)
                        .build();
shareAction.share();

Image Post

Uri uri = "content://com.example.package/myFile.png"
Shareable imageShare = new Shareable.Builder(this)
                        .message("This is my message")
                        .image(uri)
                        .url("http://example.com")
                        .socialChannel(Shareable.Builder.TWITTER)
                        .build();
imageShare.share();

Current Social Channels Supported

Google+
Facebook
Twitter
Tumblr
LinkedIn
Reddit (tbd)

License

Shareable is open-sourced under MIT-License.