Archive 17/01/2023.

How to package android apk file with certain example files?

elemusic

new to urho3d and android programming.
i have tried to write something with urho3d in windows with vs2010,now i want to run these example in android.
searched for something that tell me with the following command

android update project -p . -t 1
make -j8
ant debug

then i get a debug version apk file,everything seems to be fine but i found it’s hard for me to package just one example, not all of them.
probably because i’m new to android and i really got no idea how cmake works and how these file compiled
i totally dont know how to config the command to just package one example.

let’s say the first one hello world example.i just want this example to package in the apk file,then i guess the size of the file should be within 10mb,
now it’s 84mb,i think it’s too big for an android programm,and i know it’s because all demo example all package inside.37 examples i guess.

and i try to use the forum search on compile and android,it always tells me they just too common words,and leave no result.
so i guess i have to post a thread for asking.

could anybody tell me,or some hint where i should look for, how can i do this?thanks.

weitjong

To minimize the size, I usually use SHARED lib type for the Android build. Still, if that is too much for you then read on. Currently our Android build uses a simple sample launcher activity to let user choose which samples to run in the APK. This activity is able to adapt to the number of samples available in the APK dynamically. So, all you have to do when you don’t want all the samples to be included in the final APK is, don’t build all the samples during ‘make’ step. By default ‘make’ will perform a ‘make all’. You can selectively pass the target sample name that you want to build, one by one. e.g. make 01_HelloWorld && make 03_Sprites, etc, then follows by ant debug. I haven’t tried it like this, but I think it should work.

Mike

Concerning size, note that everything in the ‘Data’ and ‘CoreData’ folders get deployed, even if not used at all by your project.