android-media-files-sharing
Use modern Android file, media, picker, FileProvider, and share-sheet APIs with minimal permissions.
What this skill does
# Android Media Files Sharing ## When To Use - Use this skill when the request is about: android file sharing, photo picker android app, fileprovider setup android. - Primary outcome: Use modern Android file, media, picker, FileProvider, and share-sheet APIs with minimal permissions. - Reach for this skill when the core problem is content URIs, share-sheet flows, picker choice, or app-to-app file exchange. Use `android-permissions-activity-results` only when the hard part is the runtime permission flow itself. - Handoff skills when the scope expands: - `android-permissions-activity-results` - `android-security-best-practices` ## Workflow 1. Start with the asset movement path: pick existing media, open a document, create/export a file, capture new content, or share app-owned content to another app. 2. Choose the narrowest platform surface first: Photo Picker, SAF contracts, `FileProvider`, or chooser-based sharing before considering broad storage permissions. 3. Keep file ownership and URI grants explicit with app-private storage, MIME types, temporary grants, and stable authorities. 4. Validate return flows, absent-capability fallbacks, and recipient-app interoperability instead of testing only the happy path. 5. Hand off runtime permission complexity or deeper hardening only after the URI and sharing contract is correct. ## Guardrails - Prefer Photo Picker, SAF, and chooser APIs over broad media or storage permissions where possible. - Share content with `content://` URIs and temporary grants, never raw file paths. - Keep exported authorities, MIME types, and cache cleanup explicit. - Treat recipients outside your app as untrusted; validate what leaves the app and what comes back. ## Anti-Patterns - Requesting broad media or storage access when Photo Picker or SAF is enough. - Sharing `file://` paths or world-readable files instead of `FileProvider` URIs. - Assuming every recipient app handles every MIME type or URI permission correctly. - Mixing permission-flow design with file-sharing contract design until both become unclear. ## Review Focus - Picker/SAF/FileProvider/chooser selection. - MIME type, URI authority, and grant lifecycle correctness. - Minimal-permission media access. - Recipient-app interoperability and cleanup of temporary files. ## Examples ### Happy path - Scenario: Attach and share a task snapshot using the least-privilege API. - Command: `cd examples/orbittasks-compose && ./gradlew :app:testDebugUnitTest` ### Edge case - Scenario: Handle absent picker support or denied media capabilities in the XML fixture. - Command: `cd examples/orbittasks-xml && ./gradlew :app:testDebugUnitTest` ### Failure recovery - Scenario: Separate media/file flows from permission-only or networking-only requests. - Command: `python3 scripts/eval_triggers.py --skill android-media-files-sharing` ## Done Checklist - The platform surface is narrower than a broad storage permission where possible. - URI authorities, MIME types, and temporary grants are explicit. - Picker and share-sheet fallbacks are covered. - Permission-only work is handed off instead of conflated with the sharing contract. ## Official References - [https://developer.android.com/training/data-storage/shared/photopicker](https://developer.android.com/training/data-storage/shared/photopicker) - [https://developer.android.com/training/data-storage/shared/documents-files](https://developer.android.com/training/data-storage/shared/documents-files) - [https://developer.android.com/training/secure-file-sharing/setup-sharing](https://developer.android.com/training/secure-file-sharing/setup-sharing) - [https://developer.android.com/training/sharing/send](https://developer.android.com/training/sharing/send) - [https://developer.android.com/topic/performance/graphics/picker](https://developer.android.com/topic/performance/graphics/picker)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.