Creating an Android application using three.js and Cordova technology

I'm struggling with my 3D Android app developed using Cordova and Three.js. It seems to be working fine on some devices like ASUS and OnePlus, but it's not functioning properly on HTC One X and Samsung S6. The screen simply remains blank without any error messages. Here is a snippet of my JavaScript code:

    var renderer = new THREE.WebGLRenderer( { antialias: true } );
    renderer.setPixelRatio( window.devicePixelRatio );
    renderer.setSize( window.innerWidth, window.innerHeight );
    $('#wrapper').html(renderer.domElement);
    element = renderer.domElement;
    var scene = new THREE.Scene();
    var camera = new THREE.PerspectiveCamera(100, window.innerWidth / window.innerHeight, 0.1, 10000);
    camera.position.set(0, 0, 0);
    var effect = new THREE.StereoEffect(renderer);
    effect.setSize( window.innerWidth, window.innerHeight );
    var axis = new THREE.AxisHelper(70000.5);
    //scene.add(axis);
    var cube = new THREE.Mesh( new THREE.CubeGeometry( 2.5, 4, 2.5 ), new THREE.MeshNormalMaterial() );
    cube.position.z=-4;
    scene.add( cube );
    var lastTimeMsec = null;

    function animate(timestamp) {
    effect.render( scene, camera );
    requestAnimationFrame(animate);
    }
    animate();

If anyone has encountered a similar issue or knows what could be causing this problem, please provide your insights. Thank you in advance.

Answer №1

Prior to building, it is necessary to set up the cordova plugin (cordova-plugin-crosswalk-webview) in order for three.js to be compatible with all devices.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Reverse typing phenomenon

I am currently working on creating a unique backwards typing effect in my code. I want the <P> tag to initially display "Coming Soon" and then type out that phrase backwards before transitioning forward to "SeaDogs.com.eu.as" As of now, I have made ...

Add an active CSS class to a block upon page reload

I'm having a bit of trouble with my HTML code. Here's what it looks like: <div class="side-button"> <a href="/first"> First Option <a> </div> <div class="side-button"> <a href="/second"> Second Opti ...

Tips for successfully transferring values from an onclick event in JavaScript to a jQuery function

I am encountering a challenge with an image that has an onclick function associated with it. <img id='1213' src='img/heart.png' onclick='heart(this.id)'> This particular function needs to be triggered : function heart ...

xhr.send(params) allows for sending multiple parameters in one request

Hey there, I'm looking for guidance on passing multiple parameters with the correct syntax. Can someone please assist me? function formSubmit() { var name = document.getElementById('name').value; var email = document.getElementById ...

Having trouble linking npm with webpack? Receive an error message saying "module not

I've been having trouble npm linking a module to a project that uses webpack as its bundler. Despite trying various solutions, I keep encountering the following error: ERROR in ./src/components/store/TableView.jsx Module not found: Error: Cannot reso ...

Searching for documents in MongoDB using a reference field

I'm working with two Mongo schemas: User: { _id: ObjectId, name: String, country: ObjectId // Reference to schema Country } Country: { _id: ObjectId, name: String } My goal is to retrieve all users who are from "VietNam". Could you provi ...

When should the preloader be placed within the DOMContentLoaded or load event?

I'm looking to implement a preloader on my website to ensure everything is fully loaded - images, JavaScript, fonts, etc. However, I'm unsure whether to use the following: window.addEventListener('DOMContentLoaded', () => { // code ...

What is the best way to add a color swatch image using Javascript?

I'm facing a challenge in Shopify where I need to assign corresponding background images to color swatches. Currently, my icons are set up with the correct links for each color, but they are missing their respective images, similar to this example. I ...

Is there a way to create a binding between Javascript and C

Looking to incorporate my C++ code into a web app's client side, I am interested in creating Javascript wrapper objects for my C++ classes. Is there any previous examples or tutorials available for achieving this? ...

Display a pop-up video player when a button is clicked to watch multiple videos on a webpage utilizing jQuery/Javascript

I am in need of assistance with integrating multiple embedded YouTube videos (using iframes) that appear on the screen after a user clicks a custom button. While there are solutions available for single videos, I am struggling to make it work for multiple ...

Position a center pivot amidst a collection of 3D shapes within ThreeJS

I am currently working on creating a plugin prototype to allow customization of 3D objects using ThreeJS. You can view my progress so far here: If you've visited the link, you may have noticed that when hovering over the left or right arrow, the obje ...

"Encountered an error while trying to locate the view" in a simple Express.js application

Embarking on the journey to learn Express.js, I decided to create a simple Express app. The structure of my app.js is as follows: var express = require('express'); var app = express(); app.configure(function(){ app.set('view engine&ap ...

Showing Data Trends Using Highcharts: Progression of Column Values Based on Previous Value

I am encountering some difficulties while using Highcharts. I am looking to adjust the height of the third column "C" based on the values in column "B" (Usually, the height of column "C" is determined by Column "A"). Here is a simple example I have creat ...

retrieve the timestamp when a user initiates a keystroke

Seeking assistance from the community as I have been struggling with a problem for days now. Despite searching on Google and Stack Overflow, I haven't found a solution that works for me. My web application features an analog clock, and I need to capt ...

Is it possible to create two separate Express sessions simultaneously?

I am encountering an issue with my Passport-using application that has a GraphQL endpoint and a /logout endpoint. Strangely, when I check request.isAuthenticated() inside the GraphQL endpoint, it returns true, but in the /logout endpoint, it returns false. ...

Menu options are unresponsive to clicks in the dropdown

Need help fixing my dropdown menu issue. Whenever I hover over the dropdown, it disappears before I can click on any items. Here is a snippet of the code causing the problem: #navContainer { margin: 0; padding: 0; padding-top: 17px; width: 220 ...

Ways to fix the Node.js uncaughtException: Connection already released error along with the MaxListenersExceededWarning

I've created an express server to handle requests from my React frontend, where a dictionary with 10 items is sent and then stored in a database. The code seems to work fine as it successfully saves records back to the database. However, I'm enco ...

Hover over elements to reveal D3.js tool tips

Currently, I am utilizing a tutorial for graph tooltips and finding it to be very effective: http://bl.ocks.org/d3noob/c37cb8e630aaef7df30d It is working seamlessly for me! However, I have encountered a slight problem... In the tutorial, the graph disp ...

What is the process for installing a third-party library in React Native without using npm or yarn?

Is there a way for me to install a third-party library manually without affecting the build run or performance of my project? I am looking to add this specific library: https://github.com/asmadsen/react-native-unity-view ...

Using AngularJS to dynamically assign classes with values derived from an ng-repeat loop

I'm attempting to assign a class to a table row using ng-class based on the value of ng-repeat. I have searched online and found examples that involve calling a function. Is it possible to simply set ng-class with a value instead of using a function? ...