Re: [mono-android] System.Linq.Dynamic

2012-04-16 Thread laurar81
I followed all the steps as described but does not work.
I'm sorry

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/System-Linq-Dynamic-tp5636105p5643098.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] Just a test (2)

2012-04-16 Thread Tom Opgenorth
Please ignore this, I'm trying to resolve some issues I'm having with
this e-mail. Sorry for the distraction.

-- 
http://www.opgenorth.net
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] System.Linq.Dynamic

2012-04-16 Thread Atsushi Eno
Oh, then my suggestion is likely invalid. I'm sorry and thanks for your 
time. I'll look for a valid fix for this issue anyways.


Atsushi Eno

On 2012/04/16 16:12, laurar81 wrote:

I followed all the steps as described but does not work.
I'm sorry

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/System-Linq-Dynamic-tp5636105p5643098.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] r17 x86 support

2012-04-16 Thread Andreia Gaita
Hi everyone,

We're investigating the link issues on 4.0.6 and 4.1, it seems Google is 
changing some system areas every time they release a new sdk and it's affecting 
the x86 libraries.

If you hit a "java.lang.UnsatisfiedLinkError: Cannot load library: 
reloc_library" error, post it here along with the rest of the message ("cannot 
locate…"), which Android SDK you're using, where it's an update from a previous 
Android SDK version or if it's a new one, what type of x86 image you're running 
(emulator name as listed on the Android Manager, or something else), and what 
version of Mono for Android you're using.  

Thanks!

andreia gaita


On Sunday, April 15, 2012 at 7:07 PM, Wally McClure wrote:

> I just updated to r18.  That's the most recent version that I am familiar 
> with.  :-)
> My sample code that I tested with r18 and the x86 emulator all ran.  Yes, 
> when I refer to the 2.3 x86 emulator, I am referring to the Android 2.3.3 
> Intel Atom x86 system image.
>  
> As I understand from talking to Chris Hardy, the MfA 4.0.6 release doesn't 
> have specific integration with the x86 emulator, it just happens to work with 
> 4.0.6.  If I am reading the tea leaves correctly, the 4.2 release will have 
> any missing integration.  Please remember that I don't speak for Xamarin so 
> anything I say may not happen or I could be completely wrong.
>  
> Jon Pobst and Jon Pryor can speak to specifics of your error.
>  
> Wally
>  
> > Date: Fri, 13 Apr 2012 19:23:21 -0700
> > From: zezba9...@gmail.com (mailto:zezba9...@gmail.com)
> > To: monodroid@lists.ximian.com (mailto:monodroid@lists.ximian.com)
> > Subject: Re: [mono-android] r17 x86 support
> >  
> > Yes I have the purchased version on the Mac and on Windows 8 x64. In
> > MonoDevelop/About/VersionInfo it reports "Mono for Android: 4.0.6.52253989",
> > there is no (Evaluation at the end).
> > Also I am using r19 of the Android SDK Tools... Maybe thats an issue?
> >  
> > When I use "adb logcat" like you suggested both platforms(x86 emulators on
> > Mac and Windows) give the error::
> > {
> > java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1311]:  
> > 799 cannot locate 'atexit'...
> > }
> > I see this error is similar to the one above.
> >  
> > When you say your using the "Android 2.3 x86 emulator" does that mean your
> > using the one from the "Android 2.3.3 (API 10)/Intel Atom x86 System Image"
> > listed in the "Android SDK Manager" ??
> >  
> > Any other idea's or things I might try would be put to good use...
> >  
> > --
> > View this message in context: 
> > http://mono-for-android.1047100.n5.nabble.com/r17-x86-support-tp5592225p5639941.html
> > Sent from the Mono for Android mailing list archive at Nabble.com 
> > (http://Nabble.com).
> > ___
> > Monodroid mailing list
> > Monodroid@lists.ximian.com (mailto:Monodroid@lists.ximian.com)
> >  
> > UNSUBSCRIBE INFORMATION:
> > http://lists.ximian.com/mailman/listinfo/monodroid
> ___
> Monodroid mailing list
> Monodroid@lists.ximian.com (mailto: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


[mono-android] Performance of Canvas.DrawPoint

2012-04-16 Thread hawk66
Hello,

I generate a map/terrain; created with procedural content generation (on the
fly) and try it now to visualize on a canvas. This works fine but the
performance is pretty bad:

for (int x = 0; x < _mapManager.WorldManager.Terrain.Width; x++) {
for (int y = 0; y < 
_mapManager.WorldManager.Terrain.Height; y++) {

paint.Color = 
_mapManager.GetColorOfHeight(x,y);
c.DrawPoint(x,y, paint);

In my example width/height is each of size 512 and this for loop takes a
couple of seconds on an Asus Transformer Prime tablet, which is
unacceptable...probably I have chosen not the smartest way to render such a
'map'...

Is there any more efficient way to draw the map?

Thanks guys for your help in advance!

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Performance-of-Canvas-DrawPoint-tp5644629p5644629.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] GLDiag not working in 4.0.6 on Samsung Galaxy S

2012-04-16 Thread Eduardo Jimenez

Hi,

I'm trying to run an OpenGL ES app on the Samsung Galaxy S, since it's 
one of the most common Android phones out there capable of OpenGL ES 2.0 
but I'm unable to. It crashes with the following statement:


OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed with 
error 12288 (0x3000)


So I tried to run the GLDiag example and it crashed with the same exact 
error. I've added the whole stacktrace in case it may be useful. In any 
case it's when creating the frame buffer. It seems not to be working for 
some weird reason. It works just fine in my Samsung Galaxy Tab. I'm 
trying to get my hands on more phones to be able to say whether it 
happens on other phones as well.


In any case, I'm reverting to version 4.0.4 to see if that fixes it. Any 
help here will be much appreciated.


Best regards,
Eduardo


OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed with 
error 12288 (0x3000)
[ERROR] FATAL UNHANDLED EXCEPTION: OpenTK.Platform.Android.EglException: 
EglCreateWindowSurface failed with error 12288 (0x3000)
  at OpenTK.Platform.Android.AndroidWindow.CreateSurface 
(Javax.Microedition.Khronos.Egl.EGLConfig config) [0x00058] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:338 

  at OpenTK.Platform.Android.AndroidGraphicsContext.Init 
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo win, IGraphicsContext 
sharedContext, GLContextVersion glesVersion, GraphicsContextFlags flags) 
[0x0013e] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:132 

  at OpenTK.Platform.Android.AndroidGraphicsContext..ctor 
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext 
sharedContext, GLContextVersion glesVersion, GraphicsContextFlags flags) 
[0x6] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:83 

  at 
OpenTK.Platform.Android.AndroidGraphicsContext.CreateGraphicsContext 
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext 
sharedContext, GLContextVersion glVersion, GraphicsContextFlags flags) 
[0x0] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:44 

  at OpenTK.Platform.Android.AndroidGameView.CreateContext () [0x0] 
in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:307 

  at OpenTK.Platform.Android.AndroidGameView.CreateFrameBuffer () 
[0x0] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:158 

  at Mono.Samples.GLDiag.PaintingView.CreateFrameBuffer () [0x00436] in 
D:\XNA\Android\MonoDroid Samples\GLDiagnostics\PaintingView.cs:105
  at OpenTK.Platform.Android.AndroidGameView.LoadInternal 
(System.EventArgs e) [0x0] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:234 

  at OpenTK.Platform.Android.AndroidGameView.SurfaceCreated 
(ISurfaceHolder holder) [0x0005d] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:104 

  at 
Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceCreated_Landroid_view_SurfaceHolder_ 
(IntPtr jnienv, IntPtr native__this, IntPtr native_holder) [0x00010] in 
/home/jpobst/Desktop/mfa-406/Mono.Android/platforms/android-8/src/generated/Android.Views.ISurfaceHolder.cs:157 

  at (wrapper dynamic-method) 
object:9a875116-8f83-4ee0-ad07-84a6b2459c27 (intptr,intptr,intptr)


___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] System.Linq.Dynamic

2012-04-16 Thread laurar81
I hope that you find a solution.
I need really this library. 

can you tell me of you find a solution?

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/System-Linq-Dynamic-tp5636105p5644204.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] GLDiag not working in 4.0.6 on Samsung Galaxy S

2012-04-16 Thread Eduardo Jimenez

I've done a little bit of testing and trying things out:

- Mono 4.0.4 is giving me problems in the Run() function. It hangs and 
won't call the Update or Render functions
- I think that the error code (0x3000) corresponds to EGL_SUCCESS, but I 
suppose that's just a coincidence, since it should return the surface 
handle.


I don't know but it's very odd.

Cheers,
Eduardo

On 4/16/2012 8:45 PM, Eduardo Jimenez wrote:

Hi,

I'm trying to run an OpenGL ES app on the Samsung Galaxy S, since it's 
one of the most common Android phones out there capable of OpenGL ES 
2.0 but I'm unable to. It crashes with the following statement:


OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed 
with error 12288 (0x3000)


So I tried to run the GLDiag example and it crashed with the same 
exact error. I've added the whole stacktrace in case it may be useful. 
In any case it's when creating the frame buffer. It seems not to be 
working for some weird reason. It works just fine in my Samsung Galaxy 
Tab. I'm trying to get my hands on more phones to be able to say 
whether it happens on other phones as well.


In any case, I'm reverting to version 4.0.4 to see if that fixes it. 
Any help here will be much appreciated.


Best regards,
Eduardo


OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed 
with error 12288 (0x3000)
[ERROR] FATAL UNHANDLED EXCEPTION: 
OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed 
with error 12288 (0x3000)
  at OpenTK.Platform.Android.AndroidWindow.CreateSurface 
(Javax.Microedition.Khronos.Egl.EGLConfig config) [0x00058] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:338 

  at OpenTK.Platform.Android.AndroidGraphicsContext.Init 
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo win, IGraphicsContext 
sharedContext, GLContextVersion glesVersion, GraphicsContextFlags 
flags) [0x0013e] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:132 

  at OpenTK.Platform.Android.AndroidGraphicsContext..ctor 
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, 
IGraphicsContext sharedContext, GLContextVersion glesVersion, 
GraphicsContextFlags flags) [0x6] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:83 

  at 
OpenTK.Platform.Android.AndroidGraphicsContext.CreateGraphicsContext 
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, 
IGraphicsContext sharedContext, GLContextVersion glVersion, 
GraphicsContextFlags flags) [0x0] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:44 

  at OpenTK.Platform.Android.AndroidGameView.CreateContext () 
[0x0] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:307 

  at OpenTK.Platform.Android.AndroidGameView.CreateFrameBuffer () 
[0x0] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:158 

  at Mono.Samples.GLDiag.PaintingView.CreateFrameBuffer () [0x00436] 
in D:\XNA\Android\MonoDroid Samples\GLDiagnostics\PaintingView.cs:105
  at OpenTK.Platform.Android.AndroidGameView.LoadInternal 
(System.EventArgs e) [0x0] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:234 

  at OpenTK.Platform.Android.AndroidGameView.SurfaceCreated 
(ISurfaceHolder holder) [0x0005d] in 
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:104 

  at 
Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceCreated_Landroid_view_SurfaceHolder_ 
(IntPtr jnienv, IntPtr native__this, IntPtr native_holder) [0x00010] 
in 
/home/jpobst/Desktop/mfa-406/Mono.Android/platforms/android-8/src/generated/Android.Views.ISurfaceHolder.cs:157 

  at (wrapper dynamic-method) 
object:9a875116-8f83-4ee0-ad07-84a6b2459c27 (intptr,intptr,intptr)


___
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] GLDiag not working in 4.0.6 on Samsung Galaxy S

2012-04-16 Thread Andreia Gaita
Hi,

There's a problem with some Samsung devices that we're working on
fixing. In the meantime, try the 4.0.5 beta, it has ICS support and
seems to work better with some devices.

~~ andreia gaita ~~
scribled on my iPaddle

On Apr 16, 2012, at 21:05, Eduardo Jimenez  wrote:

> I've done a little bit of testing and trying things out:
>
> - Mono 4.0.4 is giving me problems in the Run() function. It hangs and won't 
> call the Update or Render functions
> - I think that the error code (0x3000) corresponds to EGL_SUCCESS, but I 
> suppose that's just a coincidence, since it should return the surface handle.
>
> I don't know but it's very odd.
>
> Cheers,
> Eduardo
>
> On 4/16/2012 8:45 PM, Eduardo Jimenez wrote:
>> Hi,
>>
>> I'm trying to run an OpenGL ES app on the Samsung Galaxy S, since it's one 
>> of the most common Android phones out there capable of OpenGL ES 2.0 but I'm 
>> unable to. It crashes with the following statement:
>>
>> OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed with 
>> error 12288 (0x3000)
>>
>> So I tried to run the GLDiag example and it crashed with the same exact 
>> error. I've added the whole stacktrace in case it may be useful. In any case 
>> it's when creating the frame buffer. It seems not to be working for some 
>> weird reason. It works just fine in my Samsung Galaxy Tab. I'm trying to get 
>> my hands on more phones to be able to say whether it happens on other phones 
>> as well.
>>
>> In any case, I'm reverting to version 4.0.4 to see if that fixes it. Any 
>> help here will be much appreciated.
>>
>> Best regards,
>> Eduardo
>>
>>
>> OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed with 
>> error 12288 (0x3000)
>> [ERROR] FATAL UNHANDLED EXCEPTION: OpenTK.Platform.Android.EglException: 
>> EglCreateWindowSurface failed with error 12288 (0x3000)
>>  at OpenTK.Platform.Android.AndroidWindow.CreateSurface 
>> (Javax.Microedition.Khronos.Egl.EGLConfig config) [0x00058] in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:338
>>  at OpenTK.Platform.Android.AndroidGraphicsContext.Init 
>> (OpenTK.Graphics.GraphicsMode mode, IWindowInfo win, IGraphicsContext 
>> sharedContext, GLContextVersion glesVersion, GraphicsContextFlags flags) 
>> [0x0013e] in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:132
>>  at OpenTK.Platform.Android.AndroidGraphicsContext..ctor 
>> (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext 
>> sharedContext, GLContextVersion glesVersion, GraphicsContextFlags flags) 
>> [0x6] in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:83
>>  at OpenTK.Platform.Android.AndroidGraphicsContext.CreateGraphicsContext 
>> (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, IGraphicsContext 
>> sharedContext, GLContextVersion glVersion, GraphicsContextFlags flags) 
>> [0x0] in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:44
>>  at OpenTK.Platform.Android.AndroidGameView.CreateContext () [0x0] in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:307
>>  at OpenTK.Platform.Android.AndroidGameView.CreateFrameBuffer () [0x0] 
>> in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:158
>>  at Mono.Samples.GLDiag.PaintingView.CreateFrameBuffer () [0x00436] in 
>> D:\XNA\Android\MonoDroid Samples\GLDiagnostics\PaintingView.cs:105
>>  at OpenTK.Platform.Android.AndroidGameView.LoadInternal (System.EventArgs 
>> e) [0x0] in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:234
>>  at OpenTK.Platform.Android.AndroidGameView.SurfaceCreated (ISurfaceHolder 
>> holder) [0x0005d] in 
>> /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:104
>>  at 
>> Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceCreated_Landroid_view_SurfaceHolder_
>>  (IntPtr jnienv, IntPtr native__this, IntPtr native_holder) [0x00010] in 
>> /home/jpobst/Desktop/mfa-406/Mono.Android/platforms/android-8/src/generated/Android.Views.ISurfaceHolder.cs:157
>>  at (wrapper dynamic-method) object:9a875116-8f83-4ee0-ad07-84a6b2459c27 
>> (intptr,intptr,intptr)
>>
>> ___
>> 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
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


[mono-android] Need to set cursor location in EditText control

2012-04-16 Thread Mike
My first Android app. I have an EditText that is causing problems. If the
user enters a special character (anything other than a letter) The
backspace/delete key does not work, it freezes. I have tried to get around
this by writing a piece of code to trap the delete key down event and delete
the last character entered. This works, but the cursor goes to the first
character in the box instead of next to the last character like I want. 

I need to set the cursor to be at the last (rightmost) character in the
control.

I have found a Java example using getSelectionEnd, but need a c# example
since I can't figure out the C# equivalent.

Here is the code snippet. The EditText control is called
_enterAuthorizedAdult

 if (e.E.Action == KeyEventActions.Down && e.KeyCode == Keycode.Del)
{
if
(_enterAuthorizedAdult.Text.Length > 0)
{
   
_enterAuthorizedAdult.Text =
   
_enterAuthorizedAdult.Text.Substring(0, _enterAuthorizedAdult.Text.Length -
1);
}
}

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Need-to-set-cursor-location-in-EditText-control-tp5645003p5645003.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] GLDiag not working in 4.0.6 on Samsung Galaxy S

2012-04-16 Thread Andreia Gaita
BTW, have you tried other OpenGL samples like the GLCube? I've done a few 
changes to try and workaround this problem, it might work on the Galaxy S. 


andreia gaita


On Monday, April 16, 2012 at 9:03 PM, Eduardo Jimenez wrote:

> I've done a little bit of testing and trying things out:
> 
> - Mono 4.0.4 is giving me problems in the Run() function. It hangs and 
> won't call the Update or Render functions
> - I think that the error code (0x3000) corresponds to EGL_SUCCESS, but I 
> suppose that's just a coincidence, since it should return the surface 
> handle.
> 
> I don't know but it's very odd.
> 
> Cheers,
> Eduardo
> 
> On 4/16/2012 8:45 PM, Eduardo Jimenez wrote:
> > Hi,
> > 
> > I'm trying to run an OpenGL ES app on the Samsung Galaxy S, since it's 
> > one of the most common Android phones out there capable of OpenGL ES 
> > 2.0 but I'm unable to. It crashes with the following statement:
> > 
> > OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed 
> > with error 12288 (0x3000)
> > 
> > So I tried to run the GLDiag example and it crashed with the same 
> > exact error. I've added the whole stacktrace in case it may be useful. 
> > In any case it's when creating the frame buffer. It seems not to be 
> > working for some weird reason. It works just fine in my Samsung Galaxy 
> > Tab. I'm trying to get my hands on more phones to be able to say 
> > whether it happens on other phones as well.
> > 
> > In any case, I'm reverting to version 4.0.4 to see if that fixes it. 
> > Any help here will be much appreciated.
> > 
> > Best regards,
> > Eduardo
> > 
> > 
> > OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed 
> > with error 12288 (0x3000)
> > [ERROR] FATAL UNHANDLED EXCEPTION: 
> > OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed 
> > with error 12288 (0x3000)
> > at OpenTK.Platform.Android.AndroidWindow.CreateSurface 
> > (Javax.Microedition.Khronos.Egl.EGLConfig config) [0x00058] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:338
> >  
> > 
> > at OpenTK.Platform.Android.AndroidGraphicsContext.Init 
> > (OpenTK.Graphics.GraphicsMode mode, IWindowInfo win, IGraphicsContext 
> > sharedContext, GLContextVersion glesVersion, GraphicsContextFlags 
> > flags) [0x0013e] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:132
> >  
> > 
> > at OpenTK.Platform.Android.AndroidGraphicsContext..ctor 
> > (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, 
> > IGraphicsContext sharedContext, GLContextVersion glesVersion, 
> > GraphicsContextFlags flags) [0x6] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:83
> >  
> > 
> > at 
> > OpenTK.Platform.Android.AndroidGraphicsContext.CreateGraphicsContext 
> > (OpenTK.Graphics.GraphicsMode mode, IWindowInfo window, 
> > IGraphicsContext sharedContext, GLContextVersion glVersion, 
> > GraphicsContextFlags flags) [0x0] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:44
> >  
> > 
> > at OpenTK.Platform.Android.AndroidGameView.CreateContext () 
> > [0x0] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:307
> >  
> > 
> > at OpenTK.Platform.Android.AndroidGameView.CreateFrameBuffer () 
> > [0x0] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:158
> >  
> > 
> > at Mono.Samples.GLDiag.PaintingView.CreateFrameBuffer () [0x00436] 
> > in D:\XNA\Android\MonoDroid Samples\GLDiagnostics\PaintingView.cs:105
> > at OpenTK.Platform.Android.AndroidGameView.LoadInternal 
> > (System.EventArgs e) [0x0] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:234
> >  
> > 
> > at OpenTK.Platform.Android.AndroidGameView.SurfaceCreated 
> > (ISurfaceHolder holder) [0x0005d] in 
> > /home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:104
> >  
> > 
> > at 
> > Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceCreated_Landroid_view_SurfaceHolder_
> >  
> > (IntPtr jnienv, IntPtr native__this, IntPtr native_holder) [0x00010] 
> > in 
> > /home/jpobst/Desktop/mfa-406/Mono.Android/platforms/android-8/src/generated/Android.Views.ISurfaceHolder.cs:157
> >  
> > 
> > at (wrapper dynamic-method) 
> > object:9a875116-8f83-4ee0-ad07-84a6b2459c27 (intptr,intptr,intptr)
> > 
> > ___
> > Monodroid mailing list
> > Monodroid@lists.ximian.com (mailto:Monodroid@lists.ximian.com)
> > 
> > UNSUBSCRIBE INFORMATION:
> > http://lists.ximian.com/mailman/listinfo/monodroid
> > 
> 
> 
> ___
> Monodroid mailing list
> Monodroid@lists.ximian.com (mailto:Monodroid@lists.ximian.com)
> 
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
> 
> 


___
M

[mono-android] JNIEnv questions / problems

2012-04-16 Thread Paul Johnson

Hi,

I'm trying to port over some Java to M4A to enable me to produce modal 
windows. Most of the work has been done, but I'm now stuck on using 
JNIEnv.GetMethodID/JNIEnv.GetFieldID and a number methods that don't 
seem to be listed anywhere (GetDeclaredMethod and GetDeclaredField) or 
aren't available when using JNIEnv.


JNIEnv.Get*ID requires the type of the variable to be IntPtr, but then 
requires IntPtr kls, string name, string signature for the parameters. 
Unfortunately, the documentation on the API area gives the 
"documentation to be added" line for kls which isn't much help.


My current code looks like this - I've commented parts for ease...

8-->
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;

namespace oqhra_android
{
[Activity(Theme = "@android:style/Theme.NoTitleBar")]
public class modal : Activity
{
public class ModalDialog
{
private bool mChoice = false;
private bool mQuitModal = false;

// Both JNIEnv require IntPtr kls, string name and
// string signature - below is therefore wrong
private IntPtr mMsgQueueNextMethod = JNIEnv.GetMethodID();
private IntPtr mMsgTargetFiled = JNIEnv.GetFieldID();

public ModalDialog()
{ }

public void showAlertDialog(Context context, string info)
{
if (!prepareModal())
return;

AlertDialog.Builder builder = new 
AlertDialog.Builder(context);

builder.SetMessage(info);
builder.SetCancelable(false);
builder.SetPositiveButton("Yes", (object o, 
Android.Content.DialogClickEventArgs e) =>

{
this.mQuitModal = true;
builder.Dispose(); // was dialog.dismiss()
});

AlertDialog alert = builder.Create();
alert.Show();

doModal();
}

public bool showConfirmDialog(Context context, String info)
{
if (!prepareModal())
return false;
// reset choice
mChoice = false;

AlertDialog.Builder builder = new 
AlertDialog.Builder(context);

builder.SetMessage(info);
builder.SetCancelable(false);
builder.SetPositiveButton("Yes", (object o, 
Android.Content.DialogClickEventArgs e) =>

{
this.mQuitModal = true;
this.mChoice = true;
builder.Dispose();
});

builder.SetNegativeButton("Cancel", (object o, 
Android.Content.DialogClickEventArgs e) =>

{
mQuitModal = true;
mChoice = false;
builder.Dispose(); // probably wrong
});

AlertDialog alert = builder.Create();
alert.Show();

doModal();
return mChoice;
}

private bool prepareModal()
{
Java.Lang.Class clsMsgQueue = null;
Java.Lang.Class clsMessage = null;

try
{
clsMsgQueue = 
Java.Lang.Class.ForName("android.os.MessageQueue");

}
catch (Java.Lang.ClassNotFoundException e)
{
e.PrintStackTrace();
return false;
}

try
{
clsMessage = 
Java.Lang.Class.ForName("android.os.Message");

}
catch (Java.Lang.ClassNotFoundException e)
{
e.PrintStackTrace();
return false;
}

try
{
//GetDeclaredMethod is not available
mMsgQueueNextMethod = 
clsMsgQueue.GetDeclaredMethod("next", new Java.Lang.Class[] { });

}
catch (Java.Lang.SecurityException e)
{
e.PrintStackTrace();
return false;
}
catch (Java.Lang.NoSuchMethodException e)
{
e.PrintStackTrace();
return false;
}

mMsgQueueNextMethod.setAccessible(true);
// setAccessible - not available

try
{
// GetDeclaredField not available
mMsgTargetFiled = 
clsMessage.GetDeclaredField("target");

}
catch (Java.Lang.SecurityException e)
{

Re: [mono-android] JNIEnv questions / problems

2012-04-16 Thread Jonathan Pryor
On Apr 16, 2012, at 7:04 PM, Paul Johnson wrote:
> JNIEnv.Get*ID requires the type of the variable to be IntPtr, but then 
> requires IntPtr kls, string name, string signature for the parameters. 
> Unfortunately, the documentation on the API area gives the "documentation to 
> be added" line for kls which isn't much help.

As per the API Design document [0], you can (normally) use the similarly named 
JNI function documentation:

http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html

In particular, for e.g. GetMethodID(), you want a Class reference, the name of 
the method, and the method signature:


http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html#wp16656

The Binding Android Types documentation may also be helpful:


http://docs.xamarin.com/android/advanced_topics/Binding_Android_Types#_Instance_Methods

http://docs.xamarin.com/android/advanced_topics/Binding_Android_Types#JNI_Type_Signatures

>private bool prepareModal()
>{

using (var MessageQueue_Class = 
Java.Lang.Class.FromType(typeof(Android.OS.MessageQueue)))
using (var Message_Class = 
Java.Lang.Class.FromType(typeof(Android.OS.Message))) {
mMsgQueueNextMethod = 
JNIEnv.GetMethodID(MessageQueue_Class.Handle,
"next", "()Landroid/os/Message;");
mMsgTargetField = JNIEnv.GetFieldID(Message_Class.Handle,
"target", "Landroid/os/Handler;");
return true;
}

>private void doModal()
>{
>mQuitModal = false;
> 
>// get message queue associated with main UI thread
>MessageQueue queue = Looper.MyQueue();
>while (!mQuitModal)
>{
>// call queue.next(), might block
>Message msg = null;
>try
>{
>   // invoke not available
>msg = (Message)mMsgQueueNextMethod.invoke(queue, new 
> Object[] { });

IntPtr _msg = JNIEnv.CallObjectMethod(queue.Handle, 
mMsgQueueNextMethod);
if (_msg == IntPtr.Zero)
return;

using (msg = Java.Lang.Object.GetObject(_msg, 
JniHandleOwnership.TransferLocalRef)) {
IntPtr _target = JNIEnv.GetObjectField(msg.Handle, 
mMsgTargetField);
if (_target == IntPtr.Zero) {
mQuitModal = true;
return;
}
using (var target = 
Java.Lang.Object.GetObject(_target, 
JniHandleOwnership.TransferLocalRef)) {
target.DispatchMessage(msg);
msg.Recycle();
}
}

 - Jon

[0] 
http://docs.xamarin.com/android/advanced_topics/api_design#Java_Native_Interface_Support

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


[mono-android] Error Deploying Project After Including Java Source file

2012-04-16 Thread craig
I'm trying to demo using Java Source code via JNI but having issues.

I created a new Mono 4 Android project.

I also created a simple Java file named Test.java.  Here is the contents of
Test.java:

[code]
package com.test;

public class Test
{
public Test()
{
}

public int add(int a, int b)
{
return a + b;
}
}
[/code]

I went into project properties, created an Android Manifest, and then
changed package name to "com.test" to match the package name of my java
source file.  I also right clicked on Test.java and set Build Action =
"AndroidJavaSource".

Ok, I know I have to do more to get the JNI stuff working, but let's stop
right there, because I can no longer deploy to the emulator after changing
Build Action to "AndroidJavaSource".

The project builds fine but it errors out during the deploy process.  The
problem seems to be related to the following lines in the output console (If
you look at the javac command line parameters, it doesn't appear to be
including my Test.java source file as one of the parameters):

_CompileJava:
JavaSourceFiles:
  Test.java
JavaLibraries:
AddOnPlatformLibraries:
  C:\Program Files (x86)\Java\jdk1.6.0_27\bin\javac.exe -d
obj\Debug\android\bin\classes -classpath "C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v2.1\mono.android.jar"
-bootclasspath
C:\Users\CSchulte\AppData\Local\Xamarin\MonoForAndroid\AndroidSDK\android-sdk-windows\platforms\android-7\android.jar
-encoding UTF-8 "@C:\Users\CSchulte\AppData\Local\Temp\tmp5921.tmp" 
C:\Program Files
(x86)\MSBuild\Novell\Novell.MonoDroid.Common.targets(680,3): error MSB6006:
*"javac.exe" exited with code 1*. [C:\Users\CSchulte\Documents\Visual Studio
2010\Projects\testtesttest\testtesttest\testtesttest.csproj]
Done Building Project "C:\Users\CSchulte\Documents\Visual Studio
2010\Projects\testtesttest\testtesttest\testtesttest.csproj"
(SignAndroidPackage target(s)) -- FAILED.


--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Error-Deploying-Project-After-Including-Java-Source-file-tp5645351p5645351.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] Error Deploying Project After Including Java Source file

2012-04-16 Thread Jonathan Pryor
On Apr 16, 2012, at 9:35 PM, craig wrote:
> I went into project properties, created an Android Manifest, and then changed 
> package name to "com.test" to match the package name of my java source file.

This shouldn't be necessary...

> The project builds fine but it errors out during the deploy process.  The 
> problem seems to be related to the following lines in the output console (If 
> you look at the javac command line parameters, it doesn't appear to be 
> including my Test.java source file as one of the parameters):

It is; it's using a javac "response file" (the 
"@C:\Users\CSchulte\AppData\Local\Temp\tmp5921.tmp" parameter), which lists all 
the files to compile (as there may be more files than the command-line length 
permits).

Unfortunately there's no way to preserve the response file contents for 
sanity-checking. :-(

What encoding is Test.java using? It needs to be UTF-8 or a compatible charset 
(such as 7-bit ASCII).

Unfortunately, I'm unable to reproduce. If the file encoding isn't the 
solution, could you please file a test case and attach the project so I can 
further investigate?

Thanks,
 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Need to set cursor location in EditText control

2012-04-16 Thread Jonathan Pryor
On Apr 16, 2012, at 5:17 PM, Mike wrote:
> I have found a Java example using getSelectionEnd, but need a c# example 
> since I can't figure out the C# equivalent.

The getSelectionEnd() method was mapped to the SelectionEnd property:


http://androidapi.xamarin.com/?link=P:Android.Widget.TextView.SelectionEnd

You should be able get/set it just as the Java example was doing, just with 
property syntax instead of method invocation syntax.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Performance of Canvas.DrawPoint

2012-04-16 Thread Jonathan Pryor
On Apr 16, 2012, at 2:35 PM, hawk66 wrote:
> Is there any more efficient way to draw the map?

Might I suggest Canvas.DrawPoints(float[], int, int, Paint)?


http://androidapi.xamarin.com/?link=M%3aAndroid.Graphics.Canvas.DrawPoints(System.Single%5b%5d%2cSystem.Int32%2cSystem.Int32%2cAndroid.Graphics.Paint)

You'll need to rework your logic to create an appropriately formatted float[] 
(which contains x/y pairs), and your existing algorithm isn't amenable to 
determining which Paint color to use for the entire span, but (sanely done) 
this should allow a number of Canvas.DrawPoints() calls which matches the 
number of colors in your image, as opposed to the 512² (262144) JNI invocations 
that your current approach would require.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Error Deploying Project After Including Java Source file

2012-04-16 Thread craig
Thanks it's working now.

I deleted the Java file and re-created it from within Visual Studio.  After
that it worked fine.  Maybe the old file was somehow using the wrong
encoding as you suggested.

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Error-Deploying-Project-After-Including-Java-Source-file-tp5645351p5645493.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] GLDiag not working in 4.0.6 on Samsung Galaxy S

2012-04-16 Thread Eduardo Jimenez
GLCube won't work for some reason. It crashes with no callstack. 
Meanwhile the triangle ES 2.0 works in 4.0.4 but I think it doesn't in 
4.0.6, I'll check it in a bit.


BTW, how can I get an older beta version of Mono?

Cheers,
Eduardo

On 4/16/2012 11:31 PM, Andreia Gaita wrote:
BTW, have you tried other OpenGL samples like the GLCube? I've done a 
few changes to try and workaround this problem, it might work on the 
Galaxy S.



andreia gaita

On Monday, April 16, 2012 at 9:03 PM, Eduardo Jimenez wrote:


I've done a little bit of testing and trying things out:

- Mono 4.0.4 is giving me problems in the Run() function. It hangs and
won't call the Update or Render functions
- I think that the error code (0x3000) corresponds to EGL_SUCCESS, but I
suppose that's just a coincidence, since it should return the surface
handle.

I don't know but it's very odd.

Cheers,
Eduardo

On 4/16/2012 8:45 PM, Eduardo Jimenez wrote:

Hi,

I'm trying to run an OpenGL ES app on the Samsung Galaxy S, since it's
one of the most common Android phones out there capable of OpenGL ES
2.0 but I'm unable to. It crashes with the following statement:

OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed
with error 12288 (0x3000)

So I tried to run the GLDiag example and it crashed with the same
exact error. I've added the whole stacktrace in case it may be useful.
In any case it's when creating the frame buffer. It seems not to be
working for some weird reason. It works just fine in my Samsung Galaxy
Tab. I'm trying to get my hands on more phones to be able to say
whether it happens on other phones as well.

In any case, I'm reverting to version 4.0.4 to see if that fixes it.
Any help here will be much appreciated.

Best regards,
Eduardo


OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed
with error 12288 (0x3000)
[ERROR] FATAL UNHANDLED EXCEPTION:
OpenTK.Platform.Android.EglException: EglCreateWindowSurface failed
with error 12288 (0x3000)
at OpenTK.Platform.Android.AndroidWindow.CreateSurface
(Javax.Microedition.Khronos.Egl.EGLConfig config) [0x00058] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:338 



at OpenTK.Platform.Android.AndroidGraphicsContext.Init
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo win, IGraphicsContext
sharedContext, GLContextVersion glesVersion, GraphicsContextFlags
flags) [0x0013e] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:132 



at OpenTK.Platform.Android.AndroidGraphicsContext..ctor
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo window,
IGraphicsContext sharedContext, GLContextVersion glesVersion,
GraphicsContextFlags flags) [0x6] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:83 



at
OpenTK.Platform.Android.AndroidGraphicsContext.CreateGraphicsContext
(OpenTK.Graphics.GraphicsMode mode, IWindowInfo window,
IGraphicsContext sharedContext, GLContextVersion glVersion,
GraphicsContextFlags flags) [0x0] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGraphicsContext.cs:44 



at OpenTK.Platform.Android.AndroidGameView.CreateContext ()
[0x0] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:307 



at OpenTK.Platform.Android.AndroidGameView.CreateFrameBuffer ()
[0x0] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:158 



at Mono.Samples.GLDiag.PaintingView.CreateFrameBuffer () [0x00436]
in D:\XNA\Android\MonoDroid Samples\GLDiagnostics\PaintingView.cs:105
at OpenTK.Platform.Android.AndroidGameView.LoadInternal
(System.EventArgs e) [0x0] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:234 



at OpenTK.Platform.Android.AndroidGameView.SurfaceCreated
(ISurfaceHolder holder) [0x0005d] in
/home/jpobst/Desktop/mfa-406/OpenGLES/OpenTK/Platform/Android/AndroidGameView.cs:104 



at
Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceCreated_Landroid_view_SurfaceHolder_ 


(IntPtr jnienv, IntPtr native__this, IntPtr native_holder) [0x00010]
in
/home/jpobst/Desktop/mfa-406/Mono.Android/platforms/android-8/src/generated/Android.Views.ISurfaceHolder.cs:157 



at (wrapper dynamic-method)
object:9a875116-8f83-4ee0-ad07-84a6b2459c27 (intptr,intptr,intptr)

___
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




___
Monodroid mailing list
Monodroid@lists.ximian.com

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


___
M