how to display contact photo url

2,425 views
Skip to first unread message

alec

unread,
Apr 28, 2012, 3:40:58 PM4/28/12
to phon...@googlegroups.com
Hi,

I am able to read the contacts on my android phone and I would like to display the contact photo.  Phonegap provides the URL to the photo, but it is in the form content://com.android.contact/contact/XXXX not a file scheme.  Just for kicks I tried to put this in an img tag in hopes that android's web kit would figure it out, but the photo does not render.  Is it possible to directly display the photo in html, or do I have to write a plugin to use Android's content resolver and write out a file somewhere on the sd card.

Thanks,
Alec

Simon MacDonald

unread,
Apr 28, 2012, 9:55:41 PM4/28/12
to phon...@googlegroups.com
Hmmm...Android should be smart enough to figure that out. I'm
surprised it did not work for you. I believe it has in the past for me
but I haven't tested it in awhile.

Try passing the content:// URI to window.resolveLocalFileSystemURI as
I believe I put in code to give you back a real path.

http://docs.phonegap.com/en/1.6.1/cordova_file_file.md.html#LocalFileSystem_resolve_local_file_system_uri_quick_example

Simon Mac Donald
http://hi.im/simonmacdonald
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

Pedro Guardiola

unread,
May 4, 2012, 6:29:25 AM5/4/12
to phon...@googlegroups.com
Hi Simon, 

I've just started with phonegap and I'm trying to use resolveLocalFileSystemURI with the value of a photo field (content://....) when type is url in contacts but I always get error "Invalid column_data" how can I solve this problem?

Thanks in advance

Pedro Guardiola

unread,
May 4, 2012, 6:36:09 AM5/4/12
to phon...@googlegroups.com
Hi Simon,alec I have tried to use window.resolveLocalFileSystemURI with the content of a contact photo field, the photo has type url but I always get the error "Invalid column_data". How can I solve this problem? I've tried with phonegap 1.6.1 and 1.7.0rc1 with no results

Thanks in advance!
Pedro Guardiola

Simon MacDonald

unread,
May 4, 2012, 3:25:47 PM5/4/12
to phon...@googlegroups.com
Can you guys reproduce the problem while running "adb logcat"? Also let me know what version of PhoneGap and Android you are using as well as what device you are testing it on.

Simon Mac Donald
http://hi.im/simonmacdonald


--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

Pedro Guardiola

unread,
May 7, 2012, 3:48:20 AM5/7/12
to phon...@googlegroups.com
Hi Simon, here is the log, found 2 problems, DatabaseUtils and BitmapUtil

I'm testing with android API Level 8 (2.2.2) . Model Motorola Defy MB525, If you need more info please, tell me which one you need

Thanks in advance again

Pedro

Log capture: 

09:37:57.420 1448 #1448 ERROR DatabaseUtils Writing exception to parcel
09:37:57.420 1448 #1448 ERROR DatabaseUtils java.lang.IllegalArgumentException: Invalid column _data
09:37:57.420 1448 #1448 ERROR DatabaseUtils at android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBuilder.java:523)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.java:370)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:323)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:4903)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:4888)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:150)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:133)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at android.os.Binder.execTransact(Binder.java:304)
09:37:57.420 1448 #1448 ERROR DatabaseUtils at dalvik.system.NativeStart.run(Native Method)
09:37:57.647 4667 com.peoplecall.canibal.android DEBUG CordovaLog Invalid column _data
09:37:57.647 4667 com.peoplecall.canibal.android DEBUG CordovaLog file:///android_asset/www/contacts.js: Line 108 : Invalid column _data
09:37:57.647 4667 com.peoplecall.canibal.android INFO Web Console Invalid column _data at file:///android_asset/www/contacts.js:108
09:37:57.702 4667 com.peoplecall.canibal.android DEBUG dalvikvm GC_FOR_MALLOC freed 2203 objects / 814152 bytes in 47ms
09:37:57.772 4672 #4672 DEBUG dalvikvm GC_FOR_MALLOC freed 4454 objects / 389680 bytes in 41ms
09:37:57.866 4672 #4672 DEBUG Finsky [1] 5.onFinished: Installation state replication succeeded.
09:37:58.217 1554 #1554 DEBUG dalvikvm GC_EXPLICIT freed 374 objects / 17800 bytes in 73ms
09:38:00.022 1392 #1392 DEBUG KeyguardUpdateMonitor received broadcast android.intent.action.TIME_TICK
09:38:00.022 1392 #1392 DEBUG KeyguardUpdateMonitor handleTimeUpdate
09:38:03.928 4787 #4787 VERBOSE SourceCache Queue source cache refresh request, delayed (ms): 0
09:38:03.952 4787 #4787 VERBOSE GroupCache Queue group cache refresh request, delayed (ms): 0
09:38:03.960 4787 #4787 DEBUG CacheService CacheService source and group info cached
09:38:03.967 1392 #1392 INFO ActivityManager Start proc com.motorola.blur.contacts.data for broadcast com.motorola.blur.contacts.data/.BlurPhotoDownloadActionReceiver: pid=4796 uid=10008 gids={3003, 2001, 1015}
09:38:04.030 4796 #4796 VERBOSE BlurApp com.motorola.blur.contacts.data onCreate called, initilizing ContextUtil ...
09:38:04.030 4796 #4796 DEBUG BlrPhotoDwnldReceiver Received a request to explicitly schedule the photo download to start at a later time
09:38:04.038 4796 #4796 DEBUG BlrPhotoDwnldReceiver Download service scheduled
09:38:04.045 4796 #4796 DEBUG BlrPhotoDwnSchedService AlarmManager configured to schedule a start photo download service in 0 hours 0 mins 0 secs.
09:38:04.053 4787 #4787 DEBUG SourceCache Found that the following provider ids have the capability, 9: [8, 9, 121, 7]
09:38:04.077 4796 #4796 DEBUG PollingManagerClient PollingManagerClient()
09:38:04.077 4796 #4796 DEBUG PollingManagerClient registerApp(): BlrPhotoDwnldService:ACTION_START_DOWNLOAD_IMMEDIATLEY:0
09:38:04.085 4796 #4796 INFO BlrPhotoDwnSchedService Photo schedule service has been destroyed
09:38:04.085 1478 #1478 DEBUG PollingManager registerApp(): BlrPhotoDwnldService
09:38:04.092 1478 #1478 DEBUG PollingManager wake lock acquired
09:38:04.100 1478 #1478 DEBUG PollingManager decideWhoNeedsPolling(): polling BlrPhotoDwnldService
09:38:04.116 4796 #4796 DEBUG BlrPhotoDwnldService Successfully registered with the polling manager
09:38:04.249 1392 #1392 DEBUG dalvikvm GC_FOR_MALLOC freed 42850 objects / 2173704 bytes in 142ms
09:38:04.249 1448 #1448 DEBUG DEBUG Selection used is -null
09:38:04.249 4796 #4796 DEBUG BlrPhotoDwnldService Notified by polling manager that it is okay to start network connections
09:38:04.249 4796 #4796 DEBUG PollingManagerClient unregisterApp(): BlrPhotoDwnldService
09:38:04.249 1478 #1478 DEBUG PollingManager unregisterApp(): BlrPhotoDwnldService
...




04.319 4787 #4787 VERBOSE GroupCache Queue group cache refresh request, delayed (ms): 3000
09:38:04.335 1448 #1448 DEBUG DEBUG Selection used is -null
09:38:04.342 4787 #4787 DEBUG GroupCache Getting user-defined groups
09:38:04.350 4787 #4787 DEBUG GroupCache Encountered group title, Family
09:38:04.366 1478 #1478 INFO PollingManager calculateShortestInterval(): shortest interval is 1330666
09:38:04.366 4796 #4796 INFO PollingManagerClient close()
09:38:04.366 4796 #4796 DEBUG BlrPhotoDwnldService Starting the photo service. Checking to see if any photos need to be downloaded
09:38:04.366 4796 #4796 DEBUG BlrPhotoDwnldService Looking for photos that need to be downloaded
09:38:04.381 1478 #1478 DEBUG PollingManager wake lock released
09:38:04.389 4787 #4787 DEBUG GroupCache Encountered group title, Friends
09:38:04.397 4787 #4787 DEBUG GroupCache Encountered group title, Google
09:38:04.405 4787 #4787 DEBUG GroupCache Encountered group title, Work
09:38:04.420 4787 #4787 DEBUG GroupCache Encountered source name, null
09:38:04.420 4787 #4787 DEBUG GroupCache Encountered source name, blur
09:38:04.428 4787 #4787 DEBUG GroupCache Encountered source name, facebook
09:38:04.436 4787 #4787 DEBUG SourceCache Returning stroed ICON FOR-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546521...@random.svcmot.com:facebook
09:38:04.436 4787 #4787 DEBUG GroupCache Encountered source name, twitter
09:38:04.436 4787 #4787 DEBUG SourceCache Returning stroed ICON FOR-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546521...@random.svcmot.com:twitter
09:38:04.444 4787 #4787 DEBUG GroupCache Notify group cache observers of state change
09:38:04.514 1475 #1475 DEBUG DSCP Disqualified null for content://com.motorola.blur.setupprovider/providers/0
09:38:04.530 4787 #4787 ERROR BitmapUtil Unable to decode bitmap
09:38:04.530 4787 #4787 ERROR BitmapUtil java.io.FileNotFoundException: No icons fit this description
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:143)
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:608)
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:471)
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.content.ContentResolver.openInputStream(ContentResolver.java:306)
09:38:04.530 4787 #4787 ERROR BitmapUtil at com.motorola.blur.util.ui.BitmapUtil.fetchBitmapWithAdjustedDimensions(BitmapUtil.java:50)
09:38:04.530 4787 #4787 ERROR BitmapUtil at com.motorola.blur.contacts.cache.SourceCache.getSourceIcon(SourceCache.java:852)
09:38:04.530 4787 #4787 ERROR BitmapUtil at com.motorola.blur.contacts.cache.SourceCache.access$000(SourceCache.java:41)
09:38:04.530 4787 #4787 ERROR BitmapUtil at com.motorola.blur.contacts.cache.SourceCache$2.run(SourceCache.java:800)
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.os.Handler.handleCallback(Handler.java:587)
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.os.Handler.dispatchMessage(Handler.java:92)
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.os.Looper.loop(Looper.java:143)
09:38:04.530 4787 #4787 ERROR BitmapUtil at android.os.HandlerThread.run(HandlerThread.java:60)
09:38:04.530 4787 #4787 WARN SourceCache Unable to obtain an icon for the provider, Contactos
09:38:04.545 4796 #4796 DEBUG BlrPhotoDwnldService Did not find any photos that need to be downloaded
09:38:04.561 4796 #4796 INFO PollingManagerClient close()
09:38:04.561 4796 #4796 DEBUG BlrPhotoDwnldService Photo download service has been destroyed
09:38:04.569 1392 #1392 INFO ActivityManager No longer want com.motorola.togglewidgets (pid 4496): hidden #21
09:38:04.616 4787 #4787 DEBUG dalvikvm GC_FOR_MALLOC freed 3043 objects / 326880 bytes in 58ms
09:38:04.655 4787 #4787 DEBUG dalvikvm GC_EXTERNAL_ALLOC freed 426 objects / 27280 bytes in 31ms
09:38:04.663 4787 #4787 VERBOSE BitmapUtil got bitmap android.graphics.Bitmap@45a68910 with sampleSize 2
09:38:04.663 4787 #4787 DEBUG SourceCache Adding ICON-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546521...@random.svcmot.com:facebook ICON-android.graphics.Bitmap@45a68910
09:38:04.663 4787 #4787 DEBUG GroupCache Accounts database table SourceCache changed. Refreshing the groups cache
09:38:04.663 4787 #4787 DEBUG GroupCache Forcing refresh of groups cache
09:38:04.663 4787 #4787 VERBOSE GroupCache Queue group cache refresh request, delayed (ms): 3000
09:38:04.678 4787 #4787 VERBOSE BitmapUtil got bitmap android.graphics.Bitmap@45a27058 with sampleSize 2
09:38:04.678 4787 #4787 DEBUG SourceCache Adding ICON-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546521...@random.svcmot.com:twitter ICON-android.graphics.Bitmap@45a27058
09:38:04.678 4787 #4787 DEBUG GroupCache Accounts database table SourceCache changed. Refreshing the groups cache
09:38:04.678 4787 #4787 DEBUG GroupCache Forcing refresh of groups cache
09:38:04.678 4787 #4787 VERBOSE GroupCache Clearing pending group cache refresh requests
09:38:04.678 4787 #4787 VERBOSE GroupCache Queue group cache refresh request, delayed (ms): 3000
09:38:07.749 1448 #1448 DEBUG DEBUG Selection used is -null
09:38:07.756 4787 #4787 DEBUG GroupCache Getting user-defined groups
09:38:07.756 4787 #4787 DEBUG GroupCache Encountered group title, Family
09:38:07.764 4787 #4787 DEBUG GroupCache Encountered group title, Friends
09:38:07.772 4787 #4787 DEBUG GroupCache Encountered group title, Google
09:38:07.780 4787 #4787 DEBUG GroupCache Encountered group title, Work
09:38:07.788 4787 #4787 DEBUG GroupCache Encountered source name, null
09:38:07.788 4787 #4787 DEBUG GroupCache Encountered source name, blur
09:38:07.788 4787 #4787 DEBUG GroupCache Encountered source name, facebook
09:38:07.788 4787 #4787 DEBUG SourceCache Returning stroed ICON FOR-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546521...@random.svcmot.com:facebook
09:38:07.788 4787 #4787 DEBUG GroupCache Encountered source name, twitter
09:38:07.796 4787 #4787 DEBUG SourceCache Returning stroed ICON FOR-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546521...@random.svcmot.com:twitter
09:38:07.796 4787 #4787 DEBUG GroupCache Notify group cache observers of state 




El viernes, 4 de mayo de 2012 21:25:47 UTC+2, Simon escribió:
Can you guys reproduce the problem while running "adb logcat"? Also let me know what version of PhoneGap and Android you are using as well as what device you are testing it on.

Simon Mac Donald
http://hi.im/simonmacdonald


On Fri, May 4, 2012 at 6:36 AM, Pedro Guardiola <pguar...@gmail.com> wrote:
Hi Simon,alec I have tried to use window.resolveLocalFileSystemURI with the content of a contact photo field, the photo has type url but I always get the error "Invalid column_data". How can I solve this problem? I've tried with phonegap 1.6.1 and 1.7.0rc1 with no results

Thanks in advance!
Pedro Guardiola

El sábado, 28 de abril de 2012 21:40:58 UTC+2, alec escribió:
Hi,

I am able to read the contacts on my android phone and I would like to display the contact photo.  Phonegap provides the URL to the photo, but it is in the form content://com.android.contact/contact/XXXX not a file scheme.  Just for kicks I tried to put this in an img tag in hopes that android's web kit would figure it out, but the photo does not render.  Is it possible to directly display the photo in html, or do I have to write a plugin to use Android's content resolver and write out a file somewhere on the sd card.

Thanks,
Alec

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

Simon MacDonald

unread,
May 15, 2012, 7:59:31 PM5/15/12
to phon...@googlegroups.com
Wow, that is crazy. The query into the media DB is failing with a "java.lang.IllegalArgumentException: Invalid column _data". Which means the one column I'm searching on is failing while trying to build the sql statement. I can only tell you that this makes no sense. 

Is there anything special about this contact or device?

Simon Mac Donald
http://hi.im/simonmacdonald


Marek Kwasecki

unread,
May 28, 2012, 7:31:32 PM5/28/12
to phonegap
Oh,

I have the same problem.

Smaller log though:

I/Web Console( 327): Error: Status=2 Message=Class not found at
file:///android_asset/www/lib/cordova-1.7.0.js:958
I/Web Console( 327): Error initializing Network Connection: Class not
found at file:///android_asset/www/lib/cordova-1.7.0.js:4642
I/Web Console( 327): photos.length: 1 at file:///android_asset/www/app/app-all-debug.js:100
I/Web Console( 327): photos[0].value: content://com.android.contacts/contacts/1/photo
at file:///android_asset/www/app/app-all-debug.js:101
E/DatabaseUtils( 166): Writing exception to parcel
E/DatabaseUtils( 166): java.lang.IllegalArgumentException: Invalid
column _data
E/DatabaseUtils( 166): at
android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBuilder.java:
523)
E/DatabaseUtils( 166): at
android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.java:
370)
E/DatabaseUtils( 166): at
android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:
323)
E/DatabaseUtils( 166): at
com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:
4737)
E/DatabaseUtils( 166): at
com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:
4722)
E/DatabaseUtils( 166): at android.content.ContentProvider
$Transport.bulkQuery(ContentProvider.java:174)
E/DatabaseUtils( 166): at
android.content.ContentProviderNative.onTransact(ContentProviderNative.java:
111)
E/DatabaseUtils( 166): at android.os.Binder.execTransact(Binder.java:
320)
E/DatabaseUtils( 166): at dalvik.system.NativeStart.run(Native
Method)
I/Web Console( 327): fail at file:///android_asset/www/app/app-all-debug.js:146
D/dalvikvm( 166): GC_EXPLICIT freed 47K, 52% free 2779K/5703K,
external 1625K/2137K, paused 53ms
D/SntpClient( 61): request time failed: java.net.SocketException:
Address family not supported by protocol
D/dalvikvm( 327): GC_CONCURRENT freed 1500K, 58% free 2991K/7111K,
external 4066K/5190K, paused 5ms+7ms
D/SntpClient( 61): request time failed: java.net.SocketException:
Address family not supported by protocol


Nothing special about the contact. This is from the Android simulator
set up for API level 8 (Android 2.2)

Please advise.


regards,
Marek

On 16 Maj, 01:59, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> Wow, that is crazy. The query into the media DB is failing with a "
> java.lang.IllegalArgumentException: Invalid column _data". Which means the
> one column I'm searching on is failing while trying to build the sql
> statement. I can only tell you that this makes no sense.
>
> Is there anything special about this contact or device?
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald
>
> On Mon, May 7, 2012 at 3:48 AM, Pedro Guardiola <pguardi...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hi Simon, here is the log, found 2 problems, DatabaseUtils and BitmapUtil
>
> > I'm testing with android API Level 8 (2.2.2) . Model Motorola Defy MB525,
> > If you need more info please, tell me which one you need
>
> > Thanks in advance again
>
> > Pedro
>
> > Log capture:
>
> >  09:37:57.420 1448 #1448 ERROR DatabaseUtils Writing exception to parcel
> > 09:37:57.420 1448 #1448 ERROR DatabaseUtils java.lang.IllegalArgumentException:
> > Invalid column _data  09:37:57.420 1448 #1448 ERROR DatabaseUtils at
> > android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBui lder.java:523)
> > 09:37:57.420 1448 #1448 ERROR DatabaseUtils at
> > android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.ja va:370)
> > 09:37:57.420 1448 #1448 ERROR DatabaseUtils at
> > android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:32 3)
> > 09:37:57.420 1448 #1448 ERROR DatabaseUtils at
> > com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.ja va:4903)
> > 09:37:57.420 1448 #1448 ERROR DatabaseUtils at
> > com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.ja va:4888)
> > FOR-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546 52189741952205081...@random.svcmot.com:
> > facebook  09:38:04.436 4787 #4787 DEBUG GroupCache Encountered source
> > name, twitter  09:38:04.436 4787 #4787 DEBUG SourceCache Returning stroed
> > ICON
> > FOR-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:35471704166546 52189741952205081...@random.svcmot.com:
> > twitter  09:38:04.444 4787 #4787 DEBUG GroupCache Notify group cache
> > observers of state change  09:38:04.514 1475 #1475 DEBUG DSCP Disqualified
> > null for content://com.motorola.blur.setupprovider/providers/0
> > 09:38:04.530 4787 #4787 ERROR BitmapUtil Unable to decode bitmap
> > 09:38:04.530 4787 #4787 ERROR BitmapUtil java.io.FileNotFoundException:
> > No icons fit this description  09:38:04.530 4787 #4787 ERROR BitmapUtil at
> > android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromPa rcel(DatabaseUtils.java:143)
> > 09:38:04.530 4787 #4787 ERROR BitmapUtil at
> > android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.ja va:608)
> > 09:38:04.530 4787 #4787 ERROR BitmapUtil at
> > android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.jav a:471)
> > 09:38:04.530 4787 #4787 ERROR BitmapUtil at
> > android.content.ContentResolver.openInputStream(ContentResolver.java:306)
> > 09:38:04.530 4787 #4787 ERROR BitmapUtil at
> > com.motorola.blur.util.ui.BitmapUtil.fetchBitmapWithAdjustedDimensions(Bitm apUtil.java:50)
> > ICON-com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE:3547170416654 652189741952205081...@random.svcmot.com:facebook
> > ICON-android.graphics.Bitmap@45a68910  09:38:04.663 4787 #4787 DEBUG
> > GroupCache Accounts database table SourceCache
>
> ...
>
> więcej »

casa

unread,
Jun 1, 2012, 3:42:54 AM6/1/12
to phonegap
I have the same problem

NexusOne and samsung galaxyTap (both android 2.3.6)

At phonegap 1.7, resolveLocalFileSystemURI call failedFunction
but phonegap 1.8 didn't call any function.

Please advise.




On 5월29일, 오전8시31분, Marek Kwasecki <marek.kwase...@beyond-the-
horizon.org> wrote:
> Oh,
>
> I have the same problem.
>
> Smaller log though:
>
> I/Web Console(  327): Error: Status=2 Message=Class not found at
> file:///android_asset/www/lib/cordova-1.7.0.js:958
> I/Web Console(  327): Error initializing Network Connection: Class not
> found at file:///android_asset/www/lib/cordova-1.7.0.js:4642
> I/Web Console(  327): photos.length: 1 at file:///android_asset/www/app/app-all-debug.js:100
> I/Web Console(  327): photos[0].value: content://com.android.contacts/contacts/1/photo
> at file:///android_asset/www/app/app-all-debug.js:101
> E/DatabaseUtils(  166): Writing exception to parcel
> E/DatabaseUtils(  166): java.lang.IllegalArgumentException: Invalid
> column _data
> E/DatabaseUtils(  166):         at
> android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBui­lder.java:
> 523)
> E/DatabaseUtils(  166):         at
> android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.ja­va:
> 370)
> E/DatabaseUtils(  166):         at
> android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:
> 323)
> E/DatabaseUtils(  166):         at
> com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.ja­va:
> 4737)
> E/DatabaseUtils(  166):         at
> com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.ja­va:
> > > 09:38:04.530 4787...
>
> 추가 정보 »

Simon MacDonald

unread,
Jun 1, 2012, 3:06:05 PM6/1/12
to phon...@googlegroups.com
Okay, if I take a photo URI returned from a contact search, something like:

content://com.android.contacts/contacts/3690/photo

and pass it to window.resolveLocalFileSystemURI I can reproduce this stack trace.

However, if I just do this:
            var myImg = document.getElementById("test_img");

            myImg.src = "content://com.android.contacts/contacts/3690/photo";

The photo displays fine. The Android system should be able to display content URL just great.
On Fri, Jun 1, 2012 at 3:42 AM, casa <casan...@gmail.com> wrote:
I have the same problem

NexusOne and samsung galaxyTap (both android 2.3.6)

At phonegap 1.7, resolveLocalFileSystemURI call failedFunction
but phonegap 1.8 didn't call any function.

Please advise.




On 5월29일, 오전8시31분, Marek Kwasecki <marek.kwase...@beyond-the-
horizon.org> wrote:
> Oh,
>
> I have the same problem.
>
> Smaller log though:
>
> I/Web Console(  327): Error: Status=2 Message=Class not found at
> file:///android_asset/www/lib/cordova-1.7.0.js:958
> I/Web Console(  327): Error initializing Network Connection: Class not
> found at file:///android_asset/www/lib/cordova-1.7.0.js:4642
> I/Web Console(  327): photos.length: 1 at file:///android_asset/www/app/app-all-debug.js:100
> I/Web Console(  327): photos[0].value: content://com.android.contacts/contacts/1/photo
> at file:///android_asset/www/app/app-all-debug.js:101
> E/DatabaseUtils(  166): Writing exception to parcel
> E/DatabaseUtils(  166): java.lang.IllegalArgumentException: Invalid
> column _data
> E/DatabaseUtils(  166):         at
> android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBui-lder.java:
> 523)
> E/DatabaseUtils(  166):         at
> android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.ja-va:

> 370)
> E/DatabaseUtils(  166):         at
> android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:
> 323)
> E/DatabaseUtils(  166):         at
> com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.ja-va:
> 4737)
> E/DatabaseUtils(  166):         at
> com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.ja-va:

> 4722)
> E/DatabaseUtils(  166):         at android.content.ContentProvider
> $Transport.bulkQuery(ContentProvider.java:174)
> E/DatabaseUtils(  166):         at
> android.content.ContentProviderNative.onTransact(ContentProviderNative.java-:

Pedro Guardiola

unread,
Jun 12, 2012, 6:58:25 AM6/12/12
to phon...@googlegroups.com
Hi Simon

It's true photo is displayed correctly but the problem is when contact photo cames from some social account (Facebook, ie) Is there any way to show those contacts photos?

Thanks in advance
Message has been deleted

Simon MacDonald

unread,
Sep 26, 2012, 9:29:46 AM9/26/12
to phon...@googlegroups.com
Yes, there is an open bug on this issue:

On Wed, Sep 26, 2012 at 7:33 AM, Joe Mclo <joem...@gmail.com> wrote:
I think I have the same issue as you.

Android will return a URI to the image, but a webkit exception is called when I try to display it. 
Looking more into the contacts, I found that when there is no image, or an image has come from facebook this will happen, other images will display correctly. 

This is from the LogCat
09-26 12:32:10.198: E/webkit(22710): Exception: content://com.android.contacts/contacts/618/photo

Did you have any success in sorting this problem out, or at least catching the exception?

Joe

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
 
 

Dmitrii Ponomarev

unread,
Aug 25, 2013, 10:18:51 AM8/25/13
to phon...@googlegroups.com
Check out my workaround, it works for me.

var returnValidPhoto=function(url,callback){
    var img = new Image();
    img.onload = function() {
    //Image is ok
        callback(url);
    };
    img.onerror = function(err) {
        //Returning a default image for users without photo 
        callback("image_for_no_avatar.png");
    }
    img.src = url;
};

//Example usage
returnValidphoto(contact.photos[0].value, function(answer) {
    contact.photos[0].value=answer;
}

On Thursday, December 6, 2012 9:20:53 PM UTC+4, Fred Lair wrote:
Hi Joe,

I've the same problem but with a google contact photo. Have you found a solution for this ?

Thank for your answer

Fred




Le mercredi 26 septembre 2012 13:33:51 UTC+2, Joe Mclo a écrit :
I think I have the same issue as you.

Android will return a URI to the image, but a webkit exception is called when I try to display it. 
Looking more into the contacts, I found that when there is no image, or an image has come from facebook this will happen, other images will display correctly. 

This is from the LogCat
09-26 12:32:10.198: E/webkit(22710): Exception: content://com.android.contacts/contacts/618/photo

Did you have any success in sorting this problem out, or at least catching the exception?

Joe


On Tuesday, 12 June 2012 11:58:25 UTC+1, Pedro Guardiola wrote:
Reply all
Reply to author
Forward
0 new messages