On Jul 17, 2012, at 10:18 AM, Francesco Colombo wrote:
> I really appreciate if someone can do a very simple test for me:
> 
> 1) Create a new simple android application
> 2) UNZIP and PUT the attached file (logoscreen.xnb) into Assets folder

logoscreen.xnb is ~4MB in size. Android < 2.3 does not support decompressing 
compressed assets that are larger than 1MB in size:

        http://developer.android.com/about/versions/android-2.3-highlights.html

                "There is no longer a limit on the size of compressed .apk 
assets that can be read."

        http://stackoverflow.com/q/2860157/83444

There are two fixes:

1. Require Android 2.3+ (thus preventing execution on your GS1 device). (OK, 
this isn't a fix...)

2. Do not compress logoscreen.xnb. This can be done by opening Project Options, 
going to the Application tab, and adding .xnb to the Leave the following 
resource extensions uncompressed textbox. This also means that your .apk size 
will increase by ~4MB, as it won't be compressed.

An alternate 3rd solution is to not use Android Assets/Resources for the .xnb. 
It's apparently a XNA data file, so there's no actual need for it to be an 
Android Asset. You can instead set its Build action to EmbeddedResource, and 
use the System.Reflection APIs to grab it:

        System.Reflection.Assembly.GetExecutingAssembly ()
                .GetManifestResourceStream ("logoscreen.xnb");

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to