Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
browser based app not working in android studio

I need to make a mobile app of a game I made, when I launch the HTML the app works just fine in the browser but when I put it all in android studio it launches the app, but it doesn't have any of the images and the button doesn't work. In my research, it should work right now, but it doesn't. I tried changing the layout from linear to relative in the .xml file but that didn't work. I tried finding things wrong in the HTML but it all seems fine as it works in the browser. this is the Java code I have for the Webview. I think its the only thing that could be wrong along with the xml since its the only things that changed when going from browser to app.

package com.example.wizardgamefr;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView webView = (WebView) findViewById (R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl ("file:///android_asset/main/index.html");

and here is the xml code

<?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"
    tools:context=".MainActivity">

    <WebView
        android:id="@+id/webView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:layout_editor_absoluteX="1dp"
        tools:layout_editor_absoluteY="1dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentTop="true">

    </WebView>


</RelativeLayout>

I dont know why the buttons dont work and why the images wont load. As I don't have any experience in this at all.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!