• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reg: XMLEncoder and XMLDecoder not supported in Android

 
ToMm Cruiz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In Java "XMLEncoder" functionality is to write entire data into a object format.

In Java "XMLDecoder" functionality it to read data in a object format.


But, In Android XMLEncoder and XMLDecoder functionality not supported. Is there any alternative for that XMLEncoder and XMLDecoder classes in Android.

Here I used XMLSerializer and XMLPullParser functions for that construction XML and parsing XML. But these Interfaces supports for to write/read the data i.e hard-coded only. I want to write/read data in a Object format.


Please help me. I need Urgent.



Thanks,
Tom.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe the Apache XMLBeans or Apache Commons Betwixt libraries can be made to work on Android.
 
ToMm Cruiz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou for your reply. I will check.
 
ToMm Cruiz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Thank you for your reply.

Sorry i don't want to that format. I am sending one java file. am receiving that file as a string and will split into objects wise like XMLDecoder.readObject() format. what is the way in Android?

In android i used XMLPullParser to split that String. But here i used hard-coded. I want generic to split object wise.


want to the following format...

/**************************************

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0_08" class="java.beans.XMLDecoder">
<object class="java.util.ArrayList">
<void method="add">
<object class="poker.lobbyinfo.LobbyTableBean">
<void property="lobbyBean">
<object class="poker.lobbyinfo.LobbyBean">
<void property="avgPot">
<string>0.22</string>
</void>
<void property="gameID">
<string>1</string>
</void>
<void property="hour">
<string>48</string>
</void>
<void property="plrFlop">
<string>44%</string>
</void>
<void property="serverIP">
<string>10.10.13.113</string>
</void>
<void property="serverPort">
<string>5467</string>
</void>
<void property="tableID">
<string>1</string>
</void>
</object>
</void>
<void property="plrs">
<string>4/10</string>
</void>
<void property="stakes">
<string>2.0/4.0</string>
</void>
<void property="tableName">
<string>Holly</string>
</void>
<void property="type">
<string>1</string>
</void>
<void property="wait">
<string>5</string>
</void>
</object>
</void>
<void method="add">
<object class="poker.lobbyinfo.LobbyTableBean">
<void property="lobbyBean">
<object class="poker.lobbyinfo.LobbyBean">
<void property="avgPot">
<string>0.30</string>
</void>
<void property="gameID">
<string>2</string>
</void>
<void property="hour">
<string>52</string>
</void>
<void property="plrFlop">
<string>50%</string>
</void>
<void property="serverIP">
<string>10.10.13.113</string>
</void>
<void property="serverPort">
<string>5467</string>
</void>
<void property="tableID">
<string>2</string>
</void>
</object>
</void>
<void property="plrs">
<string>3/10</string>
</void>
<void property="stakes">
<string>4.0/8.0</string>
</void>
<void property="tableName">
<string>Bolly</string>
</void>
<void property="type">
<string>2</string>
</void>
<void property="wait">
<string>5</string>
</void>
</object>
</void>
</object>
</java>



***************************************/







please help me.

Tom.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check your private messages if you haven't done so yet, and act accordingly.
 
ToMm Cruiz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


Can anyone help me regarding this XMLEncoder and XMLDecoder supports in android.


I am still struggling.


Thanks,
Tom.
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Please check your private messages if you haven't done so yet, and act accordingly.
 
Mato Jure
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem. Did anyone find a solution?
 
Anshul Koka
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mato Jure wrote:I have the same problem. Did anyone find a solution?


If anybody is still looking for a solution to this problem, here's how to do this via reflection using a simple DOM parser (in my case I'm using electric xml):

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic