{"id":17960281,"url":"https://github.com/cketti/shareintentbuilder","last_synced_at":"2025-03-25T03:31:22.154Z","repository":{"id":29348685,"uuid":"32882863","full_name":"cketti/ShareIntentBuilder","owner":"cketti","description":"Share Intent Builder - Android Library for the type-safe creation of Share Intents.","archived":false,"fork":false,"pushed_at":"2016-10-26T13:28:09.000Z","size":299,"stargazers_count":46,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-19T08:37:15.663Z","etag":null,"topics":["android","intent","library","share","share-intent"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cketti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-25T18:23:05.000Z","updated_at":"2025-01-03T01:26:48.000Z","dependencies_parsed_at":"2022-09-26T22:01:21.202Z","dependency_job_id":null,"html_url":"https://github.com/cketti/ShareIntentBuilder","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2FShareIntentBuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2FShareIntentBuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2FShareIntentBuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cketti%2FShareIntentBuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cketti","download_url":"https://codeload.github.com/cketti/ShareIntentBuilder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245394733,"owners_count":20608122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","intent","library","share","share-intent"],"created_at":"2024-10-29T11:05:58.073Z","updated_at":"2025-03-25T03:31:22.138Z","avatar_url":"https://github.com/cketti.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Share Intent Builder\n\n[![Build status](https://api.travis-ci.org/cketti/ShareIntentBuilder.svg)](https://travis-ci.org/cketti/ShareIntentBuilder)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.cketti.share/share-intent-builder/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.cketti.share/share-intent-builder)\n\nAn Android Library for the type-safe creation of Share Intents.\n\n## Usage\n\nCreating a simple share intent is as easy as this:\n\n```java\nIntent shareIntent = ShareIntentBuilder.from(activity)\n        .text(\"Text to share\")\n        .build();\n```\n\n`ShareIntentBuilder` also supports adding optional extras and directly launching the share action:\n\n```java\nShareIntentBuilder.from(activity)\n        .text(\"Sharing is caring!\")\n        .subject(\"Very important message\")\n        .to(\"everyone@example.com\")\n        .cc(\"carebear@example.com\")\n        .share();\n```\n\nOf course sharing one or multiple data streams\n(see [EXTRA_STREAM](https://developer.android.com/reference/android/content/Intent.html#EXTRA_STREAM))\nis also supported.\n\n```java\nShareIntentBuilder.from(activity)\n        // stream(Uri) will fetch the type using the ContentResolver\n        // supplied by the activity (calls getType() on the content provider)\n        .stream(MyContentProvider.getUriForItem(42))\n        // you can avoid that by explicitly specifying the type\n        .stream(Uri.parse(\"content://com.example.provider/23\"), \"image/png\")\n        .share();\n```\n\nAccording to the documentation supplying both\n[EXTRA_TEXT](https://developer.android.com/reference/android/content/Intent.html#EXTRA_TEXT) and\n[EXTRA_STREAM](https://developer.android.com/reference/android/content/Intent.html#EXTRA_STREAM) is not allowed.\nHowever, some receiving apps support this. So if you really have to, you can use `ShareIntentBuilder` to do this by\ncalling `ignoreSpecification()` first.\n\n```java\nShareIntentBuilder.from(activity)\n        .ignoreSpecification()\n        .text(\"EXTRA_TEXT content that may or may not be used by the receiving app\")\n        .stream(Uri.parse(\"content://com.example.provider/42\"), \"application/octet-stream\")\n        .share();\n```\n\n\n## Include the library\n\nThe easiest way to add the library to your project is via Gradle. Add the following lines to your `build.gradle`:\n\n```groovy\ndependencies {\n    compile 'de.cketti.share:share-intent-builder:0.0.2'\n}\n```\n\nTo tell Gradle where to find the library, make sure `build.gradle` also contains this:\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n```\n\nNote: `jcenter()` - the new default when creating projects with Android Studio - will work as well.\n\n## License\n\n    Copyright 2015 cketti\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcketti%2Fshareintentbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcketti%2Fshareintentbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcketti%2Fshareintentbuilder/lists"}