Re: [mono-android] Being driven insane....

2012-02-16 Thread Jonathan Pryor
On Feb 15, 2012, at 6:33 PM, Andrew Sinclair wrote: > It seems as though during the re-start some of the assemblies that are > usually "hanging around" (technical term) aren't there. So code like: > > string typeName = "XmlElement"; > Type type = GetType(typeName); > XmlSerializer s = new XmlSeri

Re: [mono-android] Being driven insane....

2012-02-15 Thread Andrew Sinclair
odroid-boun...@lists.ximian.com] On Behalf Of Andrew Sinclair Sent: 28 November 2011 15:36 To: 'Discussions related to Mono for Android' Subject: Re: [mono-android] Being driven insane Paul, Don't know if this helps... When my app initialises it serialises/deserialises some simpl

Re: [mono-android] Being driven insane....

2011-11-29 Thread José M . Rivera
I got around this problem by adding a constructor with no parameters to my class. Now it's working perfect. This is working for me: [Serializable] public class MyClass { #region "Global Variables" private string mGender; private bool mSmoker; private D

Re: [mono-android] Being driven insane....

2011-11-29 Thread Andrew Sinclair
re seeing, but it's definitely a way in which blatantly-obviously-this-serialisation-should-work fails to work. Cheers, Andy -Original Message- From: monodroid-boun...@lists.ximian.com [mailto:monodroid-boun...@lists.ximian.com] On Behalf Of nodoid Sent: 28 November 2011 14:01 To:

Re: [mono-android] Being driven insane....

2011-11-28 Thread nodoid
Hi, Hmm, something is still not right. Are there any types which cannot be serialized for Android? Currently, I have this [Serializable()] public class common { public int p, a, w, pa; public double bodyWeight, tempBody, tempSurround; public double[,] correcti

Re: [mono-android] Being driven insane....

2011-11-27 Thread Greg Shackles
You can access the intent from the next activity by using the Intent property, so you can call Intent.GetStringExtra() to pull the string out. http://docs.mono-android.net/?link=M:Android.Content.Intent.GetStringExtra On Sun, Nov 27, 2011 at 1:55 PM, Paul F. Johnson < p...@all-the-johnsons.co.uk>

Re: [mono-android] Being driven insane....

2011-11-27 Thread Paul F. Johnson
Hi, > Not followed the rest of the thread, but this is what I often do for > Serializable objects to be able to use them as strings: > > public class Foo > { > public override string ToString() > { > return Serialize(this); > } > > public static Foo Deserialize(string se

Re: [mono-android] Being driven insane....

2011-11-27 Thread Dean Cleaver
m] On Behalf Of Paul Johnson Sent: Wednesday, November 23, 2011 9:21 AM To: Discussions related to Mono for Android Subject: [mono-android] Being driven insane Hi, This is driving me mad I have a class called foo with [Serialize] above it to serialize it. In the main tab constructor, I

Re: [mono-android] Being driven insane....

2011-11-27 Thread Paul F. Johnson
Hi, > >>StringWriter o = new StringWriter(); > >>x.Serialize (o, p); > > > > Then just pass using PutExtra(string, string)? > > Use o.ToString(), yeah: > > b.PutExtra ("my.name", o.ToString ()); Sorry for the delay - work has been getting on top of things Android related! This i

Re: [mono-android] Being driven insane....

2011-11-26 Thread Jack Bond
Similiar to a previous poster, but this is what I use to serial objects to store in Intents... public class SimpleSerializer { public static T DeserializeObject(string source) { XmlSerializer serializer = new XmlSerializer(typeof(T)); StringReader sr =

Re: [mono-android] Being driven insane....

2011-11-23 Thread Jonathan Pryor
On Nov 23, 2011, at 1:04 PM, Paul F. Johnson wrote: >> StringWriter o = new StringWriter(); >> x.Serialize (o, p); > > Then just pass using PutExtra(string, string)? Use o.ToString(), yeah: b.PutExtra ("my.name", o.ToString ()); - Jon

Re: [mono-android] Being driven insane....

2011-11-23 Thread Paul F. Johnson
Hi, > On Nov 23, 2011, at 11:16 AM, nodoid wrote: > > foo p = new p(); > > > > System.Xml.Serialization.XmlSerializer x = new > > System.Xml.Serialization.XmlSerializer(p.GetType()); > > StringWriter o = new StringWriter(); > x.Serialize (o, p); Then just pass using PutExtra(string,

Re: [mono-android] Being driven insane....

2011-11-23 Thread Jonathan Pryor
On Nov 23, 2011, at 11:16 AM, nodoid wrote: > foo p = new p(); > > System.Xml.Serialization.XmlSerializer x = new > System.Xml.Serialization.XmlSerializer(p.GetType()); StringWriter o = new StringWriter(); x.Serialize (o, p); // o.ToString() contains the written string...

Re: [mono-android] Being driven insane....

2011-11-23 Thread Mike Child
I found this code through some searching. I am using json in my code but using xml should be relatively simple change in the code. public static byte[] ToJson(T instance) --> it's converted to byte[] because i'm using it in httpwebrequest, you could just return the string. {   DataContrac

Re: [mono-android] Being driven insane....

2011-11-23 Thread Jonathan Pryor
On Nov 23, 2011, at 11:03 AM, nodoid wrote: > This is seriously annoying me now. I've used XML before now in another app > which is easy enough to do, but does seem overkill. Looking on the docs for > the ContentProvider, it seems to be best suited to apps sharing data rather > than sharing within

Re: [mono-android] Being driven insane....

2011-11-23 Thread nodoid
Hi, Re XML serialization... Typically, I would use (say) foo p = new p(); System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(p.GetType()); x.Serialize(Console.Out, p); Obviously, I can't use Console.Out, so where do I need to point it to (for example a tempor

Re: [mono-android] Being driven insane....

2011-11-23 Thread nodoid
Hi, Jonathan Pryor-2 wrote > >> In the main tab constructor, I have >> >> Bundle b; >> b.PutSerializable("data", foo); >> intent.PutExtras(b); > > This is not what you think it is. Java.IO.ISerialzable != > System.Runtime.ISerializable. They have _completely_ different semantics, > not least i

Re: [mono-android] Being driven insane....

2011-11-23 Thread Jonathan Pryor
On Nov 23, 2011, at 10:20 AM, Paul Johnson wrote: > I have a class called foo with [Serialize] above it to serialize it. > > In the main tab constructor, I have > > Bundle b; > b.PutSerializable("data", foo); > intent.PutExtras(b); This is not what you think it is. Java.IO.ISerialzable != Syste

[mono-android] Being driven insane....

2011-11-23 Thread Paul Johnson
Hi, This is driving me mad I have a class called foo with [Serialize] above it to serialize it. In the main tab constructor, I have Bundle b; b.PutSerializable("data", foo); intent.PutExtras(b); Should be ok, except for PutSerializable it needs to be Java.IO.ISerializable Putting (Java.IO