public static String toDalvikName(String canonicalName){
  final boolean isArray=(canonicalName.charAt(0) == '[');
  if (isArray) {
    return canonicalName.replace('.','/');
  }
 else {
    if (canonicalName.equals("char"))     return "C";
 else     if (canonicalName.equals("int"))     return "I";
 else     if (canonicalName.equals("byte"))     return "B";
 else     if (canonicalName.equals("boolean"))     return "Z";
 else     if (canonicalName.equals("float"))     return "F";
 else     if (canonicalName.equals("double"))     return "D";
 else     if (canonicalName.equals("short"))     return "S";
 else     if (canonicalName.equals("long"))     return "J";
 else     if (canonicalName.equals("void"))     return "V";
 else     return "L" + canonicalName.replace('.','/') + ";";
  }
}

public static String toDalvikName ( String canonicalName ) { final boolean isArray = ( canonicalName . charAt ( 0 ) == '[' ) ; if ( isArray ) { return canonicalName . replace ( '.' , '/' ) ; } else { if ( canonicalName . equals ( "char" ) ) return "C" ; else if ( canonicalName . equals ( "int" ) ) return "I" ; else if ( canonicalName . equals ( "byte" ) ) return "B" ; else if ( canonicalName . equals ( "boolean" ) ) return "Z" ; else if ( canonicalName . equals ( "float" ) ) return "F" ; else if ( canonicalName . equals ( "double" ) ) return "D" ; else if ( canonicalName . equals ( "short" ) ) return "S" ; else if ( canonicalName . equals ( "long" ) ) return "J" ; else if ( canonicalName . equals ( "void" ) ) return "V" ; else return "L" + canonicalName . replace ( '.' , '/' ) + ";" ; } }
convert a canonical java class name to dalvik flavor .
