Re: [mono-android] Resources from a Library Project

2011-08-03 Thread Anthony . Coqui
I too would like this ability in the future :)

-Original Message-
From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Ritesh Sahu
Sent: Wednesday, August 03, 2011 12:30 AM
To: Jonathan Pobst; Discussions related to Mono for Android
Subject: Re: [mono-android] Resources from a Library Project

Thanks Jonathan.
I've seen that even if I don't try to use resources we can't put anything UI
related in library projects.
For example:
I have a Library project (lets call it LibProj) I have an Activity
(Activity1) in LibProj which loads a layout using 

SetContentView(Resource.Layout.Main); 

The Layout Main.axml is within that library project.

Now I have a Mono Android Application Project (AppProj) which references
LibProj and then creates an intent to start a Activity1:

Intent intent = new Intent(this, typeof(LibProj.Activity1));
StartActivity(intent);


What happens to this call completely depends on what const Id was generated
for Resource.Layout.Main and if the AppProj has something in the Resource
file with a similar Id. I've seen it loading a completely different layout
(a layout defined in AppProj).


With this behavior, it's almost impossible to use Library projects except
for business logic (I guess that's why the Resource folder hierarchy is not
generated in Library projects). Anything UI related (Activity, View, Layout
etc) have to be put in the Application Project.

I certainly hope this is something that gets fixed soonish otherwise it'll
make it very difficult for us to develop applications of any decent
complexity using Mono for Android if we have to put all UI stuff in one
project.

- Ritesh

-Original Message-
From: Jonathan Pobst [mailto:mon...@jpobst.com]
Sent: Wednesday, 3 August 2011 1:37 PM
To: Discussions related to Mono for Android
Cc: Ritesh Sahu
Subject: Re: [mono-android] Resources from a Library Project

There is currently no support for sharing resources across projects.

You will need to copy (or link) the resources into each project.

Hopefully there will eventually be a better solution for this.

Jonathan


On 8/2/2011 7:09 PM, riteshsahu wrote:
> I've looked a bit more into this and by the looks of it the R.java
created
> only contains the ID from the Application and doesn't contain anything
from
> the Libraries. The values assigned to these constants are overlapped
between
> different projects (// aapt resource value: 0x7f02).
>
> Using these results in the app trying to load the named resource from
the
> application rather than the library.
>
> Again, what is the recommended way of sharing resources across
projects?
>
> --
> View this message in context:
http://mono-for-android.1047100.n5.nabble.com/Resources-from-a-Library-P
roject-tp4657828p4660735.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
>
>



Click
https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==
eHGjiy6gkGpcMqwkE3vFhNIomf0VqRQWLTieLvRJKIvyA==  to report this email as
spam.


This e-mail is for the use of the intended recipient(s) only. If you have
received this e-mail in error, please notify the sender immediately and then
delete it. If you are not the intended recipient, you must not use, disclose
or distribute this e-mail without the author's prior permission. We have
taken precautions to minimize the risk of transmitting software viruses, but
we advise you to carry out your own virus checks on any attachment to this
message. We cannot accept liability for any loss or damage caused by
software viruses. Any views and/or opinions expressed in this e-mail are of
the author only and do not represent the views of Epicor Software
Corporation or any other company within its group.


This message has been scanned for malware by Websense. www.websense.com
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Assertion at sgen-internal.c:441

2011-08-03 Thread NCSoftware
Jon,

If you need any info or want to remote into my system to debug/view this
issue please contact me and I'll assist you in any way I can.  This is a
critical error among some other stability issues that are crippling my app
using Mono for Android 1.0.1.

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Assertion-at-sgen-internal-c-441-tp4370119p4661971.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] How to have monodroid project in same soultion with windows 7 phone?

2011-08-03 Thread Anthony . Coqui
Hi Chobo2,

I may be wrong but it's worth a try :)

Right click on the Android project and go to properties.
Select [Mono Android Options]
Ensure that "Use Shared Runtime" is checked.

I currently have a Mono for Android project in the same solution as a WP7
and Silverlight app, so it is definitely possible. :)

Take care,
Ant


-Original Message-
From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of chobo2
Sent: Tuesday, August 02, 2011 3:28 PM
To: monodroid@lists.ximian.com
Subject: [mono-android] How to have monodroid project in same soultion with
windows 7 phone?

Hi

I have a VS 2010 solution that has a windows 7 phone project in it.

I added a default monoandroid project and when I try to deploy it(the
emulator dialog does appear)

I get this error

" (SignAndroidPackage target) (1) ->
(_CompileAndroidPackage target) ->
  monodroid : error 1: Evaluation version requires targeting the shared
runtime. [C:\A\B\AndroidApplication1.csproj]

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.87


If I unload the windows 7 phone project I lose the ability to deploy it.



--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/How-to-have-monodroid-project-
in-same-soultion-with-windows-7-phone-tp4660074p4660074.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

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] Tried using breakpoint in my code but no effect why ? looks like my code isnt running even if i debug it.

2011-08-03 Thread Andreia Gaita
Hi,

Could you try placing the breakpoint inside the OnCreate method and testing
if it stops there? A second test would be to break up the button.Click line
like this:

button.Click += delegate {
 button.Text = string.Format("{0} clicks!", count++);
};

and place a breakpoint inside the delegate, on the "button.Text" line. That
should get hit when you click the button on the app.

On Tue, Aug 2, 2011 at 4:57 PM, Chocolade  wrote:

> I installed anroid sdk tools to c:\Anroid
> Then i installed mono on my visual studio 2010 pro. And i have windows 7.
>
> Now i selected to create new mono for anroid project: Mono for android
> application
> And then im getting this automatic code:
>
> using System;
>
> using Android.App;
> using Android.Content;
> using Android.Runtime;
> using Android.Views;
> using Android.Widget;
> using Android.OS;
>
> namespace MonoAndroidApplication1
> {
>[Activity(Label = "MonoAndroidApplication1", MainLauncher = true, Icon =
> "@drawable/icon")]
>public class Activity1 : Activity
>{
>int count = 1;
>
>protected override void OnCreate(Bundle bundle)
>{
>base.OnCreate(bundle);
>
>// Set our view from the "main" layout resource
>SetContentView(Resource.Layout.Main);
>
>// Get our button from the layout resource,
>// and attach an event to it
>Button button = FindViewById(Resource.Id.MyButton);
>
>button.Click += delegate { button.Text = string.Format("{0}
> clicks!", count++); };
>}
>}
> }
>
> And when im running it i see the window of the emulator device. I selected
> start emulator image.
> There i created new emulator device for anroid 2.2
> When i select it the emulator is running.
>
> But:
>
> 1. I put a breakpoint in my code on the forst line  int count = 1;
> But when im running the program it dosent stop there. Like it dosent even
> go
> to my code.
> Its justl oading the window with the emulator devices and if i run the
> emulator i can see the anroid emulator but it never gets to the code i
> wrote
> and never get into the breakpoint !
> Like the code isnt connected with the emulator ? So strange.
>
> 2. Another problem even that i installed anroid sdk tools to C:\Android
> Still when im quiting the emulator devices window im getting in my code
> window an error:
> Deployment errors. Only if im doing in my code Deploy to my project im not
> getting this error when quiting the emulator devices window.
>
>
> So why my code isnt stop on the breakpoint like the code isnt running or
> not
> connected.
>
> When im doing F5 its first loading the emulator devices window like it
> dosent even go to the code it self.
>
> Cant figure out whats going on.
>
>
> Thanks for helping.
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/Tried-using-breakpoint-in-my-code-but-no-effect-why-looks-like-my-code-isnt-running-even-if-i-debug--tp4659188p4659188.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
>
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] How to have monodroid project in same soultion with windows 7 phone?

2011-08-03 Thread Jonathan Pryor
On Aug 2, 2011, at 3:28 PM, chobo2 wrote:
> I have a VS 2010 solution that has a windows 7 phone project in it.
> 
> I added a default monoandroid project and when I try to deploy it (the 
> emulator dialog does appear)
> 
> I get this error
> 
> " (SignAndroidPackage target) (1) ->
> (_CompileAndroidPackage target) -> 
>  monodroid : error 1: Evaluation version requires targeting the shared
> runtime. [C:\A\B\AndroidApplication1.csproj]

I'm not sure why this would be happening; it sounds like a bug.

Could you please file a bug at bugzilla.xamarin.com with a sample solution 
(containing both WP7 and Mono for Android projects)?

Thanks,
 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


[mono-android] 2 spinners on Dialog click handling

2011-08-03 Thread John Murray
I have discovered how to get a couple of spinners on an alert dialog 

(put them in a xmal then inflate them ) - for anyone interested here's the
crude code 

AlertDialog.Builder alert = new AlertDialog.Builder(this);


LayoutInflater ll =
LayoutInflater.From(this);

View sp4view = ll.Inflate(Resource.Layout.airfpicker,null);

Spinner spa1 =
sp4view.FindViewById(Resource.Id.sp1);

Spinner spa2 =
sp4view.FindViewById(Resource.Id.sp2);

 

(sp1 and sp2 are of course the spinners in the layout file )

 

So far so good 

I was trying this for the commonlyasked reason - can I have a two stage
spinner like on the iPhone ?? Often this is used to streamline the selection
process i.e select a country then a list of cities - so one doesn't have an
inordinate list 

 

As I said so far so good in MonoAndroid until I can to handling the clicks 

 

I put a 'itemselected' delegate onthe first spinner which - depending on the
selection goes and fetches a new array to populate the second spinner 

-  Works well though alittle slow 

Here's the code 

spa1.ItemSelected+=delegate(object sender,ItemEventArgs ee)

{


 
string mystr ="";

 
mystr =spa1.Adapter.GetItem(Convert.ToInt16(
ee.Id)).ToString().Substring(0,3);

 
if (vineGar.xt==null)

 
{

 
vineGar.xt = XDocument.Load(Assets.Open("airfields3.xml"));

 
}

 
Gbr=readairf(vineGar.xt,mystr);// Gbr is a previously defined array 

 
Gbr2=toAAAfromarray(this,Gbr);// this converts the array into an array
adapter could of course do it in one step

spa2.Adapter=null;   // because the selections on first spinner are
constantly changing the adapter for the second //spinner then I need to
nullify before setting to refresh - cannot find out how to use
NotifyDataSetChanged 

 
spa2.Adapter=Gbr2;

};

 

That's the first bit 

Now I want to do something with the selection from the second spinner so I
used the same approach i.e. spa2.ItemSelected+=delegate{};

e.g. 

 

spa2.ItemSelected+=delegate(object sender,ItemEventArgs ee)

{

string mystr
="";

mystr
=spa2.Adapter.GetItem(Convert.ToInt16(  ee.Id)).ToString().Substring(0,4);

 
mystr=findlatlong(vineGar.xt,mystr);

 
Toast.MakeText(this," \n"+mystr,ToastLength.Long).Show();

};

 

 

Trouble is this gets fired which the spinner is initialise with new data
(i.e. before the user has selected anything) so it's not a lot of use 

I tried doing the same with 

Sap2.ItemClick+=delegate(object sender,ItemEventArgs ee){dosomething();};

But if you put the above line in it falls over with a null reference on the
delegation 

 

I suppose I could put in an OK button on the alert dialog and just accept
whatever was selected on the second spinner when OK is pressed but it
doesn't seem too neat to me. Surely there's a way of implementing  an
'onclick' or something 

 

 

Not many of the examples for Android help much   So Help please - I'm not
terribly au fait with delegates, listeners and eventhandlers - 

This could be of interest to others 

 

TIA 

 

John Murray

 

 

 

 

 

 

 

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


[mono-android] Note: Java 7 Will Not Work

2011-08-03 Thread Jonathan Pobst

Hey guys,

We've determined that Java 7 does not currently work with Mono for 
Android, resulting in the [INSTALL_PARSE_FAILED_NO_CERTIFICATES] error.  
The new version of jarsigner no longer produces signed packages that 
Android can read.


We suggest you hold off on installing Java 7 and stick with Java 6 until 
this can be fixed in a future version of Mono for Android.


Jonathan
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] SetInterpolator ?

2011-08-03 Thread Jonathan Pryor
On Aug 2, 2011, at 3:30 AM, fonager wrote:
> I cannot seem to find out how to use the SetInterpolator() method.

It's an Interpolator property; see:


https://github.com/mono/monodroid-samples/blob/master/ApiDemo/Animation/Transition3d.cs#L102

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] splash screen

2011-08-03 Thread Jonathan Pryor
On Jul 28, 2011, at 4:43 PM, John Murray wrote:
> I have tried that but got the same problems another responder had (jarsigner 
> exited with code 1)

Are you using Java 7, by any chance. Java 7 doesn't work with Mono for Android. 
(Among other things, Android doesn't appear to like Java 7's jarsigner output.)

If that's not it, could you provide some verbose log output?

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] get network interface list failure and P/Invoke style workaround?

2011-08-03 Thread Jonathan Pryor
On Aug 1, 2011, at 6:52 AM, Iain Mcleod wrote:
> When I attempt to debug the application, it runs for a few seconds and comms 
> seem fine.  However before long it will crash out and I get a No Source 
> Available page in visual studio with a crash stacktrace (below).  I'm afraid 
> I don't know what the exception message actually is as the No Source 
> Available page does not give me any exception details, and the stacktrace 
> does not include any of my code. My woes are further complicated by the fact 
> that if I try to interact with visual studio to show a disassembly, it 
> crashes too.
> 
> The only info I can provide is the following stacktrace:
> 
> 0x4E in System.Net.WebConnectionStream..ctor at 
> /home/mkestner/monogit/mono/mcs/class/System/System.Net/WebConnectionStream.cs:76
> 0x135 in System.Net.WebConnection.ReadDone at 
> /home/mkestner/monogit/mono/mcs/class/System/System.Net/WebConnection.cs:486

What's the exception? You can see some of the source at:


https://github.com/mono/mono/blob/mono-android-1-0/mcs/class/System/System.Net/WebConnectionStream.cs#L76

https://github.com/mono/mono/blob/mono-android-1-0/mcs/class/System/System.Net/WebConnection.cs#L486

Full stack trace + exception type + message may be helpful.

> 
> I also see a periodic message in the adb log:
> ERROR: Unable to detach current thread from the Java VM!

That's ignorable. We should probably just stop emitting that message; I'm not 
even sure why it happens (as in, I've read Android's source and can't fathom 
how we're getting a return value that would prompt us to generate that 
message...).

> App is open source, I can also send you a build if you wish to try running 
> it, but I rather suspect it will not crash without running on a network with 
> devices to communicate with.

You could always file a bug. :-)

I am also reminded of:

https://bugzilla.novell.com/show_bug.cgi?id=648862#c9

in which things went bad because network resources weren't disposed of in a 
timely fashion. Perhaps you could look for some HttpWebResponse/etc. instances 
and ensure that you Dispose() of them when you're done? Mono's networking 
infrastructure doesn't seem to like/appreciate having "too many" network 
connections "in flight" at once.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] splash screen

2011-08-03 Thread Glen Hassell
Hi Jon,
I've found I'm able to build MonoDroid apps with Java 7.

ARCH = Windows 7 X64 SP1
Visual Studio 2010 premium.

*C:\>java -version*
*java version "1.7.0"*
*Java(TM) SE Runtime Environment (build 1.7.0-b147)*
*Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)*

It's not supported... it works :)

Regards,
Glen

On Thu, Aug 4, 2011 at 8:59 AM, Jonathan Pryor  wrote:

> On Jul 28, 2011, at 4:43 PM, John Murray wrote:
> > I have tried that but got the same problems another responder had
> (jarsigner exited with code 1)
>
> Are you using Java 7, by any chance. Java 7 doesn't work with Mono for
> Android. (Among other things, Android doesn't appear to like Java 7's
> jarsigner output.)
>
> If that's not it, could you provide some verbose log output?
>
>  - Jon
>
> ___
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>



-- 
Glen Hassell
Inner Technique
http://innertech.com.au/
Office: 03 9687 0006
Mobile: +61 (0) 438 340 385
___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


Re: [mono-android] splash screen

2011-08-03 Thread Jonathan Pryor
On Aug 3, 2011, at 8:20 PM, Glen Hassell wrote:
> Hi Jon,
> I've found I'm able to build MonoDroid apps with Java 7.

It's not a matter of building, it's a matter of deploying:


http://lists.ximian.com/mailman/private/monodroid/2011-August/005662.html

>> We've determined that Java 7 does not currently work with Mono for 
>> Android, resulting in the [INSTALL_PARSE_FAILED_NO_CERTIFICATES] error.  


Android apparently doesn't like Java 7's jarsigner output, and creating 
deployable packages is a rather important requirement. :-)

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid