locked
Convert java hashmap to WinRT platform in c# RRS feed

  • Question

  • I met some problem in convert java hasmap data to WinRT platform in C#. 

    The process that I want to do is 

    1. Downloads some files from the server, and the files are java hashmap data files. 

    2. Convert the downloaded java hashmap data to some data type can use in WinRT platform. (json, xml, etc...), the development language is C# and the platform is WinRT(Windows 8).

    3. Insert the converted data to SQLite data file. 

    4. Add some transactions to the SQLite data file. 

    5. Convert SQLite data to java hashmap data type and rewrite it to the hashmap data files.

    6. Send the rewrited files to server.  

    I know IKVM can convert java hashmap data to c#, but they do not support WinRT platform. 

    Do WinRT platform support some libraries and SDKs to convert java hashmap data to some data type can use in C#?

    Thanks~

    Tuesday, October 29, 2013 1:28 PM

Answers

  • I don't believe Java hashmaps are designed for interop, only to use from Java. Your best bet is probably to convert them to an interop format like JSON on the server.

    There aren't any in-box converters for Java types.

    --Rob

    Tuesday, October 29, 2013 2:54 PM
    Moderator

All replies

  • >Do WinRT platform support some libraries and SDKs to convert java hashmap data to some data type can use in C#?

    No.  You may be able to extract enough of IKVM into a portable library using ikvmc.  You may need to decompile and recompile it as a portable library.

    Or you can look at the source and produce a C# version of the hashmap data file reading functionality.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Tuesday, October 29, 2013 2:50 PM
  • I don't believe Java hashmaps are designed for interop, only to use from Java. Your best bet is probably to convert them to an interop format like JSON on the server.

    There aren't any in-box converters for Java types.

    --Rob

    Tuesday, October 29, 2013 2:54 PM
    Moderator