iPhone/iPad Safari Javascript performance - javascript

Do anyone know how to improve response time of panning (using one finger gesture) handled using JavaScript in Safari on iPad/iPhone

Do you have a specific example of a web-site that is bad?
The user manual for the iPhone that is included with the standard bookmarks in Mobile Safari is implemented in Javascript and is almost as fluent as native code.
See:
what is the pastrykit framework - stackoverflow

Related

What are the main (technical) difference when developing apps for iOS web view and Safari mobile?

I've struggled to find any reference to web development when it comes to the difference between UIWebView and Safari mobile.
I'be been able to find difference between different browsers, but not between the native iOS web view and Safari mobile.
I am not sure wether you speak about UIWebView or WKWebView. The last one is available since iOS 8.0 (source: WKWebView doc).
The performance of the old WebView component was lower than a Safari webpage because it was unable to use Nitro JavaScript engine (source: old questions on SO, like this one).
However, the performance of UIWebView/WKWebView was improved continuously since 2014 and there is no more major technical differences, at least between WKWebView and a mobile webpage (source here). The differences between UIWebView and WKWebView are explainded in this SO thread.
Keep in mind that Apple's guidelines forbid some use cases of Webview, like external authentification or purchase :
Apps that link to external mechanisms for purchases or subscriptions to be used in the App, such as a "buy" button that goes to a web site to purchase a digital book, will be rejected
Hope it will help !

Is it possible to create a new window with mobile Chrome packaged apps?

Can you create multiple windows on the new mobile Chrome packaged apps? I ask this because
chrome.app.window.create("host/index.html",
{
id: "host",
bounds: {
width: 1000,
height: 500
}
});
is working fine on desktop () but not so great on the iOS simulator ().
Short answer: Chrome Apps for Mobile do not support multiple windows at the moment.
The root of the problem is that mobile devices don't have traditional window managers, per-se.
We thought about trying to simulate it with some sort of edge swipe gesture, but it raised a bunch of questions: Should we hijack gestures your application may already be using? Should we have title bars that decrease the size of your application surface? What if our solution does not fit with the look&feel of your application? All hard questions to answer, so we opted not to support multiple windows for now.
On Android L-release, theres a cool new feature that was just announced that will allow applications to have multiple views ("windows") appear in the Recents switcher, so perhaps we can experiment with that.. But I think it would still be more confusing for users to switch between Recents than between windows on desktop chrome, so not sure if will be the right option for most applications.
If you want to have multiple views within your application, its best to use a web framework that helps for navigating between them within a single window. This has actually generally been the accepted best-practice for hybrid web apps for a long time.

How do i know if i'm running on a pc or tablet [duplicate]

This question already has answers here:
Reliable Way to Detect Desktop vs. Mobile Browser [duplicate]
(2 answers)
Closed 9 years ago.
Is there away to know if im running on a desktop or mobile device.
Since desktop responsiveness are diffrent i would like to know if a user can rotate te screen or not.
You can use a script to find your browsers user agent string. Each browser has a different user agent. Safari on Mac and Safari on an iPhone both also have different user agents.
I'm not exactly sure what you mean though, do you want like javascript to know what type of device your on?
I think you could use modernizr to detect the browser behavior.
Touch Events touch
The Modernizr.touch test only indicates if the browser supports touch events, which does not necessarily reflect a touchscreen device. For example, Palm Pre / WebOS (touch) phones do not support touch events and thus fail this test. Additionally, Chrome (desktop) used to lie about its support on this, but that has since been rectified. Modernizr also tests for Multitouch Support via a media query, which is how Firefox 4 exposes that for Windows 7 tablets. For more info, see the Modernizr touch tests.
It's recommended to set both touch and mouse events together, to cater for hybrid devices – see the Touch And Mouse HTML5 Rocks article.
The following will give you the user agent.
navigator.userAgent
You can then use something like:
if(navigator.userAgent.indexOf("DESIRED USER AGENT") != -1) {
// Mobile specific code
}
You should find the following thread helpful: Auto detect mobile browser (via user-agent?)
You can use Modernizr:
Modernizr creates an element, sets a specific style instruction on that element and then immediately tries to retrieve that setting. Web browsers that understand the instruction will return something sensible; browsers that don't understand it will return nothing or "undefined". Modernizr uses the result to assess whether that feature is supported by the web browser.
Eg:
if ( Modernizr.touch ) {
// mobile
} else {
// desktop
}
The following link has some javascript built-in functions to detect browsers :
http://www.quirksmode.org/js/detect.html
check out mobile detect. it may be a bit much for what you want but it is comprehensive.

Building website for Windows mobile 6.1

I am making a website for windows mobile phones 6.1 and trying to figure out which browser to use. I have ran into a pattern that some functions that run on 1 browser don't work on another. So far I have tried
IE 6 - relatively better but bad alignment and page is zoomed in when opens
Opera Mobile 10 - Javascript keypress does not work, Although good alignment and screen resolution settings
Mozilla Fennec - Best one so far but is really really slow.
Any ideas if I update IE/OS on these phones to solve this, I am trying to avoid buying new licenses?
Developing web sites for Desktop or Mobile is always a challenge with all the different browsers.
If you intend to use a batch of one mobile device model, you can define which browser has to be used. If you are not in that position, you have to work against different browsers.
On windows mobile 6.1 the only standard you can rely on is the built-in IE6 mobile browser.
If you can define a 3rd party browser, you may have a look at ZetaKey (based on WebKit).

How to detect shake in iphone browser?

There's questions about they're either old or don't give an answer.
I'm not good at javascript, I'm alright at jQuery.
How would I do something when a shake is detected in the iphone browser? I'm planning on changing the url and sending the user back to the 'library' page of the website when a shake is detected.
From what I read, Android doesn't yet allow access to the accelerometer in the browser. Chrome for Android just came out last month though, and I'm not sure if it's supported in it yet, so I guess this question is just for the iPhone, and Android if anyone knows if it supports it yet. I'm assuming the same code would work for both.
if you are using jquery, You can use my js lib https://github.com/GerManson/gShake

Categories

Resources