Skip to content

Commit f238814

Browse files
authored
Update HowTo_PackageTextures_On_Android.md
1 parent 08f06ac commit f238814

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

articles/getting_to_know/howto/content_pipeline/HowTo_PackageTextures_On_Android.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,30 @@ As you can see, supporting multiple texture compression formats is now quite eas
127127
/build:Textures/LogoOnly_64px.png;Textures#tcf_pvrtc/LogoOnly_64px
128128
```
129129

130+
## Using Android Asset Packs
131+
132+
The Google Play Store has some fairly strick limited on the package sizes for Android apps. However they do have way to extend thise limits for large games and apps, these are known as `Asset Packs`. Simply put, an `Asset Pack` is a way to organise your game content/assets into seperate pieces which can be downloaded shortly after installation or dynamically at runtime.
133+
For most games using the `Install Time` packs are the best option.
134+
135+
Using them in your game can be quite straigh forward. It only requires a little bit of `MSBuild` markup in your Android platform `.csproj`.
136+
137+
```xml
138+
<Target Name="_MoveContentIntoPacks" AfterTargets="IncludeContent">
139+
<ItemGroup>
140+
<AndroidAsset Update="Content/Music/**/*.*" AssetPack="MyGameAssets" />
141+
</ItemGroup>
142+
</Target>
143+
```
144+
145+
This adds an `MSBuild` target to your project which will process all the items in the `Content/Music` folder and subfolders. It will place them in an `Asset Pack` called `MyGameAssets`. You can change the name of this pack as you wish. By default this will be an `InstallTime` pack. So it will be installed at the same time as your game is. There is not need to do anything else, the assets will be placed in the usual location and opened via `Content.Load<T>`.
146+
147+
If use dymanic delivery and install packs at runtime you will need to open the content from a different location. This is out of scope for this document.
148+
If you want to learn more about how to use these features please check out the following links:
149+
150+
- [Android Asset Packs](https://learn.microsoft.com/en-us/dotnet/maui/android/asset-packs?view=net-maui-9.0)
151+
- [Android Asset Packs for .NET & .NET MAUI Android Apps](https://devblogs.microsoft.com/dotnet/android-asset-packs-in-dotnet-android/)
152+
- [Play Asset Delivery](https://developer.android.com/guide/playcore/asset-delivery)
153+
130154
## Sample `.mgcb` with Multiple Compression Formats
131155

132156
```bash

0 commit comments

Comments
 (0)