Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 25 posts ] 

Have you successfully deployed an Android APK with this tutorial?
Yes 80%  80%  [ 4 ]
No 20%  20%  [ 1 ]
Total votes : 5
    Xilef
  Thu Sep 28, 2017 3:40 pm
User avatar
Staff

Big Dumb Guy

Location: UK
Index

  • Prerequisites
  • Creating the Android app
  • Testing (Optional)
  • Create Debug APK
  • Customisation
  • Crosswalk vs WebView

What is the MV Android Client

The MV Android Client is a runtime client for the Android™ operating system intended to play games created with the RPG Maker MV game development tool-kit.


The tutorial uses the MV Android Client to compile an RPG Maker MV project for Android (deployed as an Android APK).

Prerequisites

MV Android Client

Obtain the MV Android Client source code from the URL:
github.com/AltimitSystems/mv-android-client/zipball/master
Or by cloning the GitHub repository with git:
github.com/AltimitSystems/mv-android-client.git

This is a zip folder of the latest version of the MV Android Client.

Extract this zip folder to a memorable location (such as your computer Desktop folder).

Development Environment

The official IDE for Android application development is Android Studio by Google.

Android Studio can be downloaded for macOS, Microsoft Windows and Linux at the following URL:
developer.android.com/studio

The Android Studio install instructions for your platform can be found at the following URL: developer.android.com/studio/install.html

Android SDK Libraries

When opening Android Studio for the first time, you will be presented with a welcome window describing the version of Android Studio you have installed with some quick options for creating a project.

Image

If this is not the first time you are opening Android Studio and you are presented with a previous project, you can reach the welcome window by closing your current project from the File menu and then selecting Close Project.

At the lower right of the welcome window is the Configure menu. Open this menu and select SDK Manager to start the Android SDK Manager. This is where you can download the required Android SDK libraries for a project.

You may also open the Android SDK Manager from within an opened project via the Tools menu, selecting the Android sub menu and then choosing the SDK Manager.

Required SDK Platforms

The Android SDK Manager has three tabs; SDK Platforms, SDK Tools and SDK Update Sites.

To download the required SDK Platforms, make sure the SDK Platforms tab is selected. This is where you can download the development libraries for the many versions of Android.

It is usually best to select the most recent version of Android for installation. As of the writing of this tutorial, the most recent version of Android is "Android 8.0 (Oreo)".

Check the box to the left of the version of Android you wish to install the SDK for and click Apply to begin downloading the required SDK Platforms.

Image

Required SDK Tools

Once the SDK Platform is downloaded, select the SDK Tools tab to begin downloading the tools needed for developing Android apps.

From this list, check the boxes to the left of the following SDK Tools:

  • Android SDK Build-Tools
  • Android SDK Platform-Tools
  • Android SDK Tools
  • Support Repository

Image

If you wish to test your app on a real device you may need to also check the Google USB Driver if you are on Windows.

Click Apply to begin downloading the required SDK Tools.

Deployed RPG Maker MV Project

To prepare your RPG Maker MV project for Android you must export it from the File menu, selecting the Deployment... option.

Image

In the Deployment window that appears, make sure the Android / iOS Platform is selected. You may check the Exclude unused files option, however this may break some Plugins that depend on additional files.

Image

Remember to select an Output Location for the deployment, you can do this by clicking the Choose... button. You will need to find this output location later so make sure it's in an easy to find, memorable place (such as your computer Desktop folder).

Click OK to begin the deployment.

Creating the Android app

Open MV Android Client

From the Android Studio welcome screen, select Open an existing Android Studio project.

Find the folder where you extracted the MV Android Client source code downloaded at the beginning of the Prerequisites section.

Image

Select this folder so it is highlighted and then click OK. It may take some time for Android Studio to build the project after opening it.

Wait for the project to settle in Android Studio. The project will automatically download additional libraries that it needs, so an internet connection is required for loading the project.

Image

Once everything is settled, expand the Project tab at the upper far left and expand the Build Variants tab at the lower far left.

Expanding the app folder in the Project tab should have the manifests, java code and xml values.

The Build Variants section can be used to switch between Crosswalk and WebView as the default web-engine.

Image

Crosswalk development ended in January 2017, so it is better to use WebView, however older devices may not be fully compatible with WebView features. See the end of this tutorial for a more in-depth explanation on Crosswalk vs WebView.

Import deployed RPG Maker MV project

Create Assets folder

If the Assets folder is not visible within the app folder of Android Studio then it must be created. The Assets folder is used to store the deployed RPG Maker MV project.

Right-click on the app folder to open the context menu. Open the New submenu, then open the Folder submenu lower down. From here, click the Assets Folder to begin creating the Assets folder.

Image

Simply click OK on the window that appears.

Image

Copy RPG Maker MV project files

Find the deployed RPG Maker MV project that you created during the Prerequisites. Inside here should be a www folder.

Image

Select the www folder so it is highlight and copy this folder by right-clicking on it and selecting the copy option.

Back in Android Studio, you want to now right-click on the Assets folder and paste the www folder by selecting the paste option.

Image

In the Copy window that appears, make sure Open copy in editor is un-checked to prevent the MV project files from opening in Android Studio and then click OK.

Image

Depending on the size of your MV project, it may take a while to copy it into Android Studio.

Modify applicationId

The Android applicationId must be unique to your project.

Expand the Gradle Scripts and open the build.gradle (Module: app) file.

Image

You should see something similar to the above image. Find the line inside defaultConfig that has applicationId.

Image

Change the text inside the quotes to a new applicationId. Android applicationIds must contain no spaces and must be lower-case Latin characters with periods between each word.

Generally, they are domain names in reverse with the app name at the end. An example for a project call "Adventure" made at HBGames.org would be "org.hbgames.adventure".

If you do not have a website domain, you can use your first and last name. A project called "Owl Chronicles" by someone called "Harry Potter" would be "potter.harry.owlchronicles".

It must be unique to your project and your studio.

Testing (optional)

If you have an Android phone you may connect it to your computer to test your MV project directly.

A guide for setting up a phone for testing is available at this URL:
developer.android.com/studio/run/device.html

Alternatively, you may create an Android emulator instance. An emulator runs on your computer and does not require an Android phone.

A guide for setting up an emulator instance for testing is available at this URL:
developer.android.com/studio/run/emulator.html

Create Debug APK

From Android Studio, select Build and then click Build APK.

Image

This will compile and build your app, which may take some time. When it is complete, at the lower right of Android Studio you will see a confirmation message with a handy link to your APK.

Image

Clicking the link will open up the folder for you, where you can copy and share the APK.

Image

This is a debug APK, so it is not ready for publishing to the Google Play Store. This tutorial will not cover publishing a release APK and support will not be given for issues related to APKs built for release. For information on creating a release APK see the URL:
developer.android.com/studio/publish

Customisation

Most of the customisation can be done within the values.xml file.

Image

App Name

To rename your app, open the values.xml file and find the app_name entry. By default, the app is called RPG Maker MV.

Unicode must be used for non-Latin characters (such as Chinese characters). Use a unicode converter to generate these for XML.

App Website

The website URL is configured in the values.xml file. Change the app_host to your website domain and app_scheme to HTTP or HTTPS. As an example, if my website is http://www.hbgames.org then my app_scheme will be "http" and my app_host will be "hbgames.org".

After that, my website will need to be associated with the app. See the section "Associate your app with your website" at the URL:
developer.android.com/studio/write/app-link-indexing.html

App Icon

Open up the res/mipmap folders to view the app icons.

Image

There are multiple icons here to handle the different versions of Android and the different sized icons for different devices.

You may delete all these icons to remove the default icon, however you must replace the icons with two icons, one named "app_icon" and another named "app_icon_round".

These can be PNG images, or you can create them with Android Studio by right-clicking on the mipmap folder, opening the New submenu and selecting Image Asset.

A guide for the Image Asset Studio is at the URL:
developer.android.com/studio/write/image-asset-studio.html

Remember to have two icons named "app_icon" and "app_icon_round"! Ideally, app_icon_round would be a circular icon.

Image Image

Crosswalk vs WebView

Crosswalk is an Intel project that aimed to create a portable WebView alternative for Android that worked across multiple versions of Android. crosswalk-project.org

You may know of Crosswalk from Intel XDK, Cordova and PhoneGap. It is also featured as part of the "official" Android deployment guide for RPG Maker MV.

Modern Android has separated the WebView component from the operating system, so now old versions of Android can receive critical security updates for WebView without needing a complete operating system update. This has made Crosswalk redundant as Crosswalk's main goal was to provide WebView updates for old versions of Android.

So why use Crosswalk? Unfortunately, WebView updates haven't enabled some features for older devices. Namely, WebAudio and WebGL might not be available for old Android phones. Crosswalk may have these implemented for old devices, so with Crosswalk there is a possibility that compatibility can be improved.

This is not a win-win situation, however. WebView can work on even older version of Android than Crosswalk (Going as far back as Android 3.0 Honeycomb API 11). WebView may even be faster than Crosswalk for newer devices.

The critical difference is that Crosswalk is no-longer in development, so it will not receive security updates. If a bug appears in Crosswalk that allows people to hack devices and break phones through your app or game then you're out of luck. With WebView, an update from Google will fix the issue rapidly.

WebView is also a core part of Android itself. Using Crosswalk can increase the size of the APK as all the Crosswalk libraries and files for all the potential versions of Android and phone devices need to be included as well.

The recommendation from security-conscious developers such as myself is that WebView should be used and Crosswalk avoided. Crosswalk should be used at your own risk.

If a serious security issue for Crosswalk does appear in the future, it will be removed from future versions of the MV Android Client.


Top Top
Profile      
 

    Synmbios
  Mon Jan 15, 2018 8:20 pm
Member

L1 Slime
Hello there,

First: Congratulations on this amazing work, you did a really special thing for the comunity by sharing this tool with us. Thank you. I'm working on a game since 2016 and so far was using other tools to test the .apk on devices. All other tools are too complex or don't work. And I had no problem with MV Android Client, so... thank you again.

Second: I have a question, I builded an .apk with the "webviewRelease" option and it didn't install on my device, could you tell me why? After the download and when I try to install it says only: "app not installed". I'm new to develop to mobile, so any information is apreciated.

Thanks


Top Top
Profile      
 

    Xilef
  Mon Jan 15, 2018 8:25 pm
User avatar
Staff

Big Dumb Guy

Location: UK
Synmbios wrote:
I builded an .apk with the "webviewRelease" option and it didn't install on my device, could you tell me why? After the download and when I try to install it says only: "app not installed". I'm new to develop to mobile, so any information is apreciated.

Thanks
Unfortunately support is not given for apps built in Release mode, signed apps or apps targeting a store.

Luckily these errors are common in the Android community, so you will be able to Google search for a solution. I think the best keywords to use would be: Android Studio Release mode "app not installed". If you cannot find a solution, then consider asking on StackOverflow: https://stackoverflow.com


Top Top
Profile      
 

    dragonx777
  Wed Mar 14, 2018 12:07 am
Member

L1 Slime
I tried loading the AS project that this tutorial said to download, however, my PC sits and the program then does nothing. I am using AS 3.0.1. Any help would be greatly appreciated.


Top Top
Profile      
 

    Xilef
  Wed Mar 14, 2018 3:20 pm
User avatar
Staff

Big Dumb Guy

Location: UK
dragonx777 wrote:
I tried loading the AS project that this tutorial said to download, however, my PC sits and the program then does nothing. I am using AS 3.0.1. Any help would be greatly appreciated.

This could be a billion, million different things. Could your PC be too weak to use Android Studio?

These are the current requirements for Android Studio:
  • 3 GB RAM minimum, 8 GB RAM recommended; plus 1 GB for the Android Emulator
  • 2 GB of available disk space minimum, 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)
  • 1280 x 800 minimum screen resolution


Top Top
Profile      
 

    hiruma13
  Fri Jul 20, 2018 9:17 pm
Member

L1 Slime
https://forums.rpgmakerweb.com/index.php?attachments/andro-jpg.94717/
I have a problem with your source Sir... When In this step"Select Open an existing Android Studio project.."
I still do not understand. What is the solution ? I'm stuck in thare..
Please Help me ...:hsad::hswt2: @xilefian


Top Top
Profile      
 

    Xilef
  Fri Jul 20, 2018 10:39 pm
User avatar
Staff

Big Dumb Guy

Location: UK
hiruma13 wrote:
https://forums.rpgmakerweb.com/index.php?attachments/andro-jpg.94717/
I have a problem with your source Sir... When In this step"Select Open an existing Android Studio project.."
I still do not understand. What is the solution ? I'm stuck in thare..
Please Help me ...:hsad::hswt2: @xilefian

Go to File -> Close project to get back to that screen.


Top Top
Profile      
 

    starlord
  Wed Jul 25, 2018 2:50 am
Member

L1 Slime
good tutorial, thx
but how about some insight in using libandroidapi
i'm interested in using user-reachable storage for the save files instead of webstorage


Top Top
Profile      
 

    Xilef
  Wed Jul 25, 2018 1:27 pm
User avatar
Staff

Big Dumb Guy

Location: UK
starlord wrote:
good tutorial, thx
but how about some insight in using libandroidapi
i'm interested in using user-reachable storage for the save files instead of webstorage

Go into StorageManager.js.

There is a function "StorageManager.isLocalMode"
Change that to:
Expand to see the code.


Then search for any lines in StorageManager that use "require( 'fs' )" and replace them with:
Expand to see the code.


The libandroidapi is supposed to be an Android clone of NWJS's node implementation, at the moment a minimal version of path and fs is implemented, allowing local storage to be enabled this way.

The res/raw directory has the Javascript source of libandroidapi, look at those to see what is available: https://github.com/AltimitSystems/mv-an ... in/res/raw


Top Top
Profile      
 

    starlord
  Wed Jul 25, 2018 11:46 pm
Member

L1 Slime
Xilef wrote:
starlord wrote:
good tutorial, thx
but how about some insight in using libandroidapi
i'm interested in using user-reachable storage for the save files instead of webstorage

Go into StorageManager.js.

There is a function "StorageManager.isLocalMode"
Change that to:
Expand to see the code.


Then search for any lines in StorageManager that use "require( 'fs' )" and replace them with:
Expand to see the code.


The libandroidapi is supposed to be an Android clone of NWJS's node implementation, at the moment a minimal version of path and fs is implemented, allowing local storage to be enabled this way.

The res/raw directory has the Javascript source of libandroidapi, look at those to see what is available: https://github.com/AltimitSystems/mv-an ... in/res/raw

nice, my implementation wasn't that far away from your code :toot:
but i encountered 1 small problem when using external storage
Expand to see the code.

i had to delay the call of Scene_Boot() by 2 seconds, to get a config.rpgsave to load properly :o:
any ideas why?


Top Top
Profile      
 

    Xilef
  Thu Jul 26, 2018 12:54 am
User avatar
Staff

Big Dumb Guy

Location: UK
starlord wrote:
i had to delay the call of Scene_Boot() by 2 seconds, to get a config.rpgsave to load properly :o:
any ideas why?

I would imagine it's because of the way I had to get the Android API to hook into RPG Maker MV. The RPG Maker index HTML document is loaded first, which automatically loads all the Javascript in your project (normal and expected) - after this is done the MV Android hooks are loaded in - which means that it's done after everything else is initialised. It's an unforunate quirk that I didn't think was possible to resolve reasonably (still not sure it's reasonably possible to resolve. Best thing I can think of is running a script to modify project code but that's not ideal in the slightest).


Top Top
Profile      
 

    starlord
  Thu Jul 26, 2018 7:09 am
Member

L1 Slime
Xilef wrote:
starlord wrote:
i had to delay the call of Scene_Boot() by 2 seconds, to get a config.rpgsave to load properly :o:
any ideas why?

I would imagine it's because of the way I had to get the Android API to hook into RPG Maker MV. The RPG Maker index HTML document is loaded first, which automatically loads all the Javascript in your project (normal and expected) - after this is done the MV Android hooks are loaded in - which means that it's done after everything else is initialised. It's an unforunate quirk that I didn't think was possible to resolve reasonably (still not sure it's reasonably possible to resolve. Best thing I can think of is running a script to modify project code but that's not ideal in the slightest).

nah, nothing to worry about it
a splash screen for 2 sec before the actual game start and all works perfectly
thx again for your framework :thumb:


Top Top
Profile      
 

    Jodek
  Thu Nov 08, 2018 3:51 pm
Member

L1 Slime
First of all, I thank you for your hard work, but right after opening AltimitSystems-mv-android-client-329ce94 in my Android Studio, I have a few problems that I don`t know what they mean.
Image


Top Top
Profile      
 

    Xilef
  Thu Nov 08, 2018 7:35 pm
User avatar
Staff

Big Dumb Guy

Location: UK
Jodek wrote:
First of all, I thank you for your hard work, but right after opening AltimitSystems-mv-android-client-329ce94 in my Android Studio, I have a few problems that I don`t know what they mean.
Image

Update lines 50 and 51 in that file to this:
   implementation 'com.google.android.gms:play-services-games:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'

The libgoogleplay will need updating. I'll do that at some point, but in the future I have ideas on removing these extensions altogether as they will cause issues like this as compatibility changes and they were apparently a failure of an idea (wanted people to build Android Plugins, but besides libgoogleplay there hasn't been anything from the community).

EDIT: I've gone ahead and fixed the github project. Re-download and it should now be fine.


Top Top
Profile      
 

    Payner
  Thu Dec 06, 2018 11:21 am
Member

L1 Slime
Very good tutorial, thanks!


Last edited by Payner on Fri Dec 07, 2018 3:54 pm, edited 1 time in total.

Top Top
Profile      
 

    Xilef
  Thu Dec 06, 2018 3:45 pm
User avatar
Staff

Big Dumb Guy

Location: UK
Thank you. Please keep in mind this is an English speaking community so if possible please use English or pair your message up with a machine translation.


Top Top
Profile      
 

    Eremis_Dienyzus
  Sun Dec 09, 2018 6:42 pm
Member

L1 Slime
It shows this while i was testing mine
"Error while executing: am start -n "systems.altimit.rpgmakermv/systems.altimit.rpgmakermv.WebPlayerActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=systems.altimit.rpgmakermv/.WebPlayerActivity }
Error type 3
Error: Activity class {systems.altimit.rpgmakermv/systems.altimit.rpgmakermv.WebPlayerActivity} does not exist.

Error while Launching activity"


Top Top
Profile      
 

    Xilef
  Sun Dec 09, 2018 9:42 pm
User avatar
Staff

Big Dumb Guy

Location: UK
Eremis_Dienyzus wrote:
It shows this while i was testing mine
"Error while executing: am start -n "systems.altimit.rpgmakermv/systems.altimit.rpgmakermv.WebPlayerActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=systems.altimit.rpgmakermv/.WebPlayerActivity }
Error type 3
Error: Activity class {systems.altimit.rpgmakermv/systems.altimit.rpgmakermv.WebPlayerActivity} does not exist.

Error while Launching activity"
This Stack Overflow question answer this problem: https://stackoverflow.com/questions/209 ... -not-exist

You're more likely to come up with issues related to Android Studio than MV Android Client, so it's always best to Google search your problem before asking here as it will be faster to Google search than to wait for me to see your message. In this case, Google'ing "Android Error Type 3" led me to that Stack Overflow post immediately.


Top Top
Profile      
 

    CeliceHolyKnight
  Tue Mar 19, 2019 5:43 pm
Member

L1 Slime
The app crashes when i run it, the error says: ERR_FILE_NOT_FOUND, can someone help me, please?


Top Top
Profile      
 

    Xilef
  Tue Mar 19, 2019 6:01 pm
User avatar
Staff

Big Dumb Guy

Location: UK
CeliceHolyKnight wrote:
The app crashes when i run it, the error says: ERR_FILE_NOT_FOUND, can someone help me, please?

It'll say this if it can't find the file:///android_asset/www/index.html folder - did you correctly copy the exported MV WWW folder into the Android Studio Assets folder? Scroll up to the "Import deployed RPG Maker MV project" section of the tutorial and follow it closely.

Notice that the WWW folder is copied, this is vitally important! If you're having trouble you can also copy the WWW folder via your operating system's file manager into the app/src/main/assets directory, if the assets folder does not exist then that's your problem and you need to create it.


Top Top
Profile      
 

    JustAPo
  Wed May 29, 2019 10:03 pm
Member

L1 Slime
First off - Thank you for taking the time to make this a reality. It is great!

I do seem to be running into an issue when I'm using Yanfly's plugins (RegionRestrictions/WeaponAnimation etc.) they seem to work correctly when deployed as a windows version, however as soon as I get this open and running on a phone it appears to throw previously unseen errors.

Any help, or an idea where I can go to research more on this issue would be greatly appreciated.

Thank you once again,


JustAPo


Top Top
Profile      
 

    Xilef
  Wed May 29, 2019 10:57 pm
User avatar
Staff

Big Dumb Guy

Location: UK
This is something the Plugin developer needs to solve. Some Plugins use features that are only available on the desktop version of RMMV, they ignore compatibility with the Web and Mobile deployment options, so you will need to consult with the developer directly, I'm afraid.

The MV Android client does nothing special, so Plugin compatibility really is down to the Plugin developer themselves and how whether they are invested in the non-desktop deployments for MV.


Top Top
Profile      
 

    jamzkie143
  Mon Aug 19, 2019 2:43 am
Member

L1 Slime
Hi, thank you very much for this.

It's working very well on my export.

Just one question: Is there a way to make it lock to portrait view?

My game resolution is 432 x 1280, and it exports to landscape view.


Top Top
Profile      
 

    Xilef
  Tue Aug 20, 2019 11:59 am
User avatar
Staff

Big Dumb Guy

Location: UK
jamzkie143 wrote:
Is there a way to make it lock to portrait view?

Change this line https://github.com/AltimitSystems/mv-an ... st.xml#L31 from "sensorLandscape" to "portrait"


Top Top
Profile      
 

    KurioHonoo
  Sat Aug 31, 2019 3:21 am
Member

L1 Slime
Thanks for you're awesome work! I'm currently trying to figure out how to let the game use local storage, but it looks like you removed the res/raw folder with the androidRequire files sometime ago. Could you point me in the right direction or possible just flat out show me exactly what I need to do?

Thanks!


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ] 


Who is online

Users browsing this forum: No users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group