Build apk only for handset or only for tablets

Hi everyone!

I need to build 2 apk for my game. One that only support handsets and one that only support tablets.
The android documentation says that you can do that by setting the correct values in the manifest, but does anyone know how to set this information in Unity?

Thanks.

I think the process is as follows:

  • build once with all the settings you know about
  • the builder will give you an AndroidManifest.xml file in the staging area temporary folder
  • grab a copy of that file before you close Unity before it gets cleaned up
  • put that copy in Assets/Plugins/Android/AndroidManifest.xml
  • now build again; Unity will see that version and use it, rather than making up its own
  • you can then adjust what hardware features are required, per the Android SDK documentation, and build again

Can anyone else confirm it? It would be nice if you could influence this file with build script variables, so you can easily flip between two major hardware modes of the same basic game.

When you say handset, I assume you mean “something with phone guts” but some tablets have 4G phone guts too. Some phones have monster DPI and some tablets are very widescreen. Then there are television boxes that run Android. You will have to decide carefully what you mean by “handset” in terms of Android hardware features.

You can do an editor script that selects and copies proper manifest file to plugins folder and the builds the APK.
EDIT:
Phone and tablet separation in manifest
http://stackoverflow.com/questions/14570173/how-do-you-specify-in-androidmanifest-xml-that-you-want-to-forbid-installing-on