# Using the webbrowser with Android and WebRTC - 4.20

**URL:** <https://forums.unrealengine.com/t/using-the-webbrowser-with-android-and-webrtc-4-20/117556>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [October 16, 2018, 7:49am UTC](https://forums.unrealengine.com/t/using-the-webbrowser-with-android-and-webrtc-4-20/117556 "2018-10-16T07:49:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_19b94e2b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_19b94e2b1](https://forums.unrealengine.com/u/anonymous_user_19b94e2b1)\
**Post date:** [October 16, 2018, 7:49am UTC](https://forums.unrealengine.com/t/using-the-webbrowser-with-android-and-webrtc-4-20/117556/1 "2018-10-16T07:49:30Z")

</div>

Hi!  
I’m creating a small VR app that requires two web browsers playing at the same time. It works flawlessly on PC, but the resolution and framerate go super wonky on an android phone.  
Also, the only seems to be working just a properly resolution (without any kind of stretching) which is 500x500. I’ve found that value hardcoded in two android web browser constructors, both C++ and Java, but when trying to change that value to any other number, I meet the following error:

```auto

Error 'USE_ANDROID_JNI' is not defined, evaluates to 0 -Werror,-Wundef] VNT_Android_Opt C:\...\UnrealEngine\Engine\Source\Runtime\WebBrowser\Private\Android\AndroidWebBrowserWindow.h 5  

```

The code I’m changing is:

Inside AndroidWebBrowserWindow.cpp

```auto

 FAndroidWebBrowserWindow::FAndroidWebBrowserWindow(FString InUrl, TOptional<FString> InContentsToLoad, bool InShowErrorMessage, bool InThumbMouseButtonNavigation, bool InUseTransparency, bool bInJSBindingToLoweringEnabled)
    : CurrentUrl(MoveTemp(InUrl))
    , ContentsToLoad(MoveTemp(InContentsToLoad))
    , bUseTransparency(InUseTransparency)
    , DocumentState(EWebBrowserDocumentState::NoDocument)
    , ErrorCode(0)
    , Scripting(new FAndroidJSScripting(bInJSBindingToLoweringEnabled))
    , AndroidWindowSize(FIntPoint(500, 500))
{
}

```

To:

```auto

FAndroidWebBrowserWindow::FAndroidWebBrowserWindow(FString InUrl, TOptional<FString> InContentsToLoad, bool InShowErrorMessage, bool InThumbMouseButtonNavigation, bool InUseTransparency, bool bInJSBindingToLoweringEnabled)
    : CurrentUrl(MoveTemp(InUrl))
    , ContentsToLoad(MoveTemp(InContentsToLoad))
    , bUseTransparency(InUseTransparency)
    , DocumentState(EWebBrowserDocumentState::NoDocument)
    , ErrorCode(0)
    , Scripting(new FAndroidJSScripting(bInJSBindingToLoweringEnabled))
    , AndroidWindowSize(FIntPoint(1280, 720))
{
}

```

Just the last line. It makes the project uncompilable.

So I thought it might be hardcoded somewhere else, and I found it on WebViewControl.java (Build/Android/Java/src/com/epicgames/ue4):

```auto

private static int initialWidth = 500;
private static int initialHeight = 500;

```

Is there any need to regenerate something before changing the android’s related code?

The whole combination of problems I’m experiencing with Android web browser inside VR is:

1. Slowness: Framerate of the video on PC is around 20fps (that’s what we are sending from the server, so it is ok), android 1 - 2 fps when its best.
2. Resolution madness: It will ignore any changes on the widget and just stretch the image somehow. Is there any kind of documentation around this? Standard UI documentation on Android does not work properly with the integrated Web browser.

Thank you for reading me!  
I would appreciate any kind of light shed on this issue.

Cheers,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_19b94e2b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_19b94e2b1](https://forums.unrealengine.com/u/anonymous_user_19b94e2b1)\
**Post date:** [October 17, 2018, 11:18am UTC](https://forums.unrealengine.com/t/using-the-webbrowser-with-android-and-webrtc-4-20/117556/2 "2018-10-17T11:18:12Z")

</div>

To anyone wondering, it was an issue with the UnityBuild system for building the project. In the very beginning of the build, a message saying that the class AndroidWebBrowserWindow was excluded from the unity build, causing it to lose all the references to anything previously define, just like the USE\_ANDROID\_JNI or any other definition.  
After some obscure digging in the forums, I found this:  
[Link to the post](https://forums.unrealengine.com/development-discussion/engine-source-github/86866-pdb-files-and-issues-with-incorrect-code)  
In which they explain a bit about the UnityBuild system.  
So, in the end, having this file as BuildConfiguration.xml

```auto

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <BuildConfiguration>
        <bUseUnityBuild>false</bUseUnityBuild>
    </BuildConfiguration>
</Configuration>

```

Under **Engine\Saved\UnrealBuildTool.…**  
Seems to have fixed the build issue. Furthermore, the problem with the resolution was not on the .java file, it seems the android desired size of the browser is hardcoded to 640x480… So… yeah, changing it to our expected resolution fixed the first issue also.

Cheers,

---

<div class="post-metadata">

**Author:** ![Loeizd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Loeizd](https://forums.unrealengine.com/u/Loeizd)\
**Post date:** [February 12, 2020, 3:07am UTC](https://forums.unrealengine.com/t/using-the-webbrowser-with-android-and-webrtc-4-20/117556/3 "2020-02-12T03:07:48Z")

</div>

I have the same problem on the Oculus Quest, the web browser can’t render at more than 500x500, whatever I do. I tried changing the build config xml, but with no luck.

Using 4.23

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_66742889](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_66742889](https://forums.unrealengine.com/u/anonymous_user_66742889)\
**Post date:** [July 30, 2022, 10:26pm UTC](https://forums.unrealengine.com/t/using-the-webbrowser-with-android-and-webrtc-4-20/117556/4 "2022-07-30T22:26:22Z")

</div>

I’m also having trouble playing on the Oculus Quest. The web browser won’t let me play in anything higher than 500x500, no matter what I do. I tried modifying the build configuration XML, but without success.

---

<div class="post-metadata">

**Author:** ![ganbaa\_elmer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ganbaa_elmer/32/476547_2.png) [@ganbaa\_elmer](https://forums.unrealengine.com/u/ganbaa_elmer)\
**Post date:** [September 7, 2022, 1:06pm UTC](https://forums.unrealengine.com/t/using-the-webbrowser-with-android-and-webrtc-4-20/117556/5 "2022-09-07T13:06:36Z")

</div>

in my android web browser nothing works. can you explain how to work 500x500 to ue4 android game?
