Android Back Button

Al-Farizi

Lv 87 Warrior
Veteran
Joined
Oct 2, 2019
Messages
32
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hello there noob here

I'm Al-Farizi i want to develop a game for mobile and the game is still development i hope the game Will be popular:)

But i have some problem with the back button

The default back button in rmmv is two tap fingers right?

Can someone make a plugin for replace it with Android back button
Example:images (3)-picsay.png

Can someone help me pleasee:(
I really want to make a RPG maker MV games good too for mobile
 

Al-Farizi

Lv 87 Warrior
Veteran
Joined
Oct 2, 2019
Messages
32
Reaction score
1
First Language
English
Primarily Uses
RMMV
i don't really understand, but which one do you need?
Yes that's what i need can i get the TM Back Button plugin?
Btw sorry for my bad English
 

Al-Farizi

Lv 87 Warrior
Veteran
Joined
Oct 2, 2019
Messages
32
Reaction score
1
First Language
English
Primarily Uses
RMMV

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
replace the two fingers tap with Android back navigation, did u know the plugin for that?
This would require this very small plugin which will disable the DualTouch/RightClick for the menu.
...but more importantly for what you require not a plugin but a change to the java activity file you use would be how to change what the back button does.
For example:
If using code by xilefian (aka. felixjones) as the core for the android app you would simply change the "onBackPressed" function ...
from:
Code:
    @Override
    public void onBackPressed() {
        if (BuildConfig.BACK_BUTTON_QUITS) {
            if (mQuitDialog != null) {
                mQuitDialog.show();
            } else {
                super.onBackPressed();
            }
        } else {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
        }
    }
...to this:
Code:
    @Override
    public void onBackPressed() {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
    }
...Basically more info may be required on how you are going about building the android app & it's a change to a "java" file not javascript so don't think a plugin (traditional at least) will be able to be developed to work with the android back button.

Edit:
Hmm... Scratch all that lol
I may have done it. I made a plugin that might do this as needed.
Can't test right now but I'll test when I can.
Please let me know if you try it out before me, let me know if that works I may have done it...
CTB_AndroidBackButton.js

That also includes the DisableClickDualTouchMenu fix too so only need the one plugin file :)
 

Attachments

Last edited:

Al-Farizi

Lv 87 Warrior
Veteran
Joined
Oct 2, 2019
Messages
32
Reaction score
1
First Language
English
Primarily Uses
RMMV
This would require this very small plugin which will disable the DualTouch/RightClick for the menu.
...but more importantly for what you require not a plugin but a change to the java activity file you use would be how to change what the back button does.
For example:
If using code by xilefian (aka. felixjones) as the core for the android app you would simply change the "onBackPressed" function ...
from:
Code:
    @Override
    public void onBackPressed() {
        if (BuildConfig.BACK_BUTTON_QUITS) {
            if (mQuitDialog != null) {
                mQuitDialog.show();
            } else {
                super.onBackPressed();
            }
        } else {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
        }
    }
...to this:
Code:
    @Override
    public void onBackPressed() {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
    }
...Basically more info may be required on how you are going about building the android app & it's a change to a "java" file not javascript so don't think a plugin (traditional at least) will be able to be developed to work with the android back button.

Edit:
Hmm... Scratch all that lol
I may have done it. I made a plugin that might do this as needed.
Can't test right now but I'll test when I can.
Please let me know if you try it out before me, let me know if that works I may have done it...
CTB_AndroidBackButton.js

That also includes the DisableClickDualTouchMenu fix too so only need the one plugin file :)
Really thanks i'll try it, thank you so much
 

Al-Farizi

Lv 87 Warrior
Veteran
Joined
Oct 2, 2019
Messages
32
Reaction score
1
First Language
English
Primarily Uses
RMMV
This would require this very small plugin which will disable the DualTouch/RightClick for the menu.
...but more importantly for what you require not a plugin but a change to the java activity file you use would be how to change what the back button does.
For example:
If using code by xilefian (aka. felixjones) as the core for the android app you would simply change the "onBackPressed" function ...
from:
Code:
    @Override
    public void onBackPressed() {
        if (BuildConfig.BACK_BUTTON_QUITS) {
            if (mQuitDialog != null) {
                mQuitDialog.show();
            } else {
                super.onBackPressed();
            }
        } else {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
        }
    }
...to this:
Code:
    @Override
    public void onBackPressed() {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
    }
...Basically more info may be required on how you are going about building the android app & it's a change to a "java" file not javascript so don't think a plugin (traditional at least) will be able to be developed to work with the android back button.

Edit:
Hmm... Scratch all that lol
I may have done it. I made a plugin that might do this as needed.
Can't test right now but I'll test when I can.
Please let me know if you try it out before me, let me know if that works I may have done it...
CTB_AndroidBackButton.js

That also includes the DisableClickDualTouchMenu fix too so only need the one plugin file :)
Screenshot_2020-03-26-20-40-29-796_id.LonelyG.app.png well it's doesn't work, but i'll try use the pure new project
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
View attachment 137928 well it's doesn't work, but i'll try use the pure new project
Ok good to know, figured that was too simple.
Try just changing the "onBackPressed" in your <activity name here>.java file from:
Code:
@Override
    public void onBackPressed() {
        if (BuildConfig.BACK_BUTTON_QUITS) {
            if (mQuitDialog != null) {
                mQuitDialog.show();
            } else {
                super.onBackPressed();
            }
        } else {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
        }
    }
to:
Code:
@Override
    public void onBackPressed() {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
    }
...If you have the function onBackPressed() in your java activity file that is.

The "ActivityFileName.java" would probably be in a folder like this:
Code:
.\AndroidApp\app\src\main\java\packageNamePartA\packageNamePartB\packageNamePartC\ActivityFileName.java
I'll look further into a plugin but that's the best way to do it manually until then.
 

Al-Farizi

Lv 87 Warrior
Veteran
Joined
Oct 2, 2019
Messages
32
Reaction score
1
First Language
English
Primarily Uses
RMMV
Ok good to know, figured that was too simple.
Try just changing the "onBackPressed" in your <activity name here>.java file from:
Code:
@Override
    public void onBackPressed() {
        if (BuildConfig.BACK_BUTTON_QUITS) {
            if (mQuitDialog != null) {
                mQuitDialog.show();
            } else {
                super.onBackPressed();
            }
        } else {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
        }
    }
to:
Code:
@Override
    public void onBackPressed() {
            mPlayer.evaluateJavascript(TOUCH_INPUT_ON_CANCEL);
    }
...If you have the function onBackPressed() in your java activity file that is.

The "ActivityFileName.java" would probably be in a folder like this:
Code:
.\AndroidApp\app\src\main\java\packageNamePartA\packageNamePartB\packageNamePartC\ActivityFileName.java
I'll look further into a plugin but that's the best way to do it manually until then.
Thank you very much for the information, for now i'll try manually until the plugin is out
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,236
Members
137,608
Latest member
Arm9
Top