Re: [mono-android] Layout - Activity with ListView and TextView below it

2012-01-25 Thread James Lavery
Hi Andreas,
Thanks for the tip - yes this looks a lot cleaner and I agree about 'less
being more'.

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Layout-Activity-with-ListView-and-TextView-below-it-tp5149952p5429728.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 binding Sybase SQL Anywhere UltraLiteJNI12.jar

2012-05-14 Thread James Lavery
Hi all,
We need to use a Sybase Ultralite database in our Mono for Android app (it's
a port of an existing application, synchronising with a Sybase server
database).

I'm not aware of an existing Mono binding, so I'm setting off on the task of
creating a binding library using the new project type in 4.2.

So... I've added UltraliteJNI12.jar, set its  build action to InputJar, and
clicked 'build'.

I get an error:
/Com.Ianywhere.Ultralitejni12.Implementation.JniDbMgr' already defines a
member called 'Release' with the same parameter types/

and yes, when I look at the generated source, there are two identical
/Release/ members declared.

Is there a way of working round this? I've read the tutorial and can't see
anything there which points to a solution.

Thanks, and apologies for what may be a stupid question - I'm just starting
out on this!

James
 

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Problem-binding-Sybase-SQL-Anywhere-UltraLiteJNI12-jar-tp5708444.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 binding Sybase SQL Anywhere UltraLiteJNI12.jar

2012-05-15 Thread James Lavery
Hi Jon,
Thanks - renaming worked. I think I may want to remove it in fact - I'll try
that too.


Jonathan Pryor-2 wrote
> 
> If you need the package, you may want to rename one of the members by
> adding the "managedName" attribute:
> 
>  
> path="/api/package[@name='com.ianywhere.ultralitejni12.implementation']/class[@name='JniDbMgr']/method[@name='release'
> and return='TODO]"
>   name="managedName">Release2
> 


--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Problem-binding-Sybase-SQL-Anywhere-UltraLiteJNI12-jar-tp5708444p5709734.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] 4.2.1 - "Could not find file" ...bin\debug on deploy

2012-05-17 Thread James Lavery
I've got a strange error on deploying a newly-constructed solution and
initial test application.

The solution builds OK, and gets a long way down deployment, before I get a
dialog box saying:
/There was an error building and deploying your application, see exception
for more details./

Clicking the 'details' link gives a futher dialog box with a full stack
trace (which I'll list below) but the top line is:
/System.IO.FileNotFoundException: Could not find file
'C:\p4\AutoForms\Universal\Mobile\Droid\Universal.Mobile.Droid\DAO\Ultralite\bin\Debug\'./

The strange thing is the above directory exists, and has the files I'd
expect in it. I've checked the permissions on the directory, and they look
fine.

I've successfully built and deployed applications with all the components of
this solution before.

Anyone seen this or got some ideas?

Thanks,

James

Full error message:
/System.IO.FileNotFoundException: Could not find file
'C:\p4\AutoForms\Universal\Mobile\Droid\Universal.Mobile.Droid\DAO\Ultralite\bin\Debug\'.

File name:
'C:\p4\AutoForms\Universal\Mobile\Droid\Universal.Mobile.Droid\DAO\Ultralite\bin\Debug\'

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

   at System.IO.FileInfo.get_Length()

   at Mono.AndroidTools.Adb.AdbSyncFile..ctor(FileInfo sourceFile, String
remoteName, AdbSyncAction action)

   at Mono.AndroidTools.Adb.AdbSyncFile..ctor(String sourceFile, String
remoteName, AdbSyncAction action)

   at
Xamarin.AndroidTools.AndroidDeploySession.b__0(String a)

   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()

   at Mono.AndroidTools.Adb.AdbSyncDirectory.AddRange(IEnumerable`1 entries)

   at Xamarin.AndroidTools.AndroidDeploySession.InstallAssemblies(List`1
assemblies, String destinationPath, CancellationToken token)

   at Xamarin.AndroidTools.AndroidDeploySession.FastDev()

   at Xamarin.AndroidTools.AndroidDeploySession.Start(CancellationToken
token)

   at
Mono.Android.VisualStudio.MonoAndroidDeploySession.DeployApplication(AndroidDevice
device, CancellationToken token)

   at Mono.Android.VisualStudio.MonoAndroidDeploySession.OnDeploy()/

Final lines of output on build:
/Waiting for device..
Removing any previous version..
Copying application to device...
Getting installation path...
== Build: 6 succeeded or up-to-date, 0 failed, 0 skipped ==
== Deploy: 0 succeeded, 1 failed, 0 skipped ==/
Note that the error occurs at the /Getting installation path.../ stage.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/4-2-1-Could-not-find-file-bin-debug-on-deploy-tp5709844.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] 4.2.1 - "Could not find file" ...bin\debug on deploy

2012-05-17 Thread James Lavery
I think I've found the source of my problem.

I have references to other projects in my solution which are not targetting
.NET Framework 2.0. Changing them to target .NET Framework 2.0 solves the
problem.

This raises the (probably simple) question - what is the highest .NET
Framework which can be targeted by an assembly referred to in a Mono For
Android application? It looks to me like it's .NET Framework 2.0.

Does this mean that we can't use any features of .NET Framework which are
available in a later .NET Framework version in a Mono For Android
application?



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/4-2-1-Could-not-find-file-bin-debug-on-deploy-tp5709844p5709856.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] 4.2.1 - "Could not find file" ...bin\debug on deploy

2012-05-18 Thread James Lavery
Ah the penny has finally dropped!

My referenced projects were ordinary .NET projects, not Mono For Android
projects. That was my mistake.

I've changed all projects to Mono For Android, and all is working fine.

Apologies for being thick and wasting your time.

Next thick question - what's PLP?



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/4-2-1-Could-not-find-file-bin-debug-on-deploy-tp5709844p5709896.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] TinyIoC and Linking on release build

2012-07-06 Thread James Lavery
Hi All,
I'm doing my first Release build, and am having problems with TinyIoC and
resolving interfaces used via TinyIoC.

The architecture we've got is:
Solution
  Universal.Mobile.Droid.application - main application
  Universal.Mobile.Droid.Interfaces - contains definition of
IUniversalMobileDroidDAO
  Universal.Mobile.Droid.DAO.UltraliteDAO - contains implementation of
IUniversalMobileDroidDAO

When I do a release build and deploy/run on my device, I get the error:
07-06 10:30:23.706 I/dalvikvm( 4783): Turning on JNI app bug workarounds for
target SDK version 12...
07-06 10:30:23.816 I/ActivityThread( 4783): Pub
UniversalMonoPhone.UniversalMonoPhone.__mono_init__:
mono.MonoRuntimeProvider
07-06 10:30:23.816 D/dalvikvm( 4783): Trying to load lib
/data/data/UniversalMonoPhone.UniversalMonoPhone/lib/libmonodroid.so
0x4104d468
07-06 10:30:23.846 D/dalvikvm( 4783): Added shared lib
/data/data/UniversalMonoPhone.UniversalMonoPhone/lib/libmonodroid.so
0x4104d468
07-06 10:30:23.846 W/MonoDroid-Debugger( 4783): Trying to initialize the
debugger with options:
--debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8977,server=y,embedding=1
07-06 10:30:23.866 W/MonoDroid-Debugger( 4783): Accepted stdout connection:
41
07-06 10:30:24.656 E/mono( 4783): WARNING: The runtime version supported
by this application is unavailable.
07-06 10:30:24.656 E/mono( 4783): Using default runtime: v2.0.50727
07-06 10:30:25.126 I/monodroid-gc( 4783): environment supports jni
NewWeakGlobalRef
07-06 10:30:25.166 W/monodroid-gc( 4783): GREF GC Threshold: 46800
Loaded assembly: Universal Mono Phone.dll
Loaded assembly: Universal.Mobile.Droid.Interfaces.dll
Loaded assembly: Autoforms.Universal.Mobile.Core.Interfaces.Droid.dll
Loaded assembly: Autoforms.Universal.Mobile.Core.Objects.Droid.dll
Loaded assembly: Universal.Mobile.Droid.DAO.UltraliteDAO.dll
Loaded assembly: UltraliteForMono.dll
Loaded assembly: Mono.Android.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: MonoDroidConstructors [External]
Unhandled Exception:

TinyIoC.TinyIoCResolutionException: Unable to resolve type:
Autoforms.Universal.Mobile.Droid.Interfaces.IUniversalMobileDroidDAO


Do I need to tweak my build/linker/manifest to solve this?

Regards,

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/TinyIoC-and-Linking-on-release-build-tp5710753.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] TinyIoC and Linking on release build

2012-07-06 Thread James Lavery
Hi Atsushi,
Thanks - that solved it.

I was misreading the meaning of /linking/. I thought 'linking' meant the
assemblies to /link/. 

Am I right in understanding that what it actually means is the assemblies to
/remove/ if not needed?

Regards,

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/TinyIoC-and-Linking-on-release-build-tp5710753p5710755.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] only calling code in spinner.ItemSelected handler from user input

2012-08-06 Thread James Lavery
Hi All,
I've got a spinner with the following handler:


This works fine when I start off with the 1st item selected (this has an ID
of -1) - i.e. when first displaying the layout.

However, I need to be able to set the spinner's position according to the
Task object's previously selected answer, as part of initialisation of the
Activity. When I do this, the ItemSelected event is fired, and
RaiseFaultIntent is called.

Is there a way of telling in the handler whether the event is being fired
due to user interaction, rather than by initialisation code? 

Thanks,

James



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/only-calling-code-in-spinner-ItemSelected-handler-from-user-input-tp5711197.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] only calling code in spinner.ItemSelected handler from user input

2012-08-08 Thread James Lavery
I found a workaround (thanks to a colleague).

I've got a boolean which is set the first time the spinner itemSelected
event is fired - which will be when the initialisation code is running.

After this has been set, I then call the code inside the event.

Works like a charm.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/only-calling-code-in-spinner-ItemSelected-handler-from-user-input-tp5711197p5711224.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] Object Reference not set... after GC_EXPLICIT on bound object

2012-08-24 Thread James Lavery
Hi all,
I've created a Java Bindings Library, which binds the Sybase Ultralite
Android library so that I can use it in Mono For Android.

This is up and running and has been working well - until now!

What we've found is that as soon as a GC_EXPLICIT is triggered, we're
getting "Object reference not set to an instance of an object" errors and
the system crashes.

The device log shows the following at the same time:


The code for ResultSetConnection.Close is:


and the error is occurring on the /ResultSet.Close()/ call.

/ResultSet/ is an IResultSet as returned from the bound Ultralite library.

As far as I know, I'm cleaning up the ResultSet/PreparedStatement/Connection
in the correct order. 

I've done some reading of the 
http://docs.xamarin.com/android/advanced_topics/garbage_collection
documentation on garbage collection ,  and it's my understanding that the
/ResultSet/ object is a Peer object. 

Is there something I can do - with my binding metadata or C# code - to sort
this out?

Regards,

James



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Object-Reference-not-set-after-GC-EXPLICIT-on-bound-object-tp5711532.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] Object Reference not set... after GC_EXPLICIT on bound object

2012-08-24 Thread James Lavery
Jonathan,
Thanks for the reply. 

Yes, I mention GC_EXPLICIT and then don't show it. Stupid me - copied one
line too low in the output. Here it is properly:


ResultSetConnection does /not/ subclass Java.Lang.Object. It is a plain C#
object. ResultSet, PreparedStatement and Connection are supplied by the
bound library and therefore - I presume /do/ subclass Java.Lang.Object.

Yes, ResultSetConnection does have a finalizer (I presume you mean
destructor):


So my understanding (from your explanation) is that I don't (in fact
can't/shouldn't) override Java.Lang.Object.Dispose().

So there's definitely more I'm missing!

Regards,

James



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Object-Reference-not-set-after-GC-EXPLICIT-on-bound-object-tp5711532p5711537.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] Object Reference not set... after GC_EXPLICIT on bound object

2012-08-24 Thread James Lavery
Jon,
Yes - the problem was the fact that I was using a Finalizer when I didn't
need to at all.

All I needed to do was call ResultSetConnection.Close() in a finally {}
block, and for Close() to just call ResultSet.Close(),
PreparedStatement.Close() and Connection.Release() with no explicit
Dispose() calls.

Having done this, all is working.


James



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Object-Reference-not-set-after-GC-EXPLICIT-on-bound-object-tp5711532p5711542.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 binding Sybase SQL Anywhere UltraLiteJNI12.jar

2012-11-26 Thread James Lavery
In case others are interested in binding the Ultralite library, I got this
working - full details are documented in an article I've written on it  here
  .



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Problem-binding-Sybase-SQL-Anywhere-UltraLiteJNI12-jar-tp5708444p5712496.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] Layout - Activity with ListView and TextView below it

2012-01-16 Thread James Lavery
Hi,
I'm getting to grips with the layout system in Android, and am probably just
being thick here...

What I want is to have a ListView which displays a scrolling list of data
retrieved from my service, with a TextView below it to show a 'please
wait...' message when retrieving data (as in the 'Writing Responsive
Applications' tutorial).

However, I'm really struggling with getting the right layout so that it
shows the TextView at the bottom of the screen, with the ListView filling
all the remaining space. 

Can someone please point me in the right direction?

Thanks a lot,

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Layout-Activity-with-ListView-and-TextView-below-it-tp5149952p5149952.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] Layout - Activity with ListView and TextView below it

2012-01-16 Thread James Lavery
Hi Ben,
Thanks - that positions them correctly relative to each other, but are there
width/height (well, specifically height) attributes which I can use to make
the ListView fill the space left by the TextView, or do I have to specify
the height specifically, in px, to do this?

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Layout-Activity-with-ListView-and-TextView-below-it-tp5149952p5150113.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] Layout - Activity with ListView and TextView below it

2012-01-17 Thread James Lavery
Hi Ben,
Thanks a lot - that's what I needed to know, that I need to code for each
layout/density.

Other layout systems have attributes which allow one to specify that an item
should fill remaining space, and I thought Android would have this. No
problem!

Thanks for your help.

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Layout-Activity-with-ListView-and-TextView-below-it-tp5149952p5151155.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] Layout - Activity with ListView and TextView below it

2012-01-17 Thread James Lavery
Hi Chris,
Thanks a lot - I'd looked at gravity, and it looked like what I might want
but I wasn't sure. I'll look further into it!

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Re-Layout-Activity-with-ListView-and-TextView-below-it-tp5152064p5153230.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] Layout - Activity with ListView and TextView below it

2012-01-17 Thread James Lavery
Thanks - that's exactly what I wanted!

I'd tried /almost/ exactly what you've posted. The crucial parameter was
/layout_weight/ which is what I was missing.

James

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Layout-Activity-with-ListView-and-TextView-below-it-tp5149952p5153248.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