Distributing Android Apps

Chimpy

New member
Joined
Sep 16, 2019
Messages
18
Hello Cerberus X Community,

I found Cerberus X a couple of days ago when I was intensively searching for a graphics programming language for Android and I simply love it. It is so simple but yet powerful, it is amazing, plus it supports a wide variety of target platforms as well as Linux as hosting system, plus it is open source. This is so awesome that I actually started wondering why it doesn't get more attention?
I already finished a first little project, a tetris clone, well sound is missing I have to admit but other than that I am happy with it.
Because I am a complete Android noob when it comes to programming I might miss very obvious things, but looking into the documentation and the forum I couldn't find any information about some basic things, first changing the app icon. I found the path of the icons in the build folder, but when I overwrote them, Cerberus X changed them back to the defaults one, when targeting the android platform, so the workaround for my was now just to overwrite the default icons.
I now would like to publish the app on Google Play. I found this page - https://developer.android.com/studio/publish - where they tell that I have to change name, version etc. in the Manifest file to meet the requirements for distributing an app, but again, when I am building the app again with Cerberus X the Manifest file gets overwritten again with default values.
How can I "sign" an application?
Maybe somebody can guide me a little bit what steps minimum I have to do to distribute an app. That would be very helpful. Thanks:)
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
Welcome to the forum. May i refer you to the documentation, Target SDKs?
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
540
Welcome to the forum!

Icon change: You have to change the Icon set in this folder: android\gradletemplate\app\src\main\res
There is this nice tool from Android Asset Studio to make all icons at once from a simple image.
You only have to change the manifest file, if you want to change app permissions. Other things like keystore or version you can set by using config constants for android.
Documentation is still a weak point, but the community is very nice.
 

Chimpy

New member
Joined
Sep 16, 2019
Messages
18
Thank you both,
I can't believe I missed that part in the documentation. I will try it out when I have some time, I'm currently very busy with my job.
So i don't need to manually change things in the android build folder besides the icons, that's good For writing a file i need an extra permission i guess. How would you guys save a game state or an highscore, simply write to a file? If i need to change the permission in the manifest file, how to recompile the program with the changes to take effect? I see i have to study more about android developement in general o_O
Yeah, the community appears to be great
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
540
For writing a file i need an extra permission i guess. How would you guys save a game state or an highscore, simply write to a file?
Not, as far as I know if you are just using SaveState(text:String) and text=LoadState() as they are not connecting to the normal file system of the device.

If you need to change the manifest, try the one in this folder: your_build_folder\android\gradletemplate\app\src\main
It should be enough to do a normal build after that. - Both not tested!
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
@Chimpy To add native libs and permissions, please have a look at the source files of admob.cxs and cerberusstore.cxs inside the modules/brl folder.
 

Chimpy

New member
Joined
Sep 16, 2019
Messages
18
Hi again,
Just wanted to say that I successfully uploaded my game to Google Play. It was much simpler than I thought. The only issue that I have is that I get a warning in the Google Play Console that my game is too big (1,13 MB) and should be optimized, but it is harmless I guess?
I don't think that it is worth to post this in the Showcase subforum because it's nothing special (mainly just a test), so I just post it here, if you are curious: https://play.google.com/store/apps/details?id=com.toybagames.fuzzyblocks
Thanks again
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
2,815
Congrats for your release but that game is ip and trademark protected like there is no tommorow. Don't be surprised if you get a C&D letter.
And was it 1,13 MB or 113 MB?
 

Chimpy

New member
Joined
Sep 16, 2019
Messages
18
It is only 1,13 MB of course.
I thought game ideas cannot be protected, am I wrong? I don't use any trademarks - all the graphics are made by myself (using just primitive draw routines provided by CX). I also don't make any money of it.
But I guess I will read further and take the game down on doubts.
 

SLotman

Active member
3rd Party Module Dev
Joined
Jul 3, 2017
Messages
149
The 'warning' is because Google Play is pushing to create several builds, one for each architecture supported by Android. They 'think' because your APK is 'one fits all' it is 'bloated' and should be separated into smaller ones, for specific devices.

I get it with all my games, and I just ignore it.
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
540
I successfully uploaded my game to Google Play. It was much simpler than I thought.
Good to hear. Could you sum up the steps you took to get it uploaded? It has been some time since I did this the last time.
I am thinking about tackling the android target with my CXDeploy tool next.
 

Chimpy

New member
Joined
Sep 16, 2019
Messages
18
I decided to remove the game to avoid possible copyright problems. I don't care so much for it anyway, it was mainly a test. Next time I will publish a game based on one of my own ideas :)

@Phil7
Of course, I'm not sure if I remember all steps, but I will try. I am on Arch Linux here, but I guess steps are very similiar on Windows.
I have installed all the android packages which I thought I need (which are: android-platform, android-sdk, android-sdk-build-tools, android-sdk-platform-tools, android-armv7a-eabi-system-image, android-studio) and the Oracle Java Development Kit (because I had trouble building packages with CX using the OpenJDK Development Kit).
I have generated a key using this command:
Code:
keytool -genkey -v -keystore release-key.keystore -alias release-key-alias -keyalg RSA -keysize 2048 -validity 10000
Then I moved the generated key to the build folder (not into the android build folder but to the general build folder, i.e. YOURPROJECT.buildv2019-05-05).
Inside the source code of my project, I included some preprocessor defines
code_language.cerberus:
#ANDROID_APP_LABEL="My Game"
#ANDROID_APP_PACKAGE="com.mycompany.mygame"
#ANDROID_SCREEN_ORIENTATION="portrait"              'one of: user, portrait, landscape
#ANDROID_VERSION_CODE="1"
#ANDROID_VERSION_NAME="1.0"
#ANDROID_NATIVE_GL_ENABLED=False                    'for use with the opengl modules
#ANDROID_KEY_STORE="../../release-key.keystore"
#ANDROID_KEY_ALIAS="release-key-alias"
#ANDROID_KEY_STORE_PASSWORD="password"
#ANDROID_KEY_ALIAS_PASSWORD="password"
#ANDROID_SIGN_APP=True
Then I have build the project, using the CX compiler:
Bash:
transcc_linux -target=Android_Game -config=Release ~/Projects/YourProject/YourProject.cxs
The building process fails first, because the gradlew shell script (inside the generated android build folder) is not set to executable. I fixed this by chmoding it to be executable: chmod +w gradlew. I think this issue has been already mentioned somewhere in the forum.
I have created a Google Play Developer Account and uploaded the game there. I also needed 2 screenshots as well as a presentation image for the app. I have filled various forms required to do such as defining the app content, filling out a description etc. and then waited 4 days for getting the app published.
 

Holzchopf

Moderator
3rd Party Module Dev
Tutorial Author
Joined
Jul 31, 2017
Messages
482
The 'warning' is because Google Play is pushing to create several builds, one for each architecture supported by Android. They 'think' because your APK is 'one fits all' it is 'bloated' and should be separated into smaller ones, for specific devices.

Thanks for the explanation! I was always wondering why they complain about my games, when there are so many boilerplate Unity "games" up there that take 10x the space... I guess in the end, everyone is ignoring that file size warning. IMHO games smaller than 2mb are never an issue for any user.
 
Top Bottom