Re: [mono-android] AutoCompleteTextView

2013-05-01 Thread gspro
Thanks, I'll try that. It looks like I'd need to retrieve the entire list
ahead of time, and auto complete would filter based on that? Is there a way
that I could call the web service when the threshold number of characters is
met? I'd rather pull down a subset of data from the service than the entire
contact list for a given company.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/AutoCompleteTextView-tp5713249p5713251.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] AutoCompleteTextView

2013-05-01 Thread Stuart Lodge
I have done this with the Google Books api

I made a sample for Mvx - it's not currently live on v3 but you can see it
on v2 at
https://github.com/slodge/MvvmCross/tree/vnext/Sample%20-%20SimpleDialogBinding/DroidAutoComplete

Here's what i wrote at the time -
http://slodge.blogspot.co.uk/2012/05/monodroid-mvvmcross-experiment-in.html-
hope it makes sense as I can't remember how it works!

It was pretty fiddly to get going - the autocomplete control itself wasn't
that pleasant to use (IMO)

Stuart



On 1 May 2013 12:53, gspro  wrote:

> Thanks, I'll try that. It looks like I'd need to retrieve the entire list
> ahead of time, and auto complete would filter based on that? Is there a way
> that I could call the web service when the threshold number of characters
> is
> met? I'd rather pull down a subset of data from the service than the entire
> contact list for a given company.
>
>
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/AutoCompleteTextView-tp5713249p5713251.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] AutoCompleteTextView

2013-05-01 Thread Spencer
I guess you could also try using the Threshold property to set the number of
characters that need to be input before the auto complete kicks in, in
conjunction with a key listener to determine when the threshold is met, so
you can call your webservice in a new thread.  

You might run into threading issues though if the user inputs characters up
to the threshold, then backspaces and enter something different.



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/AutoCompleteTextView-tp5713249p5713253.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] "Take a Picture and Save Using Camera App" example fails with Java.Lang.OutOfMemoryError

2013-05-01 Thread Igor Velikorossov
I've read the "Take a Picture and Save Using Camera App" example and
downloaded provided sample (
http://docs.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app
).

However it looks the sample is either too inefficient or there is a mono's
issue - just after one picture grab it grows heap by 30M and almost
exhausts available memory on Samsung Galaxy S2. Attempting showing a 2nd
picture crashes and burns the app with Java.Lang.OutOfMemoryError.
I find it especially curious given that the size of the picture taken is
mere 2-3M in size.

Here's the application output:

*GREF GC Threshold: 46800*
*Grow heap (frag case) to 10.842MB for 441776-byte allocation*
*Grow heap (frag case) to 11.791MB for 995296-byte allocationLoaded
assembly: MonoDroidConstructors [External]*
*Loaded assembly: System.Xml.dll [External]*
*
*
*showStatusIcon on inactive InputConnection*
*Grow heap (frag case) to 42.020MB for 31961104-byte allocation  <---
1st picture is taken and saved. The pic is loaded into the ImageView*
*showStatusIcon on inactive InputConnection*
*Forcing collection of SoftReferences for 31961104-byte allocation*
*Out of memory on a 31961104-byte allocation.
 **<--- attempting to take 2nd picture... BOOM!*
*--- decoder->decode returned false*
*UNHANDLED EXCEPTION: Java.Lang.OutOfMemoryError: Exception of type
'Java.Lang.OutOfMemoryError' was thrown.*
*at Android.Runtime.JNIEnv.CallStaticObjectMethod
(intptr,intptr,Android.Runtime.JValue[]) [0x00024] in
/Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:767
*
*at Android.Provider.MediaStore/Images/Media.GetBitmap
(Android.Content.ContentResolver,Android.Net.Uri) [0x0002d] in
/Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Provider.MediaStore.cs:1694
*
*at CameraAppDemo.Activity1.OnActivityResult
(int,Android.App.Result,Android.Content.Intent) [0x0003e] in
d:\Development\CameraAppDemo\CameraAppDemo\Activity1.cs:62*
*at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_
(intptr,intptr,int,int,intptr) [0x00013] in
/Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.App.Activity.cs:1240
*
*at (wrapper dynamic-method) object.902354c1-f8ff-470e-bc76-1c59e3cbf94e
(intptr,intptr,int,int,intptr) *
*
*
*  --- End of managed exception stack trace ---*
*java.lang.OutOfMemoryError*
* at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)*
* at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:652)*
* at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:724)*
* at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:790)
*
* at cameraappdemo.Activity1.n_onActivityResult(Native Method)*
* at cameraappdemo.Activity1.onActivityResult(Activity1.java:37)*
* at android.app.Activity.dispatchActivityResult(Activity.java:5390)*
* at android.app.ActivityThread.deliverResults(ActivityThread.java:3201)*
* at android.app.ActivityThread.handleSendResult(ActivityThread.java:3248)*
* at android.app.ActivityThread.access$1200(ActivityThread.java:140)*
* at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285)*
* at android.os.Handler.dispatchMessage(Handler.java:99)*
* at android.os.Looper.loop(Looper.java:137)*
* at android.app.ActivityThread.main(ActivityThread.java:4921)*
* at java.lang.reflect.Method.invokeNative(Native Method)*
* at java.lang.reflect.Method.invoke(Method.java:511)*
* at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
*
* at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)*
* at dalvik.system.NativeStart.main(Native Method)*
*Stacktrace:*
*
*
*  at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr) [0x0] in
/Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:129
*
*  at Java.Lang.Throwable.get_Message () [0x0003e] in
/Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Java.Lang.Throwable.cs:195
*
*  at (wrapper runtime-invoke) .runtime_invoke_object__this__
(object,intptr,intptr,intptr) *



Is it due to sloppiness of the sample code? And if so, how can it be
improved to withstand several picture takes and do so in memory efficient
manner?


Thank you, Igor
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] "Take a Picture and Save Using Camera App" example fails with Java.Lang.OutOfMemoryError

2013-05-01 Thread Jonathan Pryor
On May 1, 2013, at 10:04 AM, Igor Velikorossov  wrote:
> I've read the "Take a Picture and Save Using Camera App" example and 
> downloaded provided sample 
> (http://docs.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app).

Thank you for mentioning this. We will update the recipe accordingly.

> However it looks the sample is either too inefficient or there is a mono's 
> issue - just after one picture grab it grows heap by 30M and almost exhausts 
> available memory on Samsung Galaxy S2. Attempting showing a 2nd picture 
> crashes and burns the app with Java.Lang.OutOfMemoryError.
> I find it especially curious given that the size of the picture taken is mere 
> 2-3M in size.

The _compressed_ filesize is 2-3MB. That has no relation to the amount of 
memory needed to display the image, which requires decompressing it. The 
Samsung Galaxy S2 has an 8MP camera, so if you assume 4 bytes/pixel (RGBA) a 
decompressed image will require ~31.9MB, which is about what you see.

The solution is to merge the "take a picture" recipe with the "Load Large 
Bitmaps Efficiently" recipe:


http://docs.xamarin.com/recipes/android/resources/general/load_large_bitmaps_efficiently

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Slow Build- und Packaging-Process & few other things after update

2013-05-01 Thread JLee
Today, after deinstalling mono completely I was finally able to install
4.7.4.
My hope was, that the problem only occurs in 4.6.x and not under 4.7.x.
Now the shock: the compiling-behaviour is the same as in 4.6.4, but takes
almost 4mins instead of 2mins in 4.6.4.
The newer the mono-version, the longer the build-time?
It's nearly unpossible to work under these conditions.

I have sent an e-mail with diagnostic-outputs (in english) and screencasts
to support(at)xamarin.

I hope you guys are able to fix this problem...

Lee










--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Slow-Build-und-Packaging-Process-few-other-things-after-update-tp5713139p5713256.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] "Take a Picture and Save Using Camera App" example fails with Java.Lang.OutOfMemoryError

2013-05-01 Thread Tom Opgenorth
On Wed, May 1, 2013 at 8:48 AM, Jonathan Pryor  wrote:
> On May 1, 2013, at 10:04 AM, Igor Velikorossov  wrote:
>> I've read the "Take a Picture and Save Using Camera App" example and 
>> downloaded provided sample 
>> (http://docs.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app).
>
> Thank you for mentioning this. We will update the recipe accordingly.

The recipe has been updated - the image is being resized before it's
loaded. I'm still waiting for the page to update with a link to the
source code for the application, that should eventually appear. In the
meantime, I placed the source code for this recipe in the
monodroid-samples repo on github:
https://github.com/xamarin/monodroid-samples/tree/master/CameraAppDemo
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] "Take a Picture and Save Using Camera App" example fails with Java.Lang.OutOfMemoryError

2013-05-01 Thread Igor Velikorossov
Thank you Jon, I'll study the other example.

It actually didn't occur to me about image being compressed, need more
sleep. :)


On 2 May 2013 03:54,  wrote:

> -- Forwarded message --
> From: Jonathan Pryor 
> To: Discussions related to Mono for Android 
> Cc:
> Date: Wed, 1 May 2013 10:48:40 -0400
> Subject: Re: [mono-android] "Take a Picture and Save Using Camera App"
> example fails with Java.Lang.OutOfMemoryError
> On May 1, 2013, at 10:04 AM, Igor Velikorossov  wrote:
> > I've read the "Take a Picture and Save Using Camera App" example and
> downloaded provided sample (
> http://docs.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app
> ).
>
> Thank you for mentioning this. We will update the recipe accordingly.
>
> > However it looks the sample is either too inefficient or there is a
> mono's issue - just after one picture grab it grows heap by 30M and almost
> exhausts available memory on Samsung Galaxy S2. Attempting showing a 2nd
> picture crashes and burns the app with Java.Lang.OutOfMemoryError.
> > I find it especially curious given that the size of the picture taken is
> mere 2-3M in size.
>
> The _compressed_ filesize is 2-3MB. That has no relation to the amount of
> memory needed to display the image, which requires decompressing it. The
> Samsung Galaxy S2 has an 8MP camera, so if you assume 4 bytes/pixel (RGBA)
> a decompressed image will require ~31.9MB, which is about what you see.
>
> The solution is to merge the "take a picture" recipe with the "Load Large
> Bitmaps Efficiently" recipe:
>
>
> http://docs.xamarin.com/recipes/android/resources/general/load_large_bitmaps_efficiently
>
>  - Jon
>
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] "Take a Picture and Save Using Camera App" example fails with Java.Lang.OutOfMemoryError

2013-05-01 Thread Stuart Lodge
For that memory load issue, I think that Recipe should be updated.

Make sure you are using inPurgeable too

See
http://slodge.blogspot.co.uk/2013/02/huge-android-memory-bug-and-bug-hunting.html

Stuart


On 1 May 2013 21:57, Igor Velikorossov  wrote:

> Thank you Jon, I'll study the other example.
>
> It actually didn't occur to me about image being compressed, need more
> sleep. :)
>
>
> On 2 May 2013 03:54,  wrote:
>
>> -- Forwarded message --
>> From: Jonathan Pryor 
>> To: Discussions related to Mono for Android 
>> Cc:
>> Date: Wed, 1 May 2013 10:48:40 -0400
>> Subject: Re: [mono-android] "Take a Picture and Save Using Camera App"
>> example fails with Java.Lang.OutOfMemoryError
>> On May 1, 2013, at 10:04 AM, Igor Velikorossov  wrote:
>> > I've read the "Take a Picture and Save Using Camera App" example and
>> downloaded provided sample (
>> http://docs.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app
>> ).
>>
>> Thank you for mentioning this. We will update the recipe accordingly.
>>
>> > However it looks the sample is either too inefficient or there is a
>> mono's issue - just after one picture grab it grows heap by 30M and almost
>> exhausts available memory on Samsung Galaxy S2. Attempting showing a 2nd
>> picture crashes and burns the app with Java.Lang.OutOfMemoryError.
>> > I find it especially curious given that the size of the picture taken
>> is mere 2-3M in size.
>>
>> The _compressed_ filesize is 2-3MB. That has no relation to the amount of
>> memory needed to display the image, which requires decompressing it. The
>> Samsung Galaxy S2 has an 8MP camera, so if you assume 4 bytes/pixel (RGBA)
>> a decompressed image will require ~31.9MB, which is about what you see.
>>
>> The solution is to merge the "take a picture" recipe with the "Load Large
>> Bitmaps Efficiently" recipe:
>>
>>
>> http://docs.xamarin.com/recipes/android/resources/general/load_large_bitmaps_efficiently
>>
>>  - Jon
>>
>
>
>
> ___
> 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] "Take a Picture and Save Using Camera App" example fails with Java.Lang.OutOfMemoryError

2013-05-01 Thread Tom Opgenorth
Huh. Interesting tip. Thanks a bunch Stuart. Updated the code.

On Wed, May 1, 2013 at 3:16 PM, Stuart Lodge  wrote:
> For that memory load issue, I think that Recipe should be updated.
>
> Make sure you are using inPurgeable too
>
> See
> http://slodge.blogspot.co.uk/2013/02/huge-android-memory-bug-and-bug-hunting.html
>
> Stuart
>
>
> On 1 May 2013 21:57, Igor Velikorossov  wrote:
>>
>> Thank you Jon, I'll study the other example.
>>
>> It actually didn't occur to me about image being compressed, need more
>> sleep. :)
>>
>>
>> On 2 May 2013 03:54,  wrote:
>>>
>>> -- Forwarded message --
>>> From: Jonathan Pryor 
>>> To: Discussions related to Mono for Android 
>>> Cc:
>>> Date: Wed, 1 May 2013 10:48:40 -0400
>>> Subject: Re: [mono-android] "Take a Picture and Save Using Camera App"
>>> example fails with Java.Lang.OutOfMemoryError
>>> On May 1, 2013, at 10:04 AM, Igor Velikorossov  wrote:
>>> > I've read the "Take a Picture and Save Using Camera App" example and
>>> > downloaded provided sample
>>> > (http://docs.xamarin.com/recipes/android/other_ux/camera_intent/take_a_picture_and_save_using_camera_app).
>>>
>>> Thank you for mentioning this. We will update the recipe accordingly.
>>>
>>> > However it looks the sample is either too inefficient or there is a
>>> > mono's issue - just after one picture grab it grows heap by 30M and almost
>>> > exhausts available memory on Samsung Galaxy S2. Attempting showing a 2nd
>>> > picture crashes and burns the app with Java.Lang.OutOfMemoryError.
>>> > I find it especially curious given that the size of the picture taken
>>> > is mere 2-3M in size.
>>>
>>> The _compressed_ filesize is 2-3MB. That has no relation to the amount of
>>> memory needed to display the image, which requires decompressing it. The
>>> Samsung Galaxy S2 has an 8MP camera, so if you assume 4 bytes/pixel (RGBA) a
>>> decompressed image will require ~31.9MB, which is about what you see.
>>>
>>> The solution is to merge the "take a picture" recipe with the "Load Large
>>> Bitmaps Efficiently" recipe:
>>>
>>>
>>> http://docs.xamarin.com/recipes/android/resources/general/load_large_bitmaps_efficiently
>>>
>>>  - Jon
>>
>>
>>
>>
>> ___
>> 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
>



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

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