Bug 9042 - DatabaseUtils.getTypeOfObject is missing from the class library
Summary: DatabaseUtils.getTypeOfObject is missing from the class library
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.4.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-12-19 08:54 UTC by Jeremy Kolb
Modified: 2012-12-19 10:09 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jeremy Kolb 2012-12-19 08:54:29 UTC
I can't find the DatabaseUtils.getTypeOfObject method in Xamarin.  It's definitely public in the android source.
Comment 1 Jonathan Pryor 2012-12-19 10:09:07 UTC
Just because it's a public method in the Android source doesn't mean it's a public method that can be used. The method has an @hide JavaDoc comment:


@hide does two things:

1. @hide prevents the method from being in the public documentation; getTypeOfObject() is not listed in the Android documentation:


2. @hide prevents the method from being in the public android.jar that Java code compiles against:

> $ javap -classpath /opt/android/sdk/platforms/android-17/android.jar \
>    android.database.DatabaseUtils | grep getTypeOfObj
> $

DatabaseUtils.getTypeOfObject() isn't in the public android.jar file; Java code can't use this method either.

The only way to use this method is through reflection, with all the issues that implies (it may disappear in a future version, etc.).