I am creating a Xamarin Android binding library for an existing JAR that contains a single class and following the Xamarin binding library documentation, I am able to successfully rename the namespace using:
<attr path="/api/package[@name='com.company.blah']" name="managedName">Company.Blah</attr>
I also confirmed the namespace is changed in the generated class in the 'obj/Debug' folder:
namespace Company.Blah {
// Metadata.xml XPath class reference: path="/api/package[@name='com.company.blah']/class[@name='NativeClass']"
[global::Android.Runtime.Register ("com/sprylab/android/widget/TextureVideoView", DoNotGenerateAcw=true)]
public partial class NativeClass
{
...
}
}
I face two problems:
- I am unable to reference
NativeClass
from a sample Android project. It's like to doesn't see the namespace at all. The binding project built successfully without errors. If I remove the package namespace rename setting, it also builds successfully and I am then able to reference it in my sample project but it requires that I fully qualify the class name anywhere it is used:
private com.company.blah.NativeClass nativeClass;
I'm hoping if I can fix #1, then #2 will not show up again. If so, I'm also curious how you prevent fully qualified class names from showing up?