huhao1987

Villager
Member
Joined
Apr 21, 2020
Messages
5
Reaction score
6
First Language
English
Primarily Uses
RMMV
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.rpgPlayerView android: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....
 
Last edited:

Adar

Villager
Member
Joined
Jul 18, 2019
Messages
20
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
I am having problems in step 6, I am quite new to this, I do not know if you could help me with a recorded tutorial or with photos to be able to do it more easily
 

huhao1987

Villager
Member
Joined
Apr 21, 2020
Messages
5
Reaction score
6
First Language
English
Primarily Uses
RMMV
I am having problems in step 6, I am quite new to this, I do not know if you could help me with a recorded tutorial or with photos to be able to do it more easily
What`s the problems then?
 

Adar

Villager
Member
Joined
Jul 18, 2019
Messages
20
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
What`s the problems then?
I'm not sure where exactly to put the lines of code from step 6 (and 7) in "main activity". No matter where I put it, I always get error / red underline

Like I said earlier, I am quite a newbie
 

Attachments

  • Captura33.PNG
    Captura33.PNG
    40.8 KB · Views: 10

huhao1987

Villager
Member
Joined
Apr 21, 2020
Messages
5
Reaction score
6
First Language
English
Primarily Uses
RMMV
I'm not sure where exactly to put the lines of code from step 6 (and 7) in "main activity". No matter where I put it, I always get error / red underline

Like I said earlier, I am quite a newbie
Ok, please click the "layout" inside "res", you can find out a file named "activity_main.xml", double click it, then you will get the UI design view, choose the "Code" or "Split" on the right top if you are using Android studio 3 or 4, you are in the code area then.
 

Adar

Villager
Member
Joined
Jul 18, 2019
Messages
20
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
Ok, please click the "layout" inside "res", you can find out a file named "activity_main.xml", double click it, then you will get the UI design view, choose the "Code" or "Split" on the right top if you are using Android studio 3 or 4, you are in the code area then.
Well, I was able to do step 6. Now with step 8, I return to the "java" folder to the MainActivity file (there is "onCreate") or the one to the "res" folder? (I guess the one in the "java" folder)
Where do i put the code exactly?
 

huhao1987

Villager
Member
Joined
Apr 21, 2020
Messages
5
Reaction score
6
First Language
English
Primarily Uses
RMMV
Well, I was able to do step 6. Now with step 8, I return to the "java" folder to the MainActivity file (there is "onCreate") or the one to the "res" folder? (I guess the one in the "java" folder)
Where do i put the code exactly?
In the onCreate
 

Adar

Villager
Member
Joined
Jul 18, 2019
Messages
20
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
In the onCreate
Your help is greatly appreciated!
There are some problems with the apk which would be that the events are seen with black boxes, the custom songs are not heard, and there is a "hello world" in the middle of the screen.
 

Attachments

  • Screenshot_20200821-222734.png
    Screenshot_20200821-222734.png
    630.1 KB · Views: 15
  • Screenshot_20200821-223053.png
    Screenshot_20200821-223053.png
    873.9 KB · Views: 15

huhao1987

Villager
Member
Joined
Apr 21, 2020
Messages
5
Reaction score
6
First Language
English
Primarily Uses
RMMV
Your help is greatly appreciated!
There are some problems with the apk which would be that the events are seen with black boxes, the custom songs are not heard, and there is a "hello world" in the middle of the screen.
Try to override the activity_main file with this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<hh.rpgmakerplayer.webviewmodule.rpgPlayerView
android:id="@+id/webplayview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>

Then the hello world will be removed.

The black parts of the game is based on the screen size inside the game. You should edit the game project.
 

Adar

Villager
Member
Joined
Jul 18, 2019
Messages
20
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
Try to override the activity_main file with this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<hh.rpgmakerplayer.webviewmodule.rpgPlayerView
android:id="@+id/webplayview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>

Then the hello world will be removed.

The black parts of the game is based on the screen size inside the game. You should edit the game project.

I already tried different resolutions and the black box never disappeared. Did your exports fail with that error? If it is the resolution, pass me the one you used to see if that is the problem
 

Latest Threads

Latest Posts

Latest Profile Posts

Next goal is to make pull & push + lift & throw systems with mouse support and have skill levels in them and action indicators!
>What's your avatar about? Is it yours?
I did not do that drawing. It's a screenshot taken from a comic featuring characters from Touhou such as Tenshi and Iku (the girl in the avatar). It's drawn by someone under the name of Yohane.
Link to the comic (SFW, but navigating around Dynasty Reader is NSFW)
Progress on my game is nearly done, so I figured I show you guys the title screen. I hope you like it!
Title Screen.png
Does this ever happen to anyone?: your making a battle sprite [or any sprite] then when you mess something up you then see it as something diff, then working with it? its hard to say in words but it happens to me all the time
found out how to change pfp, literally there's a hidden thingy on the bottom of it

Forum statistics

Threads
109,167
Messages
1,042,666
Members
141,665
Latest member
beauty143
Top