设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 101|回复: 0

[制作教程] RMMV android deployment

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 昨天 18:08 | 显示全部楼层 |阅读模式
    The project is a library which helps you to build Android version of your games very easy.

    Update Log
    1.0.3 Add Android internal storage save support(with my RMMV plugin)


    You can find out the source code here : https://github.com/huhao1987/RMMV-android-deployment

    The project is built on https://github.com/AltimitSystems/mv-android-client, although it has changed a lot of code. Thanks for Altimit Systems` code!


    The project is built by kotlin, so the codes of it are less and easier to read than Java



    How to use the library
    Basic steps
    1. You need the latest Android studio, currently, the latest version is 3.6.3.

    2. Create a new Android project with "empty activity" or open your exist Android project.

    3. After "Gradle Build Running" finish, choose the "build.gradle(Project:xxxx)", add "maven { url 'https://jitpack.io' }" in allproects
    allprojects {repositories {google()jcenter()maven { url 'https://jitpack.io' }}}

    4. in "build.gradle(Module:app)", add below line in dependencies
    implementation 'com.github.huhao1987:RMMV-android-deployment:1.0.3'
    5. choose "manifests", in "activity" tag, add
         android:configChanges="orientation|screenSize"android:screenOrientation="sensorLandscape"to make the game run as horizontal screen


    • If your game need network connection​

    5.1 please add
        <uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    5.2 in "application" tag, add

            android:networkSecurityConfig="@xml/network_security_config"
    5.3 right click "app"->"New"->"Android Resource Directory", then choose "xml" in Resource type. right click "xml"->"New"->"XML Resource file",name it as "network_security_config", and copy the code below inside

    <?xml version="1.0" encoding="utf-8"?><network-security-config><base-config cleartextTrafficPermitted="true" /></network-security-config>
    5.1 and 5.2 are used to give the network permission for your game, or it cannot connect to the Internet. 5.2 ensure that the app can connect to both "http" and "https"

    6. Now add the rpgPlayerView view in the layout of your mian activity(If you just create a new project, it should be named "MainActivity", and the name of layout should be "activity_mian")
    <hh.rpgmakerplayer.webviewmodule.rpgPlayerViewandroid:id="@+id/rpgwebview"android:layout_width="match_parent"android:layout_height="match_parent" />
    7. If your project doesn`t have assets folder, right click "app"-"New"->"Folder"->"Assets Folder",Put the folder "www" of RMMV game in to "assets" folder.
    8. In MainActivity add the lines in onCreate

    • kotlin:​

    rpgwebview.build()rpgwebview.Playgame("//android_asset/www/index.html")

    • Java:​

    rpgPlayerView rpgwebview=findViewById(R.id.rpgwebview)rpgwebview.build()rpgwebview.Playgame("//android_asset/www/index.html")
    9. Build and run the debug game on your phone.
    Advance
    You can use some features in the build function of rpgPlayerview.
    1. open as fullscreen or not
    rpgwebview.isfullscreen(false/true).build()

    2. use your own evaluateJavascript as String
    rpgwebview
    .setevaluateJavascript(xxxxxx).build()
    3. Android save support
    As the limitation of Android system, the RMMV cannot store the save in the internal storage. I wrote a RMMV plugin to support it. It`s easy to use, just use my deployment method above to create your Android game project, and Add the "hh_Android_save.js" from here, and add it in your RMMV game project and turn on it.
    Remember to update the assets folder in your android project after modification
    After these stages, when you test and play the game, the game saves will be saved in the internal storage, right now the path will be in the root folder, you could only find out them if you rooted your phone.
    4. More features comming....


    本贴来自国际rpgmaker官方论坛作者:huhao1987处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/rmmv-android-deployment.120454/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 01:13 , Processed in 0.115838 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表