When you are doing your project recently, you need to use Fileprovider. Therefore, the following studies are summarized as follows:
Official path: http://developer.android.com/intl/zh-cn/training/secure-file-sharing/setup-sharing.html
- such as SMS to share a picture to Bluetooth, need to do is set in the text message is as follows:
First, you need to add a provider tag to the Menifest:
1 <!--define the shared information here - 2 <provider3 Android:name= "Android.support.v4.content.FileProvider" 4 android:authorities= "Com.example.fileproviderdemo.fileprovider" 5 android:exported= "false" 6 android:granturipermissions= "true" > 7 <Meta-data8 Android:name= "Android.support.FILE_PROVIDER_PATHS" 9 Android:resource= "@xml/filepaths" /> Ten </provider>
Then, specify the shared directory and create a new Filepaths.xml file in the Res directory XML
1 <?XML version= "1.0" encoding= "Utf-8"?> 2 <Resources> 3 <Paths> 4 <Files-pathPath= "files/"name= "Intfiles" /> 5 <External-pathPath= "files/"name= "Extfiles" /> 6 </Paths> 7 </Resources>
It's better to write a demo sometime.
Android Development Fileprovider