Question: Does anyone know if its possible to add specific files uncompressed to a Android APK file during the ANT build process using build.xml? All my files live in the *assets* folder and use the same extension. I do realise that i could use a different extension for the files that i don't want to be added compressed and specify, for example:

```
<nocompress extension="NoCompress" />

```

but this currently isn't an option for me.

I tried adding my own *aapt add* step after the *appt package* step in the *package-resource* section in *build.xml*:

```
<exec executable="${aapt}" taskName="add">
<arg value="add" />
<arg value="-v" />
<arg value="${out.absolute.dir}/TestAndroid.ap_" />
<arg value="${asset.absolute.dir}/notcompressed.and" />
</exec>

```

Which did add the file to the APK but it was compressed. :)

Is this possible or is a different extension the only way?

Thanks!

Answer: 
Have a look [here](http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/)

> 
> The only way (that I’ve discovered, as of this writing) to control
>  this behavior is by using the -0 (zero) flag to aapt on the command
>  line. This flag, passed without any accompanying argument, will tell
>  aapt to disable compression for all types of assets. Typically you
>  will not want to use this exact option, because for most assets,
>  compression is a desirable thing. Sometimes, however, you will have a
>  specific type of asset (say, a database), that you do not want to
>  apply compression to. In this case, you have two options.
> 
> 
> First, you can give your asset file an extension in the list above.
>  While this does not necessarily make sense, it can be an easy
>  workaround if you don’t want to deal with aapt on the command line.
>  The other option is to pass a specific extension to the -0 flag, such
>  as -0 db, to disable compression for assets with that extension. You
>  can pass the -0 flag multiple times, and each time with a separate
>  extension, if you need more than one type to be uncompressed.
> 
> 
> Currently, there is no way to pass these extra flags to aapt when
>  using the ADT within Eclipse, so if you don’t want to sacrifice the
>  ease of use of the GUI tools, you will have to go with the first
>  option, and rename your file’s extension.
> 
> 
>
Just to provide closure for this one.

I don't think it is possible to mark individual files to be added uncompressed to the APK.

Being able to mark individual files as uncompressed to *aapt* could be useful. As would the addition of a *nocompress file* tag, eg:

```
<nocompress file="FileNoCompress.abc" />

```

:)