Optimize HTML5 In Android App - android

So I am working on implementing an html5 based game into an android app using webview. Now performance varies but sometimes it is decent or sometimes it is horrible.
So I was wondering if there is some way I can implement some way to optimize the HTML5? Is there an alternative to running HTML5 on android through an apk? Can I enable some sort of acceleration through the browser?

I don't know what kind of game you are creating. But HTML5 is not fully supported in Android.
At the moment, I'm working on a porting (from iPad to Android) of an app that is written in HTML5 and JS. I notice that performance in iOS are really greater than the Android's ones. If you want best performance, in my opinion you've got two possibilities:
1) Using another system, based on native API, and not on HTML5
2) Waiting until the performances are improved, and create an App with a min-sdk sufficiently high

I need to know so many things just to even begin to help.
What features are you using that bog your app down?
Canvas?
SVG?
Excessive DOM elements?
Excessive timers and loops?
Are you testing on an emulator or device?
You can create a native app to do just about anything a webview can do and probably be more performance friendly. It's going to cost you more time and energy, especially if you don't know Java. It's going to cost you even more time and energy if you ever even think about porting to IOS. Post the code that is bogging you down and I will let you know if you can optimize it or use some alternative method.

Related

How to avoid loop in Flash files in android

After mentioning God, I must tell u a little story about my problem.
I need to make a simple (teaching) mobile game for the my son so I've tried Unity and seen it complicated and without a good library reference (unlike Arduino), tried Flash professional (why old ver? it was enough) and seen complicated too. Finally I backed to my young years and tried SWiSH MAX 4 ( I know it's weak but was enough for my purpose). The results (SWF 10) were good in PC.
When I tried it in the my phone, some issues tried to crush me!!!!
1-there is just one real and strong flash player available (adobe player, which is a web plugin originally).
2-There is no setting to avoid loop in end of Flash files, in android flash player.
3-The android flash player doesn't do this simple script "stop();".
these issues avoids to run my Flash game correctly in Android. Could u help me?
Switch to AIR, which is just the Flash runtime with access to more cool stuff.
It can then be built as a normal android application. And since it's the real runtime, it will have no issues with basic actionscript.

Virtual reality app perfromance in android mobile remains same even is showd a lot performance improvement in Editor play in unity3d

I am building an app in android for Google cardboard Virtual Reality(VR) in Unity3d engine.Since for VR performance matter a lot for best experience.
I used Simplygon (From Assert store) to combine all textures in my app.
Stats are shown below unfortunately there is no improvement in performance when running on mobile but there is a improvement in editor.
Am I missing something ,What may be the reason for this?
Are they any options to reduce performance in mobile build as well?
Profile window stats of Unity Editor:
Before using Simplygon: ( FPS is around 60 )
After using Simplygon : (Crossed 250 FPS), But Tris and Verts count Increased a lot.
Profile window stats of Android mobile:
Before optimization:
After Optimization:
Are they any options to reduce performance in mobile build as well?
Presumably you meant are there any performance improvements you can make?
You also said that you benchmarked against the editor. This isn't a good idea - for starters - what renderer for unity are you using? OpenGL is more similar for Android than DirectX.
You need to measure more. Then measure more specifically (unity has some good performance logging helpers) before you can make useful changes..
Whenever you are optimizing, differences in hardware can have a huge impact on which optimization are impactful, and which don't make any difference. Since the android architecture is so different from a PC, it becomes a total crap-shoot as to whether other stuff that helped on the PC will also help on the mobile device. To make matters worse, things that help on one mobile device might not help on another one, say, from a different manufacturer.
In your case, the rise in polygon count was, apparently, simply more painful that then texture benefit, for your particular phone. Although, to be honest, there could be some simple settings to fix, too - someone else might have suggestions there.
Like others have said, various performance probes can help you find your bottlenecks.

Does it make sense to build a music making app on top of a game engine?

I'm interested in making an app which would allow sequencing audio instruments and drums in real time, which would work on several mobile platforms. The visual interface I designed is quite elaborate, and I'm definitely going to need custom graphics capabilities.
The way I see it, I have two options. 1. Learn OpenGL ES and build something relatively cross-platform, and then wrap it with layers that can interact with specific OS API's. 2. Use a 2d game engine, e.g Unity 2D, and utilize that to build a responsive interface.
Option 1 is the most difficult, since I've never programmed graphics before, while option 2 may be an overkill since audio processing apps require lots of processing power lots of low-level optimization for DSP routines. Losing some of this power to an entire game engine may be undesirable.
It's very important that I don't have to reimplement the interface from scratch for every platform. It's buggy and error prone, and a pain to manage.
I'd like some feedback on the best way to go about evaluating my options. Has someone looked into something like this already?
It has been done already, i believe i saw it on the unity forums,
as for whether or not it makes sense, sure it does,
Unity does something that is truly amazing, you can develop it once and deploy to iPhone, Android and WP and more, instead of using xCode with sound effect plugins unity comes with fmod that is easy to tap into.
Not something i am going to do, but if i did, unity would be perfect for it especially when you think that you can have play functions with amazing visual ques that unity is made for.
Lol, sounds like a sales pitch, but no, its not a bad idea to choose unity for such a thing. since you can always write the missing features in plugins if needed. beats going to OpenGL which is a pain in the {bug}

Building a game on Mobile. Native or Engine?

I would like to start getting involved into mobile game programming.
I already have modest experience in Android development and iPhone development.
Previously, I have built a proof of concept 2D JRPG game and a 3D FPS Engine using XNA, and I have a good idea about game programming concepts.
I am lost whether I start looking into OpenGL on Android or if I should directly take a shortcut into a game engine, such as Unity3D.
Base on my experience, would it be more efficient to invest the time into Native graphics programming on Android/iPhone? I am not only looking for "fast" development, I'm also looking to have efficient results.
Also, how portable is opengl-es from one platform to another?
A game engine involves much more than graphics: audio, resource management, networking, scripting, etc. In order to be cross-platform, all those subsystems must be implemented natively for each platform. This implies having a very good design and architecture, and of course lots of code. Unfortunately, you should use C/C++ for efficiency and portability concerns. Although now is possible to develop such engines with with higher level languages like C#, you are limited to its platform support.
Also, you need to consider the gameplay code.
I wouldn't worry about the engines speed thought. The guys who write engines, know what they are doing and unless you spend lots of time optimizing things you won't get considerable improvements.
So, writing portable games takes a lot of work without an engine resolving all the problems involved.
OpenGL-ES is a standard. As with all the standards, there are always some minor tweaks for each platform, but nothing really disturbing.
Resuming, the correct answers depends on you. Everything in computer science is a trade-off and you only know the values involved.
Hope it helps.

Android with E-Ink display

I'm interested in using Android for a E-Ink
based platform. I know it has been demonstrated once by MOTO, but I'm interested in using it for a commercial grade product and not 'just' a technology demo. I have got a question on the ability to change the platform to cope with specific display effect caused by E-Ink. I'm asking this question from the role of system architect and have no prior experience with Android.
E-ink has several characteristics which are very different than the common LCD displays:
time to update display (50-700ms)
it costs power to change the display (none to maintain)
display life time is determined by number of display updates!
tradeoffs can be made between quality, performance and display lifetime
grayscale versions available
The great thing: it costs no power to retain display information and they can be read in bright sunlight with no backlight. Also the display can be literally as thin as paper...
This means that the platform software needs to have a degree of control over the number of display updates and the type of display updates to get the best performance. Otherwise, an application which is unaware of the display characteristics could quickly drain the battery, or worse, shorten display life time to months instead of years. Conceptually I'd be interested in replacing a display driver, but I'm not sure if this part is open. I know it is hard to get info on the Qualcomm chipsets....
My question: can this be done? Can the Android platform be modified to support a drastically different display effect? Any pointers to an android roadmap?
The reason I find Android interesting for this application is because there is a significant overlap in functionality (from cell phone to browser).
Thanks!
I cannot agree more and started to lobby with app and OS developers on improving readability on e-ink:
Make scrolling and page turns e-ink friendly http://github.com/aarddict/android/issues/28#issuecomment-3512595
Looking around on the web I find a recurring theme "we had to rebuild WebView from scratch to adapt it to the e-ink display"
There are already coding solutions which reduce flicker and page refreshes. Most of them are kept by those who market the e-ink readers who prefer to keep them as frontends to their shops.
I contacted the author(s) of cool reader on their implementation of
smooth scrolling on e-ink devices and got the following reply:
Hello, Look at N2EpdController.java Author
is DairyKnight from xda-developers. At least you can use it under GPL.
For use in closed project I would recommend to contact him.
Ideally, display components for e-ink devices should be part of the Webkit's WebView framework. I've submitted a feature request via
http://bugs.webkit.org/show_bug.cgi?id=76429
fyi, E-Ink has an Android on E-Ink development kit, AM350 that's being sold now. http://www.eink.com/sell_sheets/AM350_Kit_Sell_Sheet.pdf
http://www.linuxworld.com/news/2007/112707-kernel.html
In this case the application domain is e-reading, in which case the advantages of E-ink are more imporant than the disadvantages (slow display updates).
I've done some further studies of Android. I believe the trick is to perform display updates asynchronously; to provide applications with an environment which mimicks immediate display updates, whilst detecting the relevant updates (i.e. by using graphics processor and/or MMU) to have an intelligent display update. Not all types of applications would be suitable; i.e. games and video playback require immediate display updates.
Making such a platform will be less than trivial; however, with the growing number of different hardware platforms, abstractions are becoming better all the time.
I know this is an old question, but I have found it through Google - others might want to know this too.
PocketBook Pro 902/903 are based on Android and feature e-ink screen. You might want to check them out. There might be other models too - I am interested in these because of their 10" screen. YMMV.

Categories

Resources