Mirai
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    5
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 讓 RPG Maker MV/MZ 也能在 Android 手機上遊玩的教學 :::warning <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> 本教學文章我將不再繼續更新維護了,並且完全開源給所有人任意修改使用和二次發佈等,但是也不要再問我關於本教學文章的任何問題,我一直以來都免費提供教學資源給你們,卻沒有任何人想要贊助支持我。 ::: :::danger ![](https://i.imgur.com/DlYJ941.png) ::: 本篇教學文章是將原本已經被我上鎖的舊版教學文章「使用 APK Expansion Files(OBB) 來解決輸出 APK 大容量的限制」進行全面升級,主要除了也是因為舊版教學文章的程式碼太過老舊且不太能支援現在的Android 環境,而且今年 8 月 Google 官方也宣布將統一改用「**AAB**」的格式來替代原本一直以來使用的「APK」以及「OBB」格式。 總之,這次教學除了有改善原本舊版文章的 **IAP 內購**和 **Admob 廣告**之外,也新增其他幾項功能, 當然,這次教學也將教你輸出成 **AAB 格式**來讓你上架到 Play 商店。 * **2022/02/28 更新** 更新插件使用條款,以及新增關於「支援平台」資訊和最佳化一些程式碼。 * **2021/08/10 更新** 修正部分 Android 裝置無法正常執行的問題,並且新增「**[額外補充](#■-額外補充)**」的教學內容。 # ◆ 第一步 到以下網址下載 **Android Studio**。 → https://developer.android.com/studio ![](https://i.imgur.com/RPAZaxS.png) 打勾同意之後,按「Download Android Studio」開始下載並安裝 Android Studio。 ![](https://i.imgur.com/fDs86PD.png) 安裝完後執行 Android Studio 並展開右上角的選單項目,選擇「SDK Manager」。 ![](https://i.imgur.com/PjlZifR.png) 在「SDK Platforms」勾選安裝最新版的 Android 版本, 這裡我是勾選「Android 11.0(R)」,當然你要按照我圖中的設定打勾我也沒意見。 ![](https://i.imgur.com/yCbNolg.png) 切換到「SDK Tools」將紅色勾勾標註的必要工具都打勾, 當然你要按照我圖中的設定打勾我也沒意見, 按下「OK」之後會執行下載並安裝勾選的所需套件。 ![](https://i.imgur.com/DbPjqS0.png) # ◆ 第二步 開啟你的 RPG Maker MV 的專案,並按「檔案」→「部署…」, 選擇「Android / iOS」之後按下「OK」來輸出。 **[RPG Maker MV]** ![](https://i.imgur.com/mcBR6IW.png) 而 RPG Maker MZ 的專案為「檔案」→「部署…」,選擇「網頁瀏覽器 / Android / iOS」之後按 OK 來輸出。 **[RPG Maker MZ]** ![](https://i.imgur.com/tJ6UURN.png) :::warning <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> 素材檔名絕對不要有包含中文或亂碼,當然也包含任何的空格都不能有。 ::: # ◆ 第三步 到以下的 GitLab 網址下載需要的 Android Studio 專案(MyApplication.7z), 以及 IAP 用的範例專案(「ProjectIAP_MV」或「ProjectIAP_MZ」), 也包含範例專案內的 NekoGakuen_AndroidPlus.js 插件在內。 → https://gitlab.com/MiraiSoSad/android-studio-for-rpg-maker-mvmz/-/tree/zh_TW 回到 Android Studio 並按下上方的「Open」, 選擇解壓縮剛剛下載的Android Studio 專案資料夾(MyApplication)後按下「OK」, 接著開啟專案之後等待右下角的進度條跑完專案的同步即可。 ![](https://i.imgur.com/kgTfDen.png) ![](https://i.imgur.com/kuBT0qE.png) # ◆ 第四步 在「File」→「Project Structure…」那邊的「SDK Location」之中, 點擊「Gradle Setting」後在「Gradle JDK」選項中選擇「Download JDK...」。 ![](https://i.imgur.com/JDpsibU.png) ![](https://i.imgur.com/Ow1F15F.png) 接著,在「Version」選擇最新的版本號之後, 在「Vendor」選擇「Oracle OpenJDK」後按下「Download」。 ![](https://i.imgur.com/sth6ARz.png) # ◆ 第五步 如果要進行 Play 商店上架的話,請選擇「IAP」的部分, 反之,如果只是要輸出並放在手機上玩的話,請選擇「Only」的部分。 ![](https://i.imgur.com/p1O1LoX.png) ### ■ Only 首先,來解說下「Only」的使用方法,將你剛剛輸出好的 RPG Maker MV/MZ 專案, 放在「MyApplication\Only\src\main\assets\www」的資料夾中。 在「Only」之下的「res」→「values」→「strings」按滑鼠右鍵, 選擇「Open Translations Editor」後即可在「Default Value」 修改「app_name」來設定你的 APP 遊戲名稱等字串參數。 ![](https://i.imgur.com/QraHjqw.png) 接著選擇「Build」→「Build Bundie(s) / APK(s)」→「Build APK(s)」輸出。 ![](https://i.imgur.com/waJPRl3.png) 等待輸出完成之後,在「MyApplication\Only\build\outputs\apk\debug」的資料夾, 可以找到三個apk檔案後只要把「Only-universal-debug.apk」安裝到手機上即可遊玩。 ### ■ IAP 接著來解說下「IAP」的使用方法,將你剛剛輸出好的 RPG Maker MV/MZ 專案, 放在「MyApplication\RPGAssets\src\main\assets」的資料夾中。 在「File」→「Project Structure…」在「Modules」把「Default Config」的三個參數值修改一下, 分別是「Application ID」、「Version Code」、「Version Name」。 ![](https://i.imgur.com/JDpsibU.png) ![](https://i.imgur.com/VXLL9Db.png) ### ■ 變更 APP 圖示 將「mipmap」按滑鼠右鍵選擇「Delete…」以便進行更換 APP 的圖示。 ![](https://i.imgur.com/pLwzyZQ.png) 接著在「res」按滑鼠右鍵選擇「New」→「Image Asset」。 ![](https://i.imgur.com/uwT72LF.png) 在「Foreground Layer」的「Source Asset」和「Scaling」進行 APP 圖示的設定。 ![](https://i.imgur.com/Wm25l0o.png) 在「Background Layer」的「Source Asset」進行 APP 圖示背景色彩的設定。 ![](https://i.imgur.com/zsID3Ye.png) 在 IAP 之下的「Strings」按滑鼠右鍵選擇「Open Translations Editor」來設定一些進階參數。 ![](https://i.imgur.com/lKAJdjF.png) ![](https://i.imgur.com/Pjr2iQk.png) 「app_name」設定你的 APP 遊戲名稱。 「license_key」設定你的應用程式簽署金鑰, :::info <i class="fa fa-info-circle" aria-hidden="true"></i> 而這個部分可以在「Play管理中心」左側最下方的「營利設定」中找到。 ::: ![](https://i.imgur.com/Bmtfgjr.png) 「test_mode」設定是否為測試模式,但是當你在 Play 商店上架時,記得將此項設為「false」。 剩下的五項則為「AdMob」廣告單元的部分,目前預設所填入的是測試用的廣告單元, 如果你有使用到 AdMob 廣告單元,記得換成你自己帳號的 AdMob 廣告單元, 而 AdMob 廣告的操作使用,這邊就先不特別說明了。 最後,在「Build」→「Generate Signed Bundle / APK…」那邊, 選擇「Android App Bundle」並按「Next」,然後建立或使用你的簽署金鑰, 完成後將輸出好的 AAB 檔案上傳至 Play 商店即可, 當然簽署金鑰和上架到 Play 商店這兩個部分我就不特別說明了。 ![](https://i.imgur.com/jwcEdss.png) ![](https://i.imgur.com/XsxaMI0.png) ![](https://i.imgur.com/1Erx9wz.png) ![](https://i.imgur.com/zskgaU8.png) ### ■ 額外補充 #### ● 如何讓 RPG Maker MV 也能支援觸控 UI? 補充說明,雖然MV本身並無內建內建手機觸控的按鈕UI功能,但可以使用官方提供的「TouchUI.js」插件來解決手機操作遊玩的問題。 :::info <i class="fa fa-info-circle" aria-hidden="true"></i> 而TouchUI.js插件平常放在D:\Steam\steamapps\common\RPG Maker MV\dlc\KadokawaPlugins_New\js\plugins的資料夾中。 ::: #### ● 如何變更Splash圖像? 在「MyApplication\IAP\src\main\res\drawable」將「logo.png」換成你自己 APP 啟動畫面的圖檔。 :::info <i class="fa fa-info-circle" aria-hidden="true"></i> 如果是 Only 的話路徑為「MyApplication\Only\src\main\res\drawable」。 ::: #### ● 如何將手機畫面的顯示方向變更為直向顯示? 這邊的話將教你如何在 Android Studio 專案中修改手機顯示方向,而 RPG Maker MV/MZ 的解析度設定應該就不用我特別教你才對。 首先分別在「manifests/AndroidManifest.xml」和「res/layout/activity_main.xml」這兩個檔案進行修改, 在「AndroidManifest.xml」檔案中的第 21 行程式碼,將"sensorLandscape"改為"sensorPortrait", 在「activity_main.xml」檔案中,切換為「Design」後在「main」將「orientation」的參數改為「vertical」。 ![](https://i.imgur.com/5EEiXbw.png) #### ● 為什麼我使用 RPG Maker MZ 遊戲在 Android 裝置上遊玩會一直停在黑畫面? 您可以試著修改在專案資料夾內的 `js/rmmz_managers.js` 中第 2109 行左右的語法。 ```javascript SceneManager.isGameActive = function() { // [Note] We use "window.top" to support an iframe. try { return window.top.document.hasFocus(); } catch (e) { // SecurityError return true; } }; ``` 修改為 ```javascript SceneManager.isGameActive = function () { return true; }; ``` 《Mirai》Patreon創作: https://www.patreon.com/MiraiDiary 《Mirai》個人推特(X): https://twitter.com/Mirai_so_Sad 《Mirai》itch.io頁面: https://miraisosad.itch.io 《Mirai》個人Instagram https://www.instagram.com/miraisosad/ ###### tags: `貓咪學園` `NekoGakuen` `RPG Maker` `RPG Maker MV` `RPG Maker MZ` `Android Studio`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully