Is there a built-in Android developer browser? Where to look for differences engine JS?

as I enter the Android PhoneGap development more and more, I see more and more nuances and little things between the built-in Android browsers in all versions. I was looking for some kind of official or fan document that would address these differences in the browser version. But I can not find anything useful.

This is very unpleasant, because you need to test everything on all versions of the Android emulator, and if the application becomes large, it will work hard to test all the functions in all versions.

Everyone is excited about HTML5, I was there too, but only by the time I got to the real thing. I realized that there are many problems when different versions of Android behave differently.

If anyone has a good resource, I would be very pleased. Thanks

EDIT . Added an example of different behavior between versions of the Android browser (but there are many):

This works in the Android browser in versions 1.6, 2.2, 2.3 and 2.3.3. But it does not work (the application crashes or stops the execution of JS) in Android 2.1:

Object.keys(var).length 
+7
source share
3 answers

You asked a pretty general question. The general purpose answer is that any cross-browser development (even cross-versions of the same browser) requires that you are familiar with which functions are safe in the target browsers, which functions are unsafe in the target browsers, and which of them should only be used when thoroughly testing or detecting a backup function.

While no one will exactly expect the type of difference you saw with the one example you referenced, it is clear that this is a fairly new feature in ECMAScript and it does not execute sequentially in regular browsers, so I would put it in when it’s not safe Assume that it works on all versions of Android, even if you saw it on some versions of Android. This means that you should use it only if you have explicitly tested it so that it is reliable in all versions of the browser that you target or develop test functions, and use it only when you know that it present and reliable, or design a safer job.

As I mentioned earlier, this thread contains a bunch of suggested workarounds for the specific problem you were talking about.

I don’t know the detailed written materials that documented in advance the details of the differences between the different versions of the Android browser. Since this is open source, there are probably notes for developers and some release notes, but it will probably be like finding a needle in a haystack and may not even contain what you want. It’s rare for any developer to have such detailed information. Usually we don’t get this level of detail from any of the existing desktop browsers or iOS browsers, and even if you were on the development team itself, you would probably only see some of this information. I don’t think you will find official documentation that covers what you want.

You need to learn how to relate to more unknowns and which areas are ā€œsafeā€, which areas require extensive testing before use, and which areas are too risky. Even when you do this, you will find Android errors in some version that touch you. This is just the nature of building on someone else’s platform. At least the set of Android browsers is much simpler than trying to target all desktop browsers from IE6 to IE9, Firefox 3 to 5, Safari 3 to 5, Opera 9-11, Chrome 9 to 12, all Android, all iOS and use HTML5, if available, what I'm working on.

As soon as you go through this wringer a couple of times, you will realize that if the new language / library has any risk, you should not use it at all, if it is not absolutely central for what you are trying to accomplish and then you have to check hell. If this is like getting the length of an associative array, which is just convenient for the programmer, then it is probably easier to stick to a workaround that is guaranteed to be safe and just won't waste your time at any risk of browser support.

+2
source

The only official documentation I know of is part of the Android developer documentation . If I were a betting player, I would argue that it covers only part of what you are looking for.

0
source

The general idea of ​​Javascript for cross-browser is built-in function testing (at least as I accepted it). I don’t know exactly what ā€œfunctionsā€ you are specifically looking for, but it’s usually wise to test for a set of functions, then use it and have a backup error if this does not exist. (Even if the backup: "This site needs a browser that supports" foo ")

Since you did not give any examples, I will take Ajax. It is always best to check for the existence of window.XMLHttpRequest and then act on it. Of course, this does not work if you do this for every need, so that you can write a verification procedure or a wrapper to accept your list of needs, so that your cache wrapper / calls the appropriate methods to accomplish this task.

Without examples of ā€œfeaturesā€ that you say that you are different from browser to browser, it’s difficult to give any specific direction.

0
source

All Articles