Re: [mono-android] The GenerateJavaStubs task failed unexpectedly.

2012-06-11 Thread Terry151151
My problem was that the Javascript interface was is in a library, and so was
the reference to Mono.Android.Export. As soon as I put the reference to
Mono.Android.Export into the main program the problem disappeared.

I also have another question related to the Javascript interface. Can the
interface return values back to the Javascript? I only need strings, bools
and ints. I cannot find any examples of returning values.

Regards
Terry

 

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/The-GenerateJavaStubs-task-failed-unexpectedly-tp5710209p5710275.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 deploying 4.2.2

2012-06-11 Thread John Murray
I've upgraded to 4.2.2 despite the  aversion caused by the VS2010 crashes in
v 4.2.1 and am now using mD 3.02

 

All works as expected except when I try to debug on the test machine - an
xperia arc s running 2.3.5

 

I get

pkg: /sdcard/tmp/com.murray.Agar14-Signed.apk

Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

What do I do next? Which updae is incompatible with what ?

I haven't changed the test machine and the project is still set to be 2.1
compatible

Its only happened since 4.2.2 installed 

 

Do I have to once again revert to version 4.00? or is there another solution


 

JM

 

 

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


[mono-android] Passing callback functions from Javascript to Mono

2012-06-11 Thread Terry151151
I have a JQuery script that calls a Javascript interface and I would like to
pass two callback functions to Mono. When the C# function get called from
the WebView the two functions are null. Any idea how to pass the callback
functions?


Simplified Code:


JQuery:

$(document).ready( function()
{
var OkBtn = $( '#OkBtn' );

var DisableOk = function()
{
OkBtn.attr( 'disabled', true );
};

var EnableOk = function()
{
OkBtn.attr( 'disabled', false );
};

var HttpAddress = $( '#HttpAddress' );

HttpAddress.click(function (e)
{
window.Device.HttpCheck( HttpAddress.val(), EnableOk, DisableOk );
});

---
C#
public class JavaScriptInterface : Java.Lang.Object
{
[Export]
public Java.Lang.Boolean HttpCheck( Java.Lang.String _url,
Java.Lang.Runnable OnSuccess, Java.Lang.Runnable OnFail )
{
bool Result = false;
Java.Lang.Boolean Retval;

try
{
string url = _url.ToString();

if( Url.IsValidUrl( url ) )
{
OnSuccess.Run(); // OnSuccess 
is null
Result = true;
}
else
{
OnFail.Run();  // OnFail is 
null
Result = false;
}
}
finally
{
Retval = new Java.Lang.Boolean( Result );
}
return Retval;
}
   }


Thanks in advance
Terry


--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Passing-callback-functions-from-Javascript-to-Mono-tp5710278.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] Passing callback functions from Javascript to Mono

2012-06-11 Thread Jonathan Pryor
On Jun 11, 2012, at 9:36 AM, Terry151151 wrote:
> I have a JQuery script that calls a Javascript interface and I would like to 
> pass two callback functions to Mono. When the C# function get called from the 
> WebView the two functions are null. Any idea how to pass the callback 
> functions?

I believe the answer is "you don't." Unfortunately, Android's documentation 
regarding what parameter types are allowed across the JavaScript/Java interface 
are...non-existant (that I could find), but some searching found:

http://stackoverflow.com/a/9522528/83444

https://groups.google.com/group/android-developers/browse_thread/thread/fbc0553efd96c0ff

It looks like you can only pass Strings and primitives from JavaScript to Java. 
Functions, collections, etc. are out.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] problem deploying 4.2.2

2012-06-11 Thread Jonathan Pryor
On Jun 11, 2012, at 4:58 AM, John Murray wrote:
> All works as expected except when I try to debug on the test machine – an 
> xperia arc s running 2.3.5
>  
> I get
> pkg: /sdcard/tmp/com.murray.Agar14-Signed.apk
> Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

It looks like you get INSTALL_FAILED_UPDATE_INCOMPATIBLE if you have e.g. App 
v1 (signed with Key K1) installed on the device, and then you try to install 
App v2 (signed with Key K2) onto the device:


https://groups.google.com/group/android-developers/browse_thread/thread/3f084d78a15f6d3d/f35b31af3cf44903

Remove the app before trying to install it:

# is the app still installed?
$ adb shell pm list packages | grep -i YourAppPackageName
# If so...
$ adb uninstall YourAppPackageName

Then re-deploy from the IDE.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] debugger constantly detaches

2012-06-11 Thread Jonathan Pryor
On Jun 10, 2012, at 10:00 AM, l0nestar wrote:
> I intermittently get this error when the debugger detaches.
> 
> http://mono-for-android.1047100.n5.nabble.com/file/n5710267/monodebugexception.png

Could you try using the 4.2.3 beta release? That has a number of fixes in the 
VS addin.

> I was also wondering if it is possible that the android OS is shutting my app 
> down for misbehaving?

Yes, that's always possible, but the Debug log will usually contain verbose 
information when it does so. In this case, there is no such information about 
Android killing your process, so I don't think it's Android; there's something 
wrong within the process.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] problem deploying 4.2.2

2012-06-11 Thread John Murray
Tx Jonathan 
I'll try that 
- enjoy your beer in San Francisco 

-Original Message-
From: Jonathan Pryor [mailto:j...@xamarin.com] 
Sent: 11 June 2012 16:27
To: j...@murray.gb.com; Discussions related to Mono for Android
Subject: Re: [mono-android] problem deploying 4.2.2

On Jun 11, 2012, at 4:58 AM, John Murray wrote:
> All works as expected except when I try to debug on the test machine - an
xperia arc s running 2.3.5
>  
> I get
> pkg: /sdcard/tmp/com.murray.Agar14-Signed.apk
> Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

It looks like you get INSTALL_FAILED_UPDATE_INCOMPATIBLE if you have e.g.
App v1 (signed with Key K1) installed on the device, and then you try to
install App v2 (signed with Key K2) onto the device:


https://groups.google.com/group/android-developers/browse_thread/thread/3f08
4d78a15f6d3d/f35b31af3cf44903

Remove the app before trying to install it:

# is the app still installed?
$ adb shell pm list packages | grep -i YourAppPackageName
# If so...
$ adb uninstall YourAppPackageName

Then re-deploy from the IDE.

 - Jon


___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] debugger constantly detaches

2012-06-11 Thread Sayed Arian Kooshesh
someone, somewhere used a generic try catch handler

On Sat, Jun 9, 2012 at 6:09 PM, l0nestar  wrote:
> Ok - i can believe that ;-)
>
> ...but I don't see anything that states this is explicitly? why would I not
> get an out of memory (or equivalent) message in logcat or some other
> indication?
>
> --
> View this message in context: 
> http://mono-for-android.1047100.n5.nabble.com/debugger-constantly-detaches-tp5710262p5710264.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



-- 
Extreme Knowledge is not something for which he programs a computer
but for which his computer is programming him.

-Wozniak
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


[mono-android] Tow mapviews

2012-06-11 Thread Sloot
Hello,

I'm working on an Monodroid app which uses two mapviews. The first mapview
is for showing all kind of POI's and Polygons (water) and the second Mapview
is used for inserting a new POI by clicking on the that Mapview. My problem
is (and it's a known problem for Android) that the Mapviews behave strange.
The solution which I've found is to open the second screen (with the second
Mapview) in a new process. Can anybode tell me how this has to be done in
Monodroid?



When I fill in the AndroidManifest it doesn't work out:
 
...and also [Activity(Label = "ActivityPOINew", Theme =
"@style/CustomTheme", Process = "nl.test.p2", NoHistory = true,
ScreenOrientation = ScreenOrientation.Portrait)] is not resulting...

Can anybody help me further?

Kindly regards,
Wouter Slotegraaf
 

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Tow-mapviews-tp5710266.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] mono DataAdapter it error?

2012-06-11 Thread mcxxx
I could not understand why a process fails while installing the DataTable I'm
doing wrong


Mono.Data.Sqlite.SqliteDataAdapter da=new 
 SqliteDataAdapter("select * from custome",con);
System.Data.DataTable dt=new DataTable();
dt.BeginLoadData();
da.Fill(dt);//Error
dt.EndLoadData();




System.EntryPointNotFoundException: sqlite3_column_origin_name at (wrapper
managed-to-native)
Mono.Data.Sqlite.UnsafeNativeMethods.sqlite3_column_origin_name (intptr,int)

at Mono.Data.Sqlite.SQLite3.ColumnOriginalName
(Mono.Data.Sqlite.SqliteStatement,int) [0x0] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs:503

at Mono.Data.Sqlite.SqliteDataReader.GetSchemaTable (bool,bool) [0x0042d] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs:625

at Mono.Data.Sqlite.SqliteDataReader.GetSchemaTable () [0x0] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs:556

at System.Data.Common.DataAdapter.BuildSchema
(System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType,System.Data.MissingSchemaAction,System.Data.MissingMappingAction,System.Data.Common.DataTableMappingCollection)
[0x0003b] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/System.Data/System.Data.Common/DataAdapter.cs:284

at System.Data.Common.DataAdapter.BuildSchema
(System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType)
[0x0] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/System.Data/System.Data.Common/DataAdapter.cs:257

at System.Data.Common.DataAdapter.FillTable
(System.Data.DataTable,System.Data.IDataReader,int,int,int&) [0x00011] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/System.Data/System.Data.Common/DataAdapter.cs:428

at System.Data.Common.DataAdapter.FillInternal
(System.Data.DataTable,System.Data.IDataReader) [0x00030] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/System.Data/System.Data.Common/DataAdapter.cs:242

at System.Data.Common.DataAdapter.Fill
(System.Data.DataTable,System.Data.IDataReader) [0x0] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/System.Data/System.Data.Common/DataAdapter.cs:558

at System.Data.Common.DbDataAdapter.Fill
(System.Data.DataTable,System.Data.IDbCommand,System.Data.CommandBehavior)
[0x00022] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs:297

at System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable) [0x00011]
in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs:273

at (wrapper remoting-invoke-with-check)
System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable)

at WolvoxMobilSatis.Ac_Cari_Hareket_RPT.OnActivityResult
(int,Android.App.Result,Android.Content.Intent)

at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_
(intptr,intptr,int,int,intptr) [0x00013] in
/Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.App.Activity.cs:1240

at (wrapper dynamic-method) object.1ed57c2b-1aca-452e-9063-ff5da31952b8
(intptr,intptr,int,int,intptr)

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/mono-DataAdapter-it-error-tp5710277.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 deploying 4.2.2

2012-06-11 Thread Sayed Arian Kooshesh
jon, in general, with monodroid and all programming, you should take
care how many object you allocated and how many you stuff in to views.

You should also never use httputility as the static constructor causes
a whole meg of memory to vainsh. Only crap programmers use it anyway,
(like dimitris, we'll leave his last name out of it but he's greek and
has written the worst code I have ever seen. I left the project and am
waiting for it to hit the market so I can show them what happens when
you don't listen to a good programmer)

On Mon, Jun 11, 2012 at 10:26 AM, Jonathan Pryor  wrote:
> On Jun 11, 2012, at 4:58 AM, John Murray wrote:
>> All works as expected except when I try to debug on the test machine – an 
>> xperia arc s running 2.3.5
>>
>> I get
>>                 pkg: /sdcard/tmp/com.murray.Agar14-Signed.apk
>> Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
>
> It looks like you get INSTALL_FAILED_UPDATE_INCOMPATIBLE if you have e.g. App 
> v1 (signed with Key K1) installed on the device, and then you try to install 
> App v2 (signed with Key K2) onto the device:
>
>        
> https://groups.google.com/group/android-developers/browse_thread/thread/3f084d78a15f6d3d/f35b31af3cf44903
>
> Remove the app before trying to install it:
>
>        # is the app still installed?
>        $ adb shell pm list packages | grep -i YourAppPackageName
>        # If so...
>        $ adb uninstall YourAppPackageName
>
> Then re-deploy from the IDE.
>
>  - Jon
>
> ___
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid



-- 
Extreme Knowledge is not something for which he programs a computer
but for which his computer is programming him.

-Wozniak
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] problem deploying 4.2.2

2012-06-11 Thread Jonathan Pryor
On Jun 11, 2012, at 1:00 PM, Sayed Arian Kooshesh wrote:
> You should also never use httputility as the static constructor causes a 
> whole meg of memory to vainsh.

How pray-tell did you come to this conclusion? My (really stupid) test shows 
that it only uses 26k:

protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
GC.Collect ();
var start = GC.GetTotalMemory (false);
Console.WriteLine ("Start memory: {0}", start);
Foo ();
GC.Collect ();
var end = GC.GetTotalMemory (false);
Console.WriteLine ("End memory: {0}; diff={1}", end, 
(end-start).ToString ());
}

static void Foo ()
{
var ignore = new System.Web.HttpUtility ();
}

The memory diff is 26520, which is a far cry from 1MB...

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] mono DataAdapter it error?

2012-06-11 Thread Jonathan Pryor
On Jun 11, 2012, at 7:36 AM, mcxxx wrote:
> I could not understand why a process fails while installing the DataTable I'm 
> doing wrong

Sorry, bug:

https://bugzilla.xamarin.com/show_bug.cgi?id=2128

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Tow mapviews

2012-06-11 Thread Jonathan Pryor
On Jun 10, 2012, at 7:41 AM, Sloot wrote:
> My problem is (and it's a known problem for Android) that the Mapviews behave 
> strange. The solution which I've found is to open the second screen (with the 
> second
> Mapview) in a new process. Can anybode tell me how this has to be done in 
> Monodroid?

Firstly, use the [Activity] custom attribute. Hand-writing the  
element is a good way to screw things up.

Secondly, there's a bug when specifying ActivityAttribute.Process that you need 
to work around:

https://bugzilla.xamarin.com/show_bug.cgi?id=763#c4

Sorry,
 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Passing callback functions from Javascript to Mono

2012-06-11 Thread Terry151151
This appears to be true. After playing around the only things I could pass
were primitive data types.

Thanks 
Terry.




--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Passing-callback-functions-from-Javascript-to-Mono-tp5710278p5710288.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] Does anybody know a way to type and validate at the same time in a WebView

2012-06-11 Thread Terry151151
I need to be able to type and validate at the same time in a WebView. The
typing accesses either a local Sqlite cache or and online database if
available.

I can't use loadUrl as it always hides the soft keyboard on every key
stroke.
I also can't use a Javascript interface as it can't take callbacks to the
Javascript ( only takes primitive data types ).

I'm now having to look at a really messy solution to solve the problem.
ie.  Place a request through the Javascript interface and then setup a
polling timer in Javascript and check the result back through the Javascript
interface. Unfortunately I'll have to set up timers for every input field
that needs to go back to the database, and also find some way to interlock
similar requests on diferent input fields (Yuck).

Does anybody know of another way to do this?

Thanks in advance.
Terry.




--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Does-anybody-know-a-way-to-type-and-validate-at-the-same-time-in-a-WebView-tp5710289.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