1. Home
  2. Docs
  3. AndroidBridge
  4. Things to remember
  5. Identifier Mapping

Identifier Mapping

  1. Modifier Letter Apostrophe (U+02BC) is used to specify/separate inner/nested types. This is used both for nested class types and nested interface types. This convention is important because C# doesn’t support nested interfaces but to keep consistency across the board it’s also used in nested class types. Hence, the use of this in LinearLayout’LayoutParams and AlertDialog’Builder above. Also, note this is note the conventional apostrophe letter rather the Modifier Letter Apostrophe (U+02BC).
  2. All the java primitive types are mapped directly to C# primitive types like int, float, double, boolean (bool) etc. That’s where method parameters require java.lang.CharSequence or any other subclasses of java.lang.String then C# string simply can’t be passed. Instead, a new StringBuilder or StringBuffer object is created.
  3. Java Fields are mapped to C# properties. Interface fields which are static in Java are non-static in C# but perform the same nonetheless. This is because non-static interface fields are not supported in C#.
  4. If any Java methods or fields or type names start with get_ , set_ or __ they are mapped to get’ e.g. get_Name will be mapped to get’Name or __specialField will be mapped to _’specialField. Here apostrophe modifier letter (U+02BC) is used to represent missing character(s).
Was this article helpful to you? Yes No

How can we help?