Jibble

Author Topic: Let's build for Android!  (Read 19062 times)

eri0o

Re: Let's build for Android!
« Reply #20 on: 09 Apr 2019, 14:28 »

Re: Let's build for Android!
« Reply #21 on: 09 Apr 2019, 16:57 »
Thanks a lot, @eriOo. Nice job!!!
My official site: http://www.pershaland.ir/

Re: Let's build for Android!
« Reply #22 on: 26 Oct 2019, 18:22 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #23 on: 26 Oct 2019, 18:24 »
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?

Re: Let's build for Android!
« Reply #24 on: 26 Oct 2019, 21:41 »
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: Adventure Game Studio
  1. [misc]
  2. game_width=320
  3. game_height=200
  4. gamecolordepth=32
  5. antialias=0
  6. notruecolor=0
  7. cachemax=131072
  8. user_data_dir=
  9. shared_data_dir=
  10. titletext=Rogue by Rob Colton
  11. [graphics]
  12. driver=D3D9
  13. windowed=1
  14. screen_def=scaling
  15. game_scale_fs=proportional
  16. game_scale_win=max_round
  17. filter=stdscale
  18. vsync=0
  19. render_at_screenres=0
  20. [sound]
  21. digiid=-1
  22. midiid=0
  23. usespeech=1
  24. [language]
  25. translation=
  26. [mouse]
  27. auto_lock=0
  28. speed=1
  29.  

My android.cfg file:
Code: Adventure Game Studio
  1. [misc]
  2. config_enabled = 1
  3. rotation = 2
  4. translation = default
  5. [controls]
  6. mouse_method = 0
  7. mouse_longclick = 0
  8. [compatibility]
  9. clear_cache_on_room_change = 0
  10. [sound]
  11. samplerate = 44100
  12. enabled = 1
  13. threaded = 1
  14. cache_size = 10
  15. [midi]
  16. enabled = 0
  17. preload_patches = 0
  18. [video]
  19. framedrop = 0
  20. [graphics]
  21. renderer = 0
  22. smoothing = 0
  23. scaling = 1
  24. super_sampling = 0
  25. smooth_sprites = 0
  26. [debug]
  27. show_fps = 0
  28. logging = 0
  29.  

Re: Let's build for Android!
« Reply #25 on: 31 Oct 2019, 05:11 »
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

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Let's build for Android!
« Reply #26 on: 31 Oct 2019, 08:59 »
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

Re: Let's build for Android!
« Reply #27 on: 31 Oct 2019, 11:36 »
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.
« Last Edit: 31 Oct 2019, 11:47 by eri0o »

Re: Let's build for Android!
« Reply #28 on: 31 Oct 2019, 15:35 »
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.

Re: Let's build for Android!
« Reply #29 on: 31 Oct 2019, 16:13 »
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...)
« Last Edit: 31 Oct 2019, 16:15 by robcolton »

Re: Let's build for Android!
« Reply #30 on: 22 Jan 2021, 06:27 »
Video tutorial maybe? :')

eri0o

Re: Let's build for Android!
« Reply #31 on: 22 Jan 2021, 11:17 »
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.
« Last Edit: 22 Jan 2021, 11:30 by eri0o »

Re: Let's build for Android!
« Reply #32 on: 19 May 2021, 23:44 »
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: Adventure Game Studio
  1. 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)
  2. 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.

Re: Let's build for Android!
« Reply #33 on: 05 Aug 2021, 15:49 »
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

Re: Let's build for Android!
« Reply #34 on: 12 Aug 2021, 11:21 »
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.

Re: Let's build for Android!
« Reply #35 on: 12 Aug 2021, 12:17 »
Great news Erico. Thanks so much!
My official site: http://www.pershaland.ir/

Re: Let's build for Android!
« Reply #36 on: 13 Aug 2021, 10:54 »
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

Re: Let's build for Android!
« Reply #37 on: 22 Aug 2021, 23:39 »
@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: ShowHide


Spoiler: ShowHide


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.
« Last Edit: 23 Aug 2021, 00:33 by eri0o »

Re: Let's build for Android!
« Reply #38 on: 23 Aug 2021, 00:08 »
@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: ShowHide


Spoiler: ShowHide


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

Re: Let's build for Android!
« Reply #39 on: 23 Aug 2021, 00:18 »
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