Monday, 20 December 2010

Data exceeds UNCOMPRESS_DATA_MAX

It seems that android has put a limit of 1 MB on the size of the files that yo can put in your asset folder, which can be accessed through the Context. The reason for this is the "aapt" tool that Android uses to compress files into your apk install file.

Eclipse doesn't not allow one to set complier options such as "aapt -0". One would have to edit the Ant file that Android uses or manually build the apk package from scratch which is the work that Ant would do.

I tried copying my 1.5 MB file to a raw folder but that didn't seem to work. Ultimately I used one of the following file extensions which are not compressed by default by the "aapt" command. These are:

/* these formats are already compressed, or don't compress well */
static const char* kNoCompressExt[] = {
".jpg", ".jpeg", ".png", ".gif",
".wav", ".mp2", ".mp3", ".ogg", ".aac",
".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
".amr", ".awb", ".wma", ".wmv"
};

My application is now working fine with the large_file.jet extension from the assets folder.

Friday, 17 December 2010

Problem with android project

If you are getting the error "could not find x apk" or "Project has no default.properties file! Edit the project properties to set one.". Your Projects files are most likely not there or corrupt.

Option A
Create new project from source "Your old Project"

Option B

Project -> Properties -> Java Build Path -> Libraries and android.jar which should be in the locations where you installed your SDK.

Go to the source workspace and create file and create file "default.properties" with content "target=android-8" or in place of 8 the miniSDK number.

Edit .classpath and add line <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>

Your project should work fine.

QR Code

A cool place to set up a link to your webpage via barcode:
http://qrcode.kaywa.com/