Re: [mono-android] Using the new async code in the 4.7 branch

2013-04-17 Thread Miljenko Cvjetko

Hi

On 2013.04.17 01:58, Paul Johnson wrote:

Hi,


Why don't You try
var getLoginTask = MyEvents.UserSignIn_Async(username, password);

and see returning type??


UserSignIn_Async returns void. The compiler moaned when I tried

var getLoginTask...

Hm..
Async functions with retrun type void or type return statements must not 
have expression

(from MS docs)
Now I wonder how is this interpreted/converted? Probably void, cos Your 
function returns void;

I guess

async Task UserSignIn_Async(string username, string password)
{
return;
}

while You have:

async void UserSignIn_Async(string username, string password)
{
return;
}

and this is reason why

var retval = = MyEvents.UserSignIn_Async(username, password);

moans, You cannot assign void to variable (never crossed-my-mind/tried).



AIUI, if you're firing an event and really don't care what happens (as 
in this case), then private async void is fine
Have You tried to change sig of the function (actually this is not sig 
in c# - return value is not

considered like in c++).


I'm not sure about the RunOnUiThread part. My understanding is that as 
the call is being made in an async method, it has to jump onto the UI 
thread for something to be displayed.
I think (even Miguel has stated yesterday) that async/await is about 
freeing us from thinking

about in which context we are and where we return (await completion).

... but I'm still on reading and looking under the hood...

I still try to grasp naming/nomenclature here [lightweight] threads, 
fibers, co-routines.

It is a great help and will make code robuster and eventually faster..
But what is behind the scenes? Thread created (System.Threading.Thread) 
or not?.


I guess more reading and channel9 watching

cheers

mel


Thanks

Paul




--
Miljenko Cvjetko dipl.ing. ET
Direktor/CEO
Projektant rješenja/Solution Architect  
Razvojni programer/Senior developer
Voditelj projekta/Project Manager

IX južna obala 13
Kajzerica Zagreb
T: 385 1 777
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvje...@holisticware.net
w: http://holisticware.net

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


[mono-android] EditText focus

2013-04-17 Thread laurar81
 how do to set focus on edittext after DispatchKeyEvent?

 public override bool DispatchKeyEvent(KeyEvent e)
{
if (this.CurrentFocus.Id == Resource.Id.codice_barre)
{
if (e.Action == KeyEventActions.Down && (e.KeyCode ==
Keycode.NumpadEnter || e.KeyCode == Keycode.Enter))
{
EditText barcode =
FindViewById(Resource.Id.codice_barre);
if (barcode != null)
{
InserisciRiga(barcode);

}
}
}
return base.DispatchKeyEvent(e);
}

After InserisciRiga the edittext loses focus.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/EditText-focus-tp5713166.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 to deploy mono for android app(.apk file) to android tablet

2013-04-17 Thread krish
hi,
m suffering from deployment problem...i tried one thing...i copied the
.apk signed
file(E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\bin\Debug) to sd
card of tablet and installed it ...it is installed on the tablet but giving
error
AllControls.AllControls has stopped unexpectedly (Force Close)...after that
i read some articles that debug mode apk wont install on the device
directlyafter that just i changed build mode to release and tried to
runit is giving again error...that is below screen shot
 



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/how-to-deploy-mono-for-android-app-apk-file-to-android-tablet-tp5713167.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] Linker Error in 4.7.4 beta when Referring to Mono.Android.Support.V4

2013-04-17 Thread Joshua Barker
I think the bug that was fixed in 4.6.3 is back in 4.7.4 beta. "Fixes a Linker 
error 
which occurrs when building a Release build of a project which references 
Mono.Android.Support.V4.dll."

This is the error.

Error  23   The "LinkAssemblies" task failed unexpectedly.
System.ArgumentOutOfRangeException: Specified argument was out of the range of 
valid values.
   at Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
   at Mono.Cecil.Mdb.MdbReader.ReadLocalVariables(MethodEntry entry, MethodBody 
body, Scope[] scopes)
   at Mono.Cecil.Mdb.MdbReader.Read(MethodBody body, InstructionMapper mapper)
   at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
   at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
   at Mono.Cecil.MethodDefinition.b__2(MethodDefinition method, 
MetadataReader reader)
   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
   at Mono.Cecil.MethodDefinition.get_Body()
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& 
context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at 
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at 
Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()   
   CatAndroid


STATEMENT OF CONFIDENTIALITY: The information in this message is privileged and 
confidential and is intended only for the use of the individual or entity named 
above. If the reader of this message is not the intended recipient, you are 
hereby notified that you are prohibited from disseminating, distributing, or 
copying the information contained in this message. If you have received this 
message in error, please notify the sender immediately and destroy all copies 
of the original message.
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


[mono-android] "java" exited with code 1

2013-04-17 Thread Chas Xu
Hi
I suddenly got the error when I build an Xamarin Droid project in VS2012.
The error is exactly like
http://www.blogosfera.co.uk/2013/03/why-is-my-monodroidxamarin-android-project-suddenly-giving-me-a-java-exited-with-code-1-errorI/

I ran VS 2012 update 2 this morning. I think it might cause the problem. So
I restored the system but still got this error.

Does anyone know what the problem is?

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

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


Re: [mono-android] "java" exited with code 1

2013-04-17 Thread Chas Xu
Sorry please ignore the email. The issue has been resolved by getting all
the code from the server again and overwrite all the existing ones...



On 17 April 2013 16:53, Chas Xu  wrote:

> Hi
> I suddenly got the error when I build an Xamarin Droid project in VS2012.
> The error is exactly like
> http://www.blogosfera.co.uk/2013/03/why-is-my-monodroidxamarin-android-project-suddenly-giving-me-a-java-exited-with-code-1-errorI/
>
> I ran VS 2012 update 2 this morning. I think it might cause the problem.
> So I restored the system but still got this error.
>
> Does anyone know what the problem is?
>
> Thanks
>
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Google map v2 CustomMapTileProvider

2013-04-17 Thread ukrandruha
Yes!!! Ido it!!
public class MyTileProvider : Java.Lang.Object, ITileProvider,
IJavaObject, IDisposable
{

public Tile GetTile(int x, int y, int zoom)
{
byte[] image = readTileImage(x, y, zoom);
return image == null ? null : new Tile(TILE_WIDTH, TILE_HEIGHT,
image);
}

private byte[] readTileImage(int x, int y, int zoom)
{

byte[] cachedBytes =
System.IO.File.ReadAllBytes(GetTileFilename(x, y, zoom));

return cachedBytes;

}

private string GetTileFilename(int x, int y, int zoom)
{
return ".png.tile";
   
}

}
}



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Google-map-v2-CustomMapTileProvider-tp5713162p5713172.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 deploy mono for android app(.apk file) to android tablet

2013-04-17 Thread baramuse
Debug .apk can of course be deployed on device, otherwise, how would you want
to debug on device ? :)
(of course you'll need to enable developper options in the tablet
preferences)

Can you provide with the build output? coud be useful to understand what's
happening.

Regards.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/how-to-deploy-mono-for-android-app-apk-file-to-android-tablet-tp5713167p5713173.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] Linker Error in 4.7.4 beta when Referring to Mono.Android.Support.V4

2013-04-17 Thread Jonathan Pryor
On Apr 17, 2013, at 10:57 AM, Joshua Barker  wrote:
> I think the bug that was fixed in 4.6.3 is back in 4.7.4 beta.

4.6.x branched from 4.7 long ago; 4.7 never got that fix in the first place. ;-)

We'll be fixing that error in a different way for 4.7; the 4.6 fix was "don't 
do that", i.e. "don't provide .mdb files in the .apk, ever", which is 
problematic in other circumstances. For 4.7 we'll be fixing Cecil to avoid that 
error in the first place, but this logic hasn't been fleshed out yet.

Sorry.

In the meantime...don't do Release builds on the beta against 
Mono.Android.Support*.dll. ;-)

- Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] how to deploy mono for android app(.apk file) to android tablet

2013-04-17 Thread krish

here i build and Deployed in Debug mode deployement is success in
emulator...here m not build it in release modejust build and deployed in
debug modenow i copied
MonoAddModifyDeleteView.MonoAddModifyDeleteView-Signed.apk file  which is in
E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\bin\Debug  into sd card
of MTS MTAG7 tablet...and i installed that apk file into tablet and it  is
installing successfully but when i open that app it is giving error 
MonoAddModifyDeleteView.MonoAddModifyDeleteView is stopped
unexpectedly...force close
here is build output(Debug menu->windows->Output)

-- Build started: Project: MonoAddModifyDeleteView, Configuration: Debug
Any CPU --
  MonoAddModifyDeleteView ->
E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\bin\Debug\MonoAddModifyDeleteView.dll
AAPT : warning : AndroidManifest.xml already defines debuggable (in
http://schemas.android.com/apk/res/android); using existing value in
manifest.
Packaging application..
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.225]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 18/Apr/2013 10:30:56 AM.
Project
"E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\MonoAddModifyDeleteView.csproj"
on node 1 (SignAndroidPackage target(s)).
_GenerateAndroidAssetsDir:
Skipping target "_GenerateAndroidAssetsDir" because it has no outputs.
_GenerateAndroidResourceDir:
  Copying file from "Resources\Layout\MonoAddModifyDeleteViewData.axml" to
"E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\obj\Debug\res\layout\monoaddmodifydeleteviewdata.xml".
  Copying file from "Resources\Layout\record_view.axml" to
"E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\obj\Debug\res\layout\record_view.xml".
  Copying file from "Resources\Layout\Main.axml" to
"E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\obj\Debug\res\layout\main.xml".
_ResolveMonoAndroidSdks:
  MonoAndroid Tools: C:\Program Files\MSBuild\Novell\
  MonoAndroid Framework: C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v2.2\;C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\
  MonoAndroid Binaries: C:\Program Files\MSBuild\Novell\
  Android SDK: C:\Documents and Settings\admin\Local Settings\Application
Data\Android\android-sdk\
  Java SDK: C:\Program Files\Java\jdk1.6.0_31\
_ValidateAndroidPackageProperties:
  GetAndroidPackageName Task
ManifestFile:
E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\Properties\AndroidManifest.xml
AssemblyName: MonoAddModifyDeleteView
PackageName: MonoAddModifyDeleteView.MonoAddModifyDeleteView
_ExtractLibraryProjectImports:
Assemblies: 
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Mono.Data.Sqlite.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll
Jars: 
ResolvedResourceDirectories: 
_CheckDuplicateJavaLibraries:
JavaSourceFiles:
JavaLibraries:
_UpdateAndroidResgen:
Skipping target "_UpdateAndroidResgen" because all output files are
up-to-date with respect to the input files.
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output
files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with
respect to the input files.
CopyFilesToOutputDirectory:
  MonoAddModifyDeleteView ->
E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\bin\Debug\MonoAddModifyDeleteView.dll
_ConvertDebuggingFiles:
Skipping target "_ConvertDebuggingFiles" because all output files are
up-to-date with respect to the input files.
_ResolveAssemblies:
  ResolveAssemblies Task
ReferenceAssembliesDirectory: C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v2.2\;C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\;;
I18nAssemblies: 
LinkMode: None
Assemblies:
  bin\Debug\MonoAddModifyDeleteView.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Mono.Data.Sqlite.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll
  C:\Program Files\Reference
Assemblies\Microsoft\Fra

Re: [mono-android] how to deploy mono for android app(.apk file) to android tablet

2013-04-17 Thread Jonathan Pryor
On Apr 17, 2013, at 9:21 AM, krish  wrote:
> hi,
>m suffering from deployment problem...i tried one thing...i copied the 
> .apk signed 
> file(E:\MonoAddModifyDeleteView\MonoAddModifyDeleteView\bin\Debug) to sd card 
> of tablet and installed it ...it is installed on the tablet but giving error 
> AllControls.AllControls has stopped unexpectedly (Force Close)...

That won't work, because Debug builds are not "stand-alone"; they have other 
dependencies which the IDE should be installing for you.

The question is, why isn't the IDE able to install the app?

Please enable device deployment logging:


http://docs.xamarin.com/guides/android/deployment,_testing,_and_metrics/diagnostics#Device_Deployment_Logs

You may need to restart Visual Studio after enabling the deployment logging. 
This will write a `monodroid.log` file to your Desktop. Please provide the 
`monodroid.log` file.

You may also need to provide your devices `adb logcat` output:


http://docs.xamarin.com/guides/android/deployment%2C_testing%2C_and_metrics/android_debug_log

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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