[mono-android] Problem with configuration manager
Hi, I want to develop an Android application with Monodevelop, and i want to access to a app.config file. So, I put the System.configuration.dll in the references and add using System.Configuration. When I compile the program, it works, but when the application launch, it doesn't work... this is the code : base.OnCreate (bundle); var tv = new TextView(this); tv.Text = ConfigurationManager.AppSettings["utilisateur"]; SetContentView(tv); It is simple, just a test to know if the configuration manager works, and I have this message in the console : I/MonoDroid( 279): UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Configuration.ConfigurationErrorsException' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. I/MonoDroid( 279): at Test.Activity1.OnCreate (Android.OS.Bundle) <0x00047> I/MonoDroid( 279): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005f> I/MonoDroid( 279): at (wrapper dynamic-method) object.ff8541a0-fab1-4158-a6ca-70aef38b25a7 (intptr,intptr,intptr) <0x00033> E/mono( 279): E/mono( 279): Unhandled Exception: System.TypeLoadException: Could not load type 'System.Configuration.ConfigurationErrorsException' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. E/mono( 279): at Test.Activity1.OnCreate (Android.OS.Bundle bundle) [0x0] in :0 E/mono( 279): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x0] in :0 E/mono( 279): at (wrapper dynamic-method) object:ff8541a0-fab1-4158-a6ca-70aef38b25a7 (intptr,intptr,intptr) I have Monodevelop 2.6 beta 2 on Windows 7. I don't know what it means...somebody can help me please ? Thanks PS : I'am French and i don't speak English very well. Sorry. PS2 : I already post this message on MonoDevelop Forum but I don't see this forum that is maybe better for my problem. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-with-configuration-manager-tp4418578p4418578.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] Problem with configuration manager
What is the android SharedPreferences system ? Me, I have a Framework which access to the configuration file because, in this file (which I created), there is an url of a webservice. So, i have to find a way to access to the information in the configuration file. I don't know if you understand like it. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-with-configuration-manager-tp4418578p441.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] Problem with configuration manager
ok thanks ! I find another solution to access to my configuration file, I create my own configuration manager. thanks a lot -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-with-configuration-manager-tp4418578p4421261.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
[mono-android] Problem to access assets files
Hi, I just want to access to a .txt file in the assets folder. this is my code : protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); var tv = new TextView(this); string s = ""; try{ Stream input = Assets.Open("test.txt"); StreamReader st = new StreamReader(input); string ligne = st.ReadLine(); while (ligne != null) { s +=ligne+"\n"; ligne = st.ReadLine(); } st.Close(); } catch(Exception e){ s += "Message d'erreur :\n"+e.Message; } tv.Text = "TEXTE : "+s; SetContentView(tv); } And when I test my application, it displays "Exception of type 'Java.IO.FileNotfoundException' was thrown. So, they don't find my file whereas I put the "test.txt" in the Assets folder. Why ? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-to-access-assets-files-tp4422037p4422037.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
[mono-android] Know if a file already exists in the internal storage ?
Hi ! Is it possible to know if a file exists on the internal storage ? is there a method to do this ? Or, maybe, Can I have the path of the file and use the method File.Exists(string path) ? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Know-if-a-file-already-exists-in-the-internal-storage-tp4428476p4428476.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] Know if a file already exists in the internal storage ?
Yes, I already try it...but i don't know the path of the file. I put the name of the file but it doesn't work. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Know-if-a-file-already-exists-in-the-internal-storage-tp4428476p4431270.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] Know if a file already exists in the internal storage ?
Isn't it the path for an external storage ? Here, I want to know the path for the files in the internal storage. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Know-if-a-file-already-exists-in-the-internal-storage-tp4428476p4431703.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] SPAM-LOW: Re: Know if a file already exists in the internal storage ?
Yes, thanks ! it works with "Environment.SpecialFolder.Personal" ! There are all files installed by the application. And I can have the path. It is perfect. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Know-if-a-file-already-exists-in-the-internal-storage-tp4428476p4432296.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
[mono-android] NameResolutionFailure exception
Hi! I want to do a web request but I have an error message due to an exception catched. It says : "NameResolutionFailure". So, I think the program can't connect to internet to get the informartion. Is there something to change or another think ? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/NameResolutionFailure-exception-tp4439588p4439588.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] NameResolutionFailure exception
Me too, I want to use webservice, but it worked in visual studio, now, I adapt my code to work with Android, but maybe I have to configure something to access to internet. I put the manifest called "INTERNET", but it doesn't work. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/NameResolutionFailure-exception-tp4439588p4441176.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] NameResolutionFailure exception
I try to explain clearlier... I want to access to a web service, I have a library called "Tools" and I add my web reference called "WSTest". Now, I want to call a method in my web service. So, I do this : Tools.WSTest.Service s = new Tools.WSTest.Service(); s.version() //Return a string with the name of the version And there is the NameResolutionFailure exception...Is it normal ? what is wrong ? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/NameResolutionFailure-exception-tp4439588p646.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] NameResolutionFailure exception
I try some test and I discover that the method in the web service use Invoke and cause the NameResolutionFailure. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/NameResolutionFailure-exception-tp4439588p689.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] NameResolutionFailure exception
Me, in fact, i do an internship in a company which use a web service. I must use the Framework already exist to make a Android application. So, I already make a console program in C# to access to the web services, and it works. So, now, I adapt my program to Android and I add the web references wiith url like : http://***//***.asmx Before, I never use web service and, so, I discover it today. So, I think the web service is on another machine and it is not possible to have its IP. Or, I don't really understand how does web service work... -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/NameResolutionFailure-exception-tp4439588p4445071.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] NameResolutionFailure exception
Anyone has a solution ? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/NameResolutionFailure-exception-tp4439588p4458772.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
[mono-android] How can I access to my local network with the emulator
Hello ! I want to access to a webservice hosted on the local network, but the emulator can't access to the local network and I think it is the reason why I have an web exception "NameResolutionFailure" when I call a service. So, is there a way to access to local network ? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/How-can-I-access-to-my-local-network-with-the-emulator-tp4461014p4461014.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
[mono-android] Problem with version of "System.XML"
Hi I have a Framework in C# which i use in an Android application. I have to rewrite some classes to adapt with the Android Environment. But, I have a class which use the version 3.5 of "System.XML", and monodevelop have only the 2.0.5.0. When I compile, I have an error : In French : "Le type 'System.XML.XMLReader' est défini dans un assembly qui n'est pas référencé. Vous devez ajouter une référence à l'assembly 'System.XML, Version = 3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable = Yes'" In English (I traduce...) : "The type 'System.XML.XMLReader' is define in an assembly which doesn't referency. You have to add a reference to the assembly 'System.XML, Version = 3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable = Yes'" What can I do ? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-with-version-of-System-XML-tp4468850p4468850.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
[mono-android] A new activity with parameters of old activity
Hello ! I want to know how to pass to another activity with variables's values of the first activity. Thanks -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/A-new-activity-with-parameters-of-old-activity-tp4514263p4514263.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] A new activity with parameters of old activity
thanks. But, I want to adapt to use with text field and button. So I want to keep value of the texts field and pass to another activity when I click on the button OK. I try it but it doesn't work : public class Activity0 : Activity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.FiltreCreation); //On récupere le bouton souhaité et on lui affecte le Listener Button bouton = (Button) FindViewById(Resource.Id.ok); bouton.Click += new EventHandler(bouton_Click); } private void bouton_Click(object sender, ItemEventArgs e) { var intent = new Intent(); intent.SetClass(this, typeof(Activity1)); intent.PutExtra("attType", FindViewById(Resource.Id.attType).ToString(); intent.PutExtra("attValue", FindViewById(Resource.Id.attVal).ToString()); StartActivity(intent); } } -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/A-new-activity-with-parameters-of-old-activity-tp4514263p4514384.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] A new activity with parameters of old activity
Thanks a lot, but it doesn't resolve the problem, there is an error here : bouton.Click += new EventHandler(bouton_Click); The error is : (in french...sorry) Aucune surcharge pour 'bouton_Click' ne correspond au délégué 'System.EventHandler' I try to translate : Any overload for 'bouton_Click' match to delegate 'System.EventHandler' I hope it s clear. Thanks -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/A-new-activity-with-parameters-of-old-activity-tp4514263p4514450.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] A new activity with parameters of old activity
Thank you very much, it works !!! -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/A-new-activity-with-parameters-of-old-activity-tp4514263p4517805.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
[mono-android] Make loading screen ?
Hello ! I want to make a loading screen, so I follow a java tutorial but I don't know how can I use thread with Monodroid. This is the java code : private void traitementDesDonnees() { new System.Threading.Thread(new Runnable(){ public override void run(){ // Boucle de 1 a 10 for (int i = 0; i < 10; i++) { try { // Attends 500 millisecondes System.Threading.Thread.Sleep(500); } catch (Exception e) {} } } } } Apparently, it doesn't recognize Runnable()... -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Make-loading-screen-tp4520263p4520263.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid