I want to export the Phone contacts to External storage area. I didn't work with this type of method. Anyone guide me to do this?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Android Nougat Update :
Other answers code working for lots of people before Nougat update.
Please take care of :
is not working on Android Nougat.
fd.getDeclaredLength() is always return -1.
Please use below code for read bytes without any library :
The method readBytes() get from this answer.
Try out this. its work for me to create a .vcf file of all contact and stored it into SDCARD.
make sure all permission are give properly.
It's working for me and as well working in Nougat devices. Thank you so much @pratik and @sanat .
I tried above two codes and I got the .VCF file too, but it was containing only one contact. so here is Perfectly Edited and running code....you will get all contacts in .VCF file:
Second Method:
Please Don't forget to add :
In your code, you wrote one function but from where is this function called? And what is the meaning of
get(View view)
function? This function is not being called so it can be removed.I've edited my answer as per your requirements and tested it with 500 Contacts to save a single vCard file with 500 contacts in my sd card.