[mono-android] Binary fiile in Asset folder

2013-04-24 Thread Francesco Colombo
Hi,

I'm having a strange issue in android 4.0 wiht Sam G2. I'm trying to read
some binary files, which are ~2mb, from the Asset folder. Some of these
files are read without any problems, some others make the app crash with
the error: "Error reading asset data. Unable to access asset data: -1".

I knew there were a limitation in Android 2.2 (and below) where compressed
assets should not be > 1mb. But I'm facing the issue on Android 4.0.

This is really strange to me. It seems that the low level api fails to read
certain binary files.

I tried also to read the file in chunks of 1024 byte. It fails when I try
to read the last chunk.

any idea or suggestion?
___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Binary fiile in Asset folder

2013-04-24 Thread Jonathan Pryor
On Apr 24, 2013, at 1:02 PM, Francesco Colombo  
wrote:
> I'm having a strange issue in android 4.0 wiht Sam G2. I'm trying to read 
> some binary files, which are ~2mb, from the Asset folder. Some of these files 
> are read without any problems, some others make the app crash with the error: 
> "Error reading asset data. Unable to access asset data: -1". 

It's possible it's (yet another) Samsung-specific bug. (At this point ~nothing 
would surprise me wrt Samsung. Yes, I'm jaded.)

For sanity, I would suggest trying on another hardware device or the emulator, 
and see how things perform there.

> any idea or suggestion?

You could also try disabling compression on that file, or use Build action 
EmbeddedResource instead of AndroidAsset and use 
Assembly.GetManifestResourceStream() to obtain the data. (Not useful if you're 
e.g. using a WebView with file:///android_asset, but could be useful...)

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Binary fiile in Asset folder

2013-04-24 Thread Francesco Colombo
:( I'm going to try on another device.

I whish also try the "uncompressed" way but I'm unable to achieve this. If
I open the project properties and insert some values inside the textbox
which expects file types which will be "uncompressed", values are not saved!




On Wed, Apr 24, 2013 at 7:16 PM, Jonathan Pryor  wrote:

> On Apr 24, 2013, at 1:02 PM, Francesco Colombo <
> francesco.colo...@gmail.com> wrote:
> > I'm having a strange issue in android 4.0 wiht Sam G2. I'm trying to
> read some binary files, which are ~2mb, from the Asset folder. Some of
> these files are read without any problems, some others make the app crash
> with the error: "Error reading asset data. Unable to access asset data: -1".
>
> It's possible it's (yet another) Samsung-specific bug. (At this point
> ~nothing would surprise me wrt Samsung. Yes, I'm jaded.)
>
> For sanity, I would suggest trying on another hardware device or the
> emulator, and see how things perform there.
>
> > any idea or suggestion?
>
> You could also try disabling compression on that file, or use Build action
> EmbeddedResource instead of AndroidAsset and use
> Assembly.GetManifestResourceStream() to obtain the data. (Not useful if
> you're e.g. using a WebView with file:///android_asset, but could be
> useful...)
>
>  - 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] Binary fiile in Asset folder

2013-04-24 Thread Jonathan Pryor
On Apr 24, 2013, at 1:27 PM, Francesco Colombo  
wrote:
> I whish also try the "uncompressed" way but I'm unable to achieve this. If I 
> open the project properties and insert some values inside the textbox which 
> expects file types which will be "uncompressed", values are not saved!

Odd; which IDE is this, Xamarin Studio or Visual Studio?

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Binary fiile in Asset folder

2013-04-24 Thread Francesco Colombo
Xamarin Studio!


On Wed, Apr 24, 2013 at 7:33 PM, Jonathan Pryor  wrote:

> On Apr 24, 2013, at 1:27 PM, Francesco Colombo <
> francesco.colo...@gmail.com> wrote:
> > I whish also try the "uncompressed" way but I'm unable to achieve this.
> If I open the project properties and insert some values inside the textbox
> which expects file types which will be "uncompressed", values are not saved!
>
> Odd; which IDE is this, Xamarin Studio or Visual Studio?
>
>  - 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] Binary fiile in Asset folder

2013-04-24 Thread Jonathan Pryor
On Apr 24, 2013, at 1:39 PM, Francesco Colombo  
wrote:
> Xamarin Studio!

Thank you. This has been filed as: 
https://bugzilla.xamarin.com/show_bug.cgi?id=11943

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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


Re: [mono-android] Binary fiile in Asset folder

2013-04-24 Thread Tom Opgenorth
Just a thought: what happens if you put these binary files into
Resources/raw instead of the Assets folder? Maybe the Android
ResourceManager will like these files better than the AssetManager?


On Wed, Apr 24, 2013 at 11:02 AM, Francesco Colombo <
francesco.colo...@gmail.com> wrote:

> Hi,
>
> I'm having a strange issue in android 4.0 wiht Sam G2. I'm trying to read
> some binary files, which are ~2mb, from the Asset folder. Some of these
> files are read without any problems, some others make the app crash with
> the error: "Error reading asset data. Unable to access asset data: -1".
>
> I knew there were a limitation in Android 2.2 (and below) where compressed
> assets should not be > 1mb. But I'm facing the issue on Android 4.0.
>
> This is really strange to me. It seems that the low level api fails to
> read certain binary files.
>
> I tried also to read the file in chunks of 1024 byte. It fails when I try
> to read the last chunk.
>
> any idea or suggestion?
>
>
>
> ___
> 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


Re: [mono-android] deployment problem::my android device (tab) is not enabling in select device window

2013-04-24 Thread Jonathan Pryor
What version of Xamarin.Android are you running?

Xamarin.Android 4.6 introduced the free Starter edition which allows device 
deployment, but only from Xamarin Studio. You're within Visual Studio, with an 
"Evaluation version" message, which suggests you're using Mono for Android 4.4 
or earlier.

I would suggest upgrading to Xamarin.Android 4.6:

http://xamarin.com/download

 - Jon

On Apr 23, 2013, at 9:42 AM, krish  wrote:

> hi,
>i have a problem of deployment actually i want my mono for android app
> into my MTS MTAG70.(android version 2.2)...i just followed the instructions
> http://docs.xamarin.com/guides/android/deployment,_testing,_and_metrics/set_up_for_device_development
> 
>   
> after the installing all drivers i found my device id when i run
> C:\...platform-tools>adb devices
> 1234567890ABCDEFdevice
> k,then i open my vs2010 and run the program it get my device id in select
> device windowtill then fine..but here comes the problem...the android
> device id is in disable state and OK button is also in disable state...i am
> unable to get that device in enable mode ...i waited for one hour even it is
> in disable state...
>  
> here u find pink marked  means device id and ok button in disable
> state...how to enable it..what is the problem...the red marked are i made my
> app according to tablet version 2.2 thats y i change android version to 2.2
> and run it no workingplz tell the solution asap
> 
> 
> 
> 
> --
> View this message in context: 
> http://mono-for-android.1047100.n5.nabble.com/deployment-problem-my-android-device-tab-is-not-enabling-in-select-device-window-tp5713193.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] Internal Storage file not found

2013-04-24 Thread Jonathan Pryor
On Apr 23, 2013, at 2:29 PM, dstilwell  wrote:
> However if I stop the app and then restart it, I get a File Not Found 
> exception thrown and nothing returned from the read function.

How are you stopping the app? Are you sure that WriteID() has finished?

For that matter, how do you know that the data has actually been written to 
disk? (Think kernel-level caching/etc.) I've not delved into the entire Java 
stack to know if closing the Stream returned from OpenFileOutput() will 
actually result in it being flushed to disk, so I don't actually know.

Likewise, how are you restarting the app? Through the Home screen? Through the 
debugger? If through the debugger, it's possible that your app is being 
uninstalled and reinstalled, which will nuke your data directory, so that might 
also explain the behavior you're seeing.

 - Jon

___
Monodroid mailing list
Monodroid@lists.ximian.com

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