Thank you so much Ryan, I'll dig inside that source, hope that solve my 
problem ;).

On Monday, July 22, 2013 7:56:49 PM UTC+7, Ryan Harter wrote:
>
> Take a look at that AOSP sources.  You can see that the built in contacts 
> app is saving the photos to the file system.
>
> On the PhotoStore class in the contacts provider, here is the javadoc 
> comment on the class:
>
>
>    1. /**
>    2.  * Photo storage system that stores the files directly onto the 
>    hard disk 
>    3.  * in the specified directory.
>    4.  */ 
>
>
>  
> https://android.googlesource.com/platform/packages/providers/ContactsProvider/+/master/src/com/android/providers/contacts/PhotoStore.java
>
> I know the subject tends to be a religious war, but I never store binary 
> data in a database unless absolutely necessary.  In this case, use the 
> database to store an id or url of the photo, then have a specified file 
> structure based on that id (could be one large directory with a photo named 
> after each id).
>
> Remember,  you can also use a content provider to provide access to the 
> file system, so check that out as well.
>
> Best
> Ryan
>
>
> On Sun, Jul 21, 2013 at 11:31 PM, cybersun <quoc...@gmail.com<javascript:>
> > wrote:
>
>> Hi all,
>> I am creating an app that user can communication with other friends (IM 
>> app, send message, card, ...), so user have provide user's profile like id, 
>> name, avatar.
>> My question is: what is the best way to save friend's avatar to make 
>> local contact list for my app?
>>
>> I created a local database for saving contact information, synchronize 
>> with a remote database on my server. In my app, can I save avatars into:
>> (1) SQLite database?
>> (2) SDcard?
>> (3) App cache?
>>
>> Android Contacts app use Contacts Storage to store contact's avatar, I 
>> dont know what implemented inside.
>>
>> I saw other apps like Whatsapp,  wechat, line, zalo, ... do not save 
>> avatars on SDcard, so where are avatars when contact list has many contacts 
>> (>100).
>>
>> Hope you can help, thanks.
>>
>> -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to 
>> android-d...@googlegroups.com<javascript:>
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Android Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to android-developers+unsubscr...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to