Feed Buzzard
  • General
  • Tech
  • World Tech
  • World Tech Code
  • Wearable Tech
  • Pokemon
  • About Us
    • Terms & Conditions
    • Privacy Policy
  • Contact
No Result
View All Result
  • General
  • Tech
  • World Tech
  • World Tech Code
  • Wearable Tech
  • Pokemon
  • About Us
    • Terms & Conditions
    • Privacy Policy
  • Contact
No Result
View All Result
Feed Buzzard
No Result
View All Result
Home World Tech

Deploy WebGL applications as native iOS or Android applications? –

Gordon James by Gordon James
January 11, 2021
in World Tech
0
0
SHARES
31
VIEWS
Share on FacebookShare on Twitter

Development issue/problem:

Does anyone know how to implement a WebGL application as a native application for iOS or Android? Commercial middleware is acceptable, although an open source project is preferable. Thank you so much!

How can I solve this problem?

Solution 1:

After the answer from Joris (which seems to be based on the work of Nathan de Vries), here is the code I needed to enable WebGL in the iOS 5.0 SDK:

Somewhere above the version of the view controller:

@interface UIWebView()
– (invalid)_setWebGLEnabled:(BOOL)newValue;
@end

Make UIWebView programmable and activate WebGL :

UIWebView *webDetailView = [[UIWebView mapping] initWithFrame:mainScreenFrame] ;

id webDocumentView = [webDetailView performSelector:@selector(_browserView)] ;
id backingWebView = [webDocumentView performSelector:@selector(webView)] ;
[backingWebView _setWebGLEnabled:YES] ;

I created a sample application that demonstrates running WebGL in full screen mode from UIWebView for iPhone / iPad, using the WebGL Scratchpad http://glsl.heroku.com as a target. Be aware that some of these examples may even cause the iPad 2 to lock, resulting in a difficult restart. The performance of this site seems to show why WebGL is not yet officially supported in the Mobile WebKit.

Of course, as said, there is no guarantee that this will work on future versions of iOS, and your application will be rejected from the App Store. It is only very useful for recreation and internal testing.

An example of WebGL running on my iPad 2:

Solution 2:

WebKit on iOS actually supports WebGL from version 4.x (I don’t know which version .x). It is enabled in the web view used by the iAd frame, it is disabled in all other cases of using the WebKit (Safari and UIWebView) WebGL.

You can activate WebGL via the private API (this does not go through the login process). In the subclass Webview :

– (void)setWebGLEnabled:(BOOL)enableWebGL {
UIWebDocumentView* webDocumentView = [self _browserView];
WebView* backingWebView = [webDocumentView webView];
[backingWebView _setWebGLEnabled:enableWebGL];
}.

(via)

This allows you to at least start experimenting with WebGL on iOS.

Not sure about WebGL support on Android. Relatively recent comments on this topic in the Android tracker suggest that it is not yet available.

Good table with WebGL support in (mobile) browsers : If I can use WebGL

The best thing you can do now seems to be to incorporate your own WebKit compatible version of WebGL into the skin of your iOS and Android applications.

Solution 3:

Since the iOS version of WebKit doesn’t support WebGL by nature, I think you have two choices:

  • Implement the WebGL API in the WebView JavaScript context itself, redirecting calls to native OpenGL via an iframe RPC or other. Unfortunately there is no clean way to invoke (Objective) C functions from JavaScript on iOS. Performance can be a problem.
  • AOT compiles or interprets third-party JavaScript at runtime and implements WebGL from there. JIT compilers are not allowed on iOS, so something like V8 will not work. Appcelerator Titanium compiles JavaScript statically, as far as I know, and also has an interpreter. You could use it, but you would still have to implement the WebGL glue yourself.

I don’t know of any existing WebGL bridge for iOS, so I think you should write one yourself or have someone else do it. A problem you may not be able to solve if you are using something other than WebGL for display – such as HTML, 2D, etc. – but you can’t use WebGL to display your files. Combining a WebView display with an OpenGL frame buffer is quite a challenge.

I don’t know much about Android, but because the rules are less strict there, you might want to put a WebGL-compatible browser on it.

Solution 4:

I don’t think there are any simple conversion tools. To create native applications, you probably need to take your WebGL code base and rewrite it in OpenGL for both platforms.

Solution No 5:

It’s not finished yet, but ForPlay could serve as a common development platform for Android and WebGL on GWT.

Solution No 6:

Installing WebKit and your application resources (.js, textures, etc.) in an iOS or Android application doesn’t seem too complicated. Since Google and Apple are major contributors to the WebKit project, I think the necessary support (for multitouch and others) is already in place.

PS: many iOS applications use interpreted javascript or Lua. There are rules to prevent your application from executing code from third parties (especially from the Internet) instead of the code you would put in your own application.

EDIT: I think in order to use WebGL and go through Apple’s validation process, you need to set up your own web view using Webkit (built from source code), because activating WebGL in the web view provided by Apple will result in rejecting your application.

Solution No 7:

There are several possibilities to implement a native WebGL application. EjectaGL is an excellent implementation of WebGL, but it is somewhat more difficult to master (http://codehum.com/stuff/ejectagl/).

Another option is Ludei, who recently announced support for WebGL for iOS and Android. It is easy to use and supports HTML5 Canvas acceleration in 2D and 3D with WebGL. It also allows you to monetize your application through IEPs, advertisements and various extensions. It is much easier to test with the CocoonJS Launcher application and its cloud compiler.

www.ludei.com
http://blog.ludei.com/webgl-demos-arrive-to-google-play-store/

Solution No 8:

Try Phonegap. Allows you to create native HTML+CSS+JS applications using the Webkit’s default installation on your operating system. And it provides a bridge between JavaScript and its counterparts, so you can do things that are not possible in pure web applications.

Good luck!

Related Tags:

unity webgl download,unity webgl mobile,unity webgl build,unity webgl not loading,unity webgl 2020,unity share webgl game,unity mobile web game,unity webgl mobile 2018,unity webgl mobile performance,unity webgl call of duty,unity webgl is not supported on mobile,unity webgl gyroscope,unity webgl ios,unity webgl disable mobile warning,unity webgl 2,webgl safari,cross platform mobile app,best platform for android development,pwabuilder,apache cordova,xamarin,react native,phaser 3 android,deploy phaser game to android,phaser to cordova,phaser 3 android game,phaser native app,ionic 3 game development,webgl 3d,webgl support

Total
0
Shares
Share 0
Tweet 0
Pin it 0
Share 0
Gordon James

Gordon James

James Gordon is a content manager for the website Feedbuzzard. He loves spending time in nature, and his favorite pastime is watching dogs play. He also enjoys watching sunsets, as the colors are always so soothing to him. James loves learning about new technology, and he is excited to be working on a website that covers this topic.

Related Posts

Blockchain Conference in Poland Showcases New Solutions to Problems in Enterprise Logistics
World Tech

Blockchain Conference in Poland Showcases New Solutions to Problems in Enterprise Logistics

December 15, 2022
World Tech

Rockstar Games Brings GTA to The Metaverse

October 20, 2022
World Tech

Ways Technology Is Changing The World Of Education

September 21, 2022
Next Post

“Unable to open log device ‘/dev/log/main’: No such file or directory” –

How to use Android phone as a computer gamepad

Down load Firefox Web browser

No Result
View All Result

Recommended

5 Useful Things You Can Do With cURL and Proxies

7 hours ago
Here’s Everything You Need to Know about Moles

Here’s Everything You Need to Know about Moles

3 days ago

Comic Play Casino Games

1 week ago

Here is a List of Some of the Most Interesting Slots You Can Play

1 week ago

Categories

  • Fitness Trackers
  • General
  • Latest
  • Pokemon
  • Tech
  • Technology and Computing
  • Wearable Tech
  • World Tech
  • World Tech Code

Recent Posts

  • 5 Useful Things You Can Do With cURL and Proxies January 27, 2023
  • Here’s Everything You Need to Know about Moles January 25, 2023
  • Comic Play Casino Games January 20, 2023
  • Here is a List of Some of the Most Interesting Slots You Can Play January 20, 2023

Categories

  • Fitness Trackers
  • General
  • Latest
  • Pokemon
  • Tech
  • Technology and Computing
  • Wearable Tech
  • World Tech
  • World Tech Code

© 2022 FeedBuzzard.com

No Result
View All Result
  • General
  • Tech
  • World Tech
  • World Tech Code
  • Wearable Tech
  • Pokemon
  • About Us
    • Terms & Conditions
    • Privacy Policy
  • Contact

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT