Jump to content

Babylon on Android, ios and PC apps.


hit2501
 Share

Recommended Posts

To use Babylon in a native Andoird or iOS app, you will need some kind of a container like Cordova/Phonegap or Cocoon.js - https://www.ludei.com/cocoonjs/

If you want to use Babylon.js in a native desktop app, you could try :

But I never tested any of those, this is just general information I can provide :-)

Link to comment
Share on other sites

Hi,

 

 Deltakosh and I have been spending a lot of time to garantee that Babylon.js runs fine on all platforms including mobile one: compatibility with the GPU of our shaders, performance and support for touch. It will run perfectly fine.

 

 You just need to embed it into a web view. To do that, you've got several options:

 

 1 - Build the native app using the web view yourself

 2 - Use Visual Studio 2015 to build a UWP app using web technologies

 3 - Use Cordova

 4 - Very interesting option you should have a look to: Manifold.js : http://manifoldjs.com/ It's an open source framework that will generate for you all mobiles projects based on your web sites: iOS, Android, Windows, Firefox OS.

 

 

Bye,

 

David

Link to comment
Share on other sites

  • 1 year later...
On 10/16/2015 at 2:39 PM, davrous said:

Hi,

 Deltakosh and I have been spending a lot of time to garantee that Babylon.js runs fine on all platforms including mobile one: compatibility with the GPU of our shaders, performance and support for touch. It will run perfectly fine.

 You just need to embed it into a web view. To do that, you've got several options:

 

 1 - Build the native app using the web view yourself

 2 - Use Visual Studio 2015 to build a UWP app using web technologies

 3 - Use Cordova

 4 - Very interesting option you should have a look to: Manifold.js : http://manifoldjs.com/ It's an open source framework that will generate for you all mobiles projects based on your web sites: iOS, Android, Windows, Firefox OS.

Bye,

David

Hi David,

 

That is really interesting! :)  I use Basic4Android (www.b4x.com) to develop Android Apps - it works really well and have been looking to use Babylonjs to create a game.  To join the two together I've used a Webview and this works but I have a slight issue when trying to process the input from a VirtualJoystick (not Camera) - does anyone have experience of this?  Basically the VirtualJoystick intercepts PointerDown events and also part of the onPointerMove Events but it seems to lose focus of the onPointerMove Event and then you have to remove your finger from the screen and then reapply it to the screen and re-swipe or move..

 

This doesn't seem correct - can anyone give any help about trying to track down if the issue is with the Webview or with Babylonjs...  I'm using version 2.4 of Babylonjs.

 

Cheers!

 

Link to comment
Share on other sites

Cheers - I'm using the latest implementation (should have said) - it just seemed that 'Android' issues were being discussed - I wondered if anyone had succesfully used the VirtualJoystick in this way with Android and Webviews..  I've asked on my Android Forum - but I guess that they'd say "we don't know babylonjs ask there..." etc.. :) 

Link to comment
Share on other sites

Hello,

Yes, I've fixed a couple of bugs in 3.0 with VirtualJoystick. I still need to plan some time one day to refactor it to use UI elements inside the Babylon.js rendering canvas rather than adding a transparent canvas on top of it. 

For Android, which Pointer Events polyfill are you using? Hand.js or jQuery PEP? 

David 

Link to comment
Share on other sites

On 4/13/2017 at 11:31 AM, davrous said:

Hello,

Yes, I've fixed a couple of bugs in 3.0 with VirtualJoystick. I still need to plan some time one day to refactor it to use UI elements inside the Babylon.js rendering canvas rather than adding a transparent canvas on top of it. 

For Android, which Pointer Events polyfill are you using? Hand.js or jQuery PEP? 

David 

Hi David,

Sorry - we've been away over Easter, so I've not had a chance to respond earlier.

Many thanks for taking the time to respond, it's really appreciated.

I must admit I'm not entirely sure how the events are being handled..  I thought it was hand.js as I was referencing this, but I removed the reference to this library and the code still executed correctly - then I thought I'd read somewhere that VirtualJoystick (or perhaps VirtualJoystickCamera?) had been rewritten at some point to take advantage of PEP anyway...  I need to investigate a little more, although I have been investigating other control options as well, but the VirtualJoystick seemed to work so well.  I may well try V3 BabylonJS to see if there are improvements, but I'm not convinced that it isn't something to do with the ChromeClient that I'm using.  I need to improve my understanding in this area.

Merci!

Phil

Link to comment
Share on other sites

  • 4 weeks later...

Android wise it's fairly simple...  If you use Basic4Android - there is a free demo version which you can try out.  A 2 year licence (so upgrades for 2 years) is $119 I think.

https://www.b4x.com/b4a.html

Then literally follow the steps on that page.

 

Installation

1. Java JDK v8
  • Open the Java 8 JDK download link.
  • Check the Accept License Agreement button.
  • Select "Windows x86 (32-bit) or Windows x64" in the platforms list.
  • Download the file and install it.
2. Android SDK

 

  • Download Android SDK.
  • Install the SDK. The SDK doesn't work properly when it is installed in a path with spaces (like "Program Files").
    It is recommended to install it to a custom folder similar to C:\Android
    .
  • Install Android SDK Tools, Android SDK Platform-Tools, Android SDK Build-tools (v23.0.3 is recommended),
    Android Support Repository, Google Repository and at least one platform (see the image below). Use API 14 or above.
  • You can also install Google USB Driver if you need to connect a physical device with USB. A list of other drivers is available here.
3. B4A
  • Download B4A Trial Version
  • Open B4A.
  • Choose Tools > Configure Paths.
  • Use the Browse button to locate "javac.exe" and "android.jar"

Then you are 'good to go'...

 

For Babylonjs 'just' create an App such as this, https://www.b4x.com/android/forum/threads/simple-html5-app-wrapper.42875/

 

So the App wraps HTML5 calls, using some libraries - although these are only available to licensed Users...  There is an App in there which you can view - but it is mega simple and should show the steps required...

Within the App itself you 'just' load the URL or file with the HTML in it..  the rest should be the same as per normal babylonjs projects.

I'll try and 'showcase' my game once it's in a more useable state to show what's possible..  - sorry I've been a bit busy with actual real work.

Link to comment
Share on other sites

  • 4 weeks later...

Just to add a note to the Universal Windows App side of the discussion, I am currently testing BJS inside of a UWA, and it seems the FreeCamera keyboard controls are a bit buggy.  The app will often not register the arrow key pressed for movement, then a few moments later will "zoom" in one direction or the other as if it finally registered...

I'll provide more information once I do some testing.

I'm using BJS within a UWA to get a BJS app on my XBOX One :) 

Link to comment
Share on other sites

@deltakosh Interesting, it seems as though WebGL is not only slow to initialize, but very slow running compared to Chrome/Firefox. A thought - does OimoJS calculate collisions vis GPU or CPU?  The physics example I was using to benchmark was an OimoJS physics test, and I'm wondering if the Javascript engine used in Universal Windows Applications restricts GPU access?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...