Let's build for Android!

Started by eri0o, Mon 08/01/2018 00:35:15

Previous topic - Next topic

Mehrdad

Thanks a lot, @eriOo. Nice job!!!
My official site: http://www.pershaland.com/

robcolton

This post and the Android Studio project was very helpful! I got my game up and running on Android without a lot of effort.

However, I keep getting an error about the midi driver. My game config has midi disabled, and the Android.cfg has it set to Enabled = false. I'm not sure what I'm doing wrong here?

Anyone have any ideas?

Crimson Wizard

Quote from: robcolton on Sat 26/10/2019 18:22:09
However, I keep getting an error about the midi driver. My game config has midi disabled, and the Android.cfg has it set to Enabled = false. I'm not sure what I'm doing wrong here?

Normally if you disable MIDI it should not try to initialize.

Could you post config file and what is the error message?

Oh, and what version of engine/AGS are you using?

robcolton

Quote from: Crimson Wizard on Sat 26/10/2019 18:24:28
Quote from: robcolton on Sat 26/10/2019 18:22:09
However, I keep getting an error about the midi driver. My game config has midi disabled, and the Android.cfg has it set to Enabled = false. I'm not sure what I'm doing wrong here?

Normally if you disable MIDI it should not try to initialize.

Could you post config file and what is the error message?

Oh, and what version of engine/AGS are you using?

The error I get is:
Warning: cannot enable MIDI audio.
Problem: No compatible drivers found in the system.

I'm using AGS 3.5.0.18 (RC2) and I used the Android engine labeled 3.5.0.18 from https://cirrus-ci.com/github/adventuregamestudio/ags

My acsetup.cfg file:
Code: ags

[misc]
game_width=320
game_height=200
gamecolordepth=32
antialias=0
notruecolor=0
cachemax=131072
user_data_dir=
shared_data_dir=
titletext=Rogue by Rob Colton
[graphics]
driver=D3D9
windowed=1
screen_def=scaling
game_scale_fs=proportional
game_scale_win=max_round
filter=stdscale
vsync=0
render_at_screenres=0
[sound]
digiid=-1
midiid=0
usespeech=1
[language]
translation=
[mouse]
auto_lock=0
speed=1


My android.cfg file:
Code: ags

[misc]
config_enabled = 1
rotation = 2
translation = default
[controls]
mouse_method = 0
mouse_longclick = 0
[compatibility]
clear_cache_on_room_change = 0
[sound]
samplerate = 44100
enabled = 1
threaded = 1
cache_size = 10
[midi]
enabled = 0
preload_patches = 0
[video]
framedrop = 0
[graphics]
renderer = 0
smoothing = 0
scaling = 1
super_sampling = 0
smooth_sprites = 0
[debug]
show_fps = 0
logging = 0

robcolton

Tried it with the RC3 files in the release forum, and I'm still getting the MIDI driver error. I have it disabled in both cfg files, so I'm not sure what else to do to suppress it.

Crimson Wizard

Are you using launcher APK or created APK exclusively with your game? I am not sure how it works with the latter (where it gets config from).

eri0o

#27
If someone stumbles on this thread even more updated instructions are here: https://github.com/ericoporto/teafortwo

Other than this I can't help without seeing code. The files looks correct but my guess is you are not placing it in the correct directory.

An even more more updated Android Studio project is in the works.

robcolton

Quote from: Crimson Wizard on Thu 31/10/2019 08:59:26
Are you using launcher APK or created APK exclusively with your game? I am not sure how it works with the latter (where it gets config from).

I'm building an APK specifically for my game. It works and launches the game, which plays fine after I dismiss the MIDI driver error.

The config files are in the src/main/assets folder with the obb file.

I'll go over eri0o's updated instructions and make sure I'm not missing anything.

robcolton

#29
I got it to work!

The trick was I had to put both the android.cfg and acsetup.cfg files into the obb along with the ags file. Once I did that, no more MIDI error.

Thanks for putting together your instructions. They were invaluable in getting this working.

(That just leaves iOS to get up and running...)

Vulpes


eri0o

#31
Hi @Vulpes,

At this time I don't have much more to say than what was mentioned in the README here : https://github.com/ericoporto/teafortwo

I currently just do those when I make a game and I couldn't find the right mind space to make games in 2020 and Google did release a new major version of Android Studio - which I haven't looked up on how it affected the Tea for Two project.

At this point in time I am working on a new Android port that will use the new SDL2 backend that is being developed and should be compatible with all the latest tools from Google, which I hope will make things easier.

Potajito

Oofff! I've been trying to build this all day with no success. Even trying to build Tea for Two, I get just a black flash on the device and that's it.
In the log cat I have:
Code: ags
2021-05-19 23:36:06.638 30567-30567/com.mythsuntold.teafortwo D/OBB_COPY: File not found exception occurred copying expansion file: /storage/emulated/0/Android/obb/com.mythsuntold.teafortwo/main.8.com.mythsuntold.teafortwo.obb: open failed: ENOENT (No such file or directory)
2021-05-19 23:36:06.653 30567-30567/com.mythsuntold.teafortwo D/STORAGE: Expansion file /storage/emulated/0/Android/obb/com.mythsuntold.teafortwo/main.8.com.mythsuntold.teafortwo.obb not found!

So it looks like the app can't read the obb file. I tried placing the loose files in the assets folder to no avail, same result. I even tried a 2019 build for Android Studio, AGS 3.4 libs... Not working here :( This is in Windows and Linux. i really can't think on anything else to try.

Amir

Does anyone have the repository that Eri0o made and can send it to me? and can tell me the last instructions? All links are broken. I would like to try this method because monkey0506's plugin creates broken APK and OBB and unfortunately there is no other option.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

My repositories are useless in 2021 since Google changed requirements for playstore apps. I made a new better port for game releases, on top of sdl2 port, that should be available soon, that will read Android assets without copying, work with Play Asset Delivery, and actually run on Android 11 and 12. Once it's reviewed I will update the links. The build process is also greatly simplified.

Mehrdad

Great news Erico. Thanks so much!
My official site: http://www.pershaland.com/

Amir

Wonderful ;-D thank u. I’m so excited.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

eri0o

#37
@Amir, the code was merged, you can find the documentation here: Android/mygame/README.md!

so, please read and ask any questions! I will try to answer questions and improve the docs there. For now all the build will need to be from full source. I recommend using Android Studio Artic Fox (2020.3) or whatever is the latest version!

For building fully from source (including native parts), you will need to mark the following in Android Studio (see below) and also download the AGS full repository here. You will then open the mygame project in Android Studio.

Spoiler
[close]

Spoiler
[close]

Once there's a new AGS 3.6.0 release, it will be possible to use the prebuilt native! (avoiding the ndk and cmake install in Android Studio)

I and CW will probably work together to make it possible to build this project from the Editor directly (like it was in monkey plugin), but in the meanwhile, you can try the above and see if it works for you.

Potajito

Quote from: eri0o on Sun 22/08/2021 23:39:45
@Amir, the code was merged, you can find the documentation here: Android/mygame/README.md!

so, please read and ask any questions! I will try to answer questions and improve the docs there. For now all the build will need to be from full source. I recommend using Android Studio Artic Fox (2020.3) or whatever is the latest version!

For building fully from source (including native parts), you will need to mark the following in Android Studio (see below) and also download the AGS full repository here. You will then open the mygame project in Android Studio.

Spoiler
[close]

Spoiler
[close]

Once there's a new AGS 3.6.0 release, it will be possible to use the prebuilt native! (avoiding the ndk and cmake install in Android Studio)

I and CW will probably work together to make it possible to build this project from the Editor directly (like it was in monkey plugin), but in the meanwhile, you can try the above and see if it works for you.
Amazing, thanks! I'll try to build tomorrow!

eri0o

The real short version of the guide is, place your compiled game files in mygame/app/src/main/assets and click build in Android Studio and see if things work. Then read the guide for details and ask here in case of problems.  :-D

SMF spam blocked by CleanTalk