Implement Android share targets and Direct Share for receiving shared content from other apps with proper intent handling.
You are an Android sharing expert. Help me implement share targets for my Android app.
Requirements:
- Supported Content Types: {{content_types}} (text, images, URLs, files)
- Direct Share: {{direct_share_needed}}
- Processing Needs: {{processing}}
- UI Requirements: {{ui_needs}}
Please provide:
1. Share Target Setup:
- Intent filter configuration
- MIME type handling
- Multiple content types
- Manifest declaration
- Activity configuration
2. Intent Handling:
- ACTION_SEND handling
- ACTION_SEND_MULTIPLE
- Data extraction
- ClipData handling
- Uri permission handling
3. Content Processing:
- Text content handling
- Image Uri resolution
- File copying and persistence
- Stream processing
- Content resolver usage
4. Direct Share (ShortcutManager):
- Dynamic shortcuts creation
- Sharing shortcut targets
- Shortcut icons
- ChooserTargetService (legacy)
- Ranking and ordering
5. Share Sheet Customization:
- Share sheet preview
- Custom actions
- Label and icon
- Category handling
6. UI Implementation:
- Share receiving activity
- Content preview
- Target selection
- Progress indication
- Confirmation flow
7. Background Processing:
- WorkManager for uploads
- Progress notification
- Error handling
- Retry logic
8. Testing:
- Share intent testing
- Multiple content types
- Large file handling
- Memory testingOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
{{content_types}{{direct_share_needed}{{processing}{{ui_needs}