simple-framework

Android: error including/repacking dependencies which reference javax core classes

梦想的初衷 提交于 2019-11-29 03:41:29
I'm working on an Android app using Maven as the build tool. I managed to set evertyhing up correctly (maven dependencies are exported to the apk etc.), however I have one remaining problem which is driving me crazy. I want to include a dependency on simpleframework's xml parser defined as follows in my POM file: <dependency> <groupId>org.simpleframework</groupId> <artifactId>simple-xml</artifactId> <version>2.5.3</version> </dependency> When I issue mvn install on the project, I get the following error (truncated): trouble processing "javax/xml/namespace/NameSpaceContext.class" ... I know the

How to solve the XML parsing performance issue on Android

我只是一个虾纸丫 提交于 2019-11-28 22:11:14
问题 I have to read a XML file with about ~4000 lines on Android. First I tried the SimpleXML library because it's the easiest and it took about 2 minutes on my HTC Desire. So I thought maybe SimpleXML is so slow because of reflection and all the other magic that this library uses. I rewrote my parser and used the built-in DOM parsing method with some special attention for performance. That helped a bit but it still took about 60 seconds which is still totally unacceptable. After a bit of research

Proguard obfuscation is breaking simplexml

谁说胖子不能爱 提交于 2019-11-28 21:18:40
I am using simplexml in my android project, and everything works fine until I obfuscate the code. Then, errors start pouring in. Part of the XML is as follows: <categories success="true"> <category id="102" caption="Magazin" parent="0" num_mags="114" > <category id="15" caption="Kunst" parent="102" num_mags="13" > <category id="17" caption="Design" parent="15" num_mags="10" ></category> <category id="18" caption="Haute+Couture" parent="15" num_mags="2" > ... I have two classes: CategoryItemList: @Root(name = "categories") public class CategoryItemList { private final List<CategoryItem>

Parsing XML feed die with “Element is already used”

≡放荡痞女 提交于 2019-11-28 10:53:01
I'm trying to parse an XML feed using SimpleXML in Android: http://backend.deviantart.com/rss.xml?type=deviation&q=by%3Aspyed+sort%3Atime+meta%3Aall Sample here: <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"> <channel> <title>DeviantArt: spyed's</title> <link>http://www.deviantart.com/?order=5&q=by%3Aspyed</link> <description>DeviantArt RSS for sort:time by:spyed</description> <language>en-us</language> <copyright

Is it possible to apply a single annotation to multiple use-site targets in Kotlin?

99封情书 提交于 2019-11-28 07:31:19
问题 According to the documentation: https://kotlinlang.org/docs/reference/annotations.html You can apply multiple annotations to a single site-use target, but is there a way to apply the same annotation to multiple site-use targets? My use-case is decorating classes with annotations for SimpleXML. To use an immutable data class , you have to annotate both the field and the constructor parameter: data class Data( @field:Element(name = "ID") @param:Element(name = "ID") val id: Int, @param:Element

Parse date with SimpleFramework

旧街凉风 提交于 2019-11-27 20:40:58
I receive an XML response with an attribute which contains following value: Wed Sep 05 10:56:13 CEST 2012 I have defined in my model class a field with annotation: @Attribute(name = "regDate") private Date registerDate; However it throws an exception: java.text.ParseException: Unparseable date: "Wed Sep 05 10:56:13 CEST 2012" (at offset 0) Is it possible to define date format in SimpleFramework 's annotations ? What format should cover this date string ? SimpleXML only supports some DateFormat 's: yyyy-MM-dd HH:mm:ss.S z yyyy-MM-dd HH:mm:ss z yyyy-MM-dd z yyyy-MM-dd (For the meaning of each

Unable to create call adapter for class example.Simple

こ雲淡風輕ζ 提交于 2019-11-27 19:13:14
I am using retrofit 2.0.0-beta1 with SimpleXml. I want the retrieve a Simple (XML) resource from a REST service. Marshalling/Unmarshalling the Simple object with SimpleXML works fine. When using this code (converted form pre 2.0.0 code): final Retrofit rest = new Retrofit.Builder() .addConverterFactory(SimpleXmlConverterFactory.create()) .baseUrl(endpoint) .build(); SimpleService service = rest.create(SimpleService.class); LOG.info(service.getSimple("572642")); Service: public interface SimpleService { @GET("/simple/{id}") Simple getSimple(@Path("id") String id); } I get this exception:

Serialization third-party classes with Simple XML (org.simpleframework.xml)

南笙酒味 提交于 2019-11-27 13:57:20
问题 I have decided to use Simple XML serialization and was stucked with basic problem. I am trying to serialize java.util.UUID class instance as final field in this small class: @Root public class Identity { @Attribute private final UUID id; public Identity(@Attribute UUID id) { this.id = id; } } Tutorial shows how to serialize third-party objects by registering converters like this: Registry registry = new Registry(); registry.bind(UUID.class, UUIDConverter.class); Strategy strategy = new

Proguard obfuscation is breaking simplexml

烂漫一生 提交于 2019-11-27 13:42:25
问题 I am using simplexml in my android project, and everything works fine until I obfuscate the code. Then, errors start pouring in. Part of the XML is as follows: <categories success="true"> <category id="102" caption="Magazin" parent="0" num_mags="114" > <category id="15" caption="Kunst" parent="102" num_mags="13" > <category id="17" caption="Design" parent="15" num_mags="10" ></category> <category id="18" caption="Haute+Couture" parent="15" num_mags="2" > ... I have two classes:

Retrofit2 + SimpleXML in Kotlin: MethodException: Annotation must mark a set or get method

半腔热情 提交于 2019-11-27 11:49:16
问题 I want to fetch XML data from API and map it to Kotlin model object by using Retrofit2 + SimpleXML in Kotlin. However, I got such as the following error message from SimpleXML. org.simpleframework.xml.core.MethodException: Annotation @org.simpleframework.xml.Element(data=false, name=, required=true, type=void) must mark a set or get method This is fetched XML data <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response> <result code="0">Success</result> <token>XXXXXXXXXXXXXXXXXXXX<