Android webview perform double click when doing a single tap - android-webview

i'm have a problem with android webview on some device. When i do a single click, webview performs a double click and when i do a long tap, it performs as a single click.
Here is my webview setting code:
webSettings.setJavaScriptEnabled(true);
webSettings.setLoadWithOverviewMode(false);
webSettings.setUseWideViewPort(false);
webSettings.setPluginState(WebSettings.PluginState.ON);
webSettings.setPluginsEnabled(true);
webSettings.setAppCacheEnabled(false);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webSettings.setDefaultZoom(ZoomDensity.FAR);
// Cleaning previous cookies
CookieSyncManager.createInstance(baseContext);
CookieManager cookies = CookieManager.getInstance();
cookies.removeAllCookie();
webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
webSettings.setSavePassword(false);
webView.setInitialScale(width*100/320);
//webView.requestFocus(View.FOCUS_DOWN);
webView.setBackgroundColor(Color.TRANSPARENT);
webView.setBackgroundResource(R.drawable.body_bg);
webView.setOverScrollMode(View.OVER_SCROLL_NEVER);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
if (Build.VERSION.SDK_INT >= 11) {// Android v3.0+
webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
}
Do i make a wrong somewhere? Anyone can give a suggestion? I'm sorry because my bad English. Thank you for your help in advance.
Update: i found the reason of this problem. When i set webview scale is 1, it's seem ok but when i set scale large than 1, i have this bug. I also tested with default browser and the phenomenon is same. Can anyone help me?

Related

Has the iOS9 update caused C# codes not work properly?

I have a piece of code which is not working after the iOS9 update on devices, specifically Safari browser (Both iphone and ipad). It works fine in Chrome on the device using iOS9 but Safari is having sme kind of issue which I'm unable to debug. There was no issues in both the browsers on the device till iOS8.
Basically the functionality is a person needs to select 2 images from a set of images and click the GO button. If the images match with the ones saved at backend(DB) then he gets navigated to the next screen, else it shows a Cross symbol and refreshed the page asking the User to select the images again.
Please help and thanks.
Below is the piece of code which I feel is having the issue :
string cbref = Page.ClientScript.GetCallbackEventReference(this,
"arg", "fnGetOutputFromServer", "context");
string cbScr = string.Format("function fnCallServerMethod(arg," +
" context) {{ {0}; }} ", cbref);
Page.ClientScript.RegisterStartupScript(GetType(), "fnCallServerMethod", cbScr, true);
I put an alert within fnGetOutputFromServer but that never showed up in the device Safari browser. Please help me as I feel totally confused as to why it is not working. Also, I'm okay if I have to change the whole line to put a work around to this or by directly calling the function or something.
Note : This works fine in Chrome on an iOS9 device but does not work in Safari and the same works fine while emulating as iphone/ipad on the PC
Thanks again in advance.
http://www.brillianceweb.com/blog/article/69/aspnet-20-misidentifies-safari-71-on-ios-and-os-x
This fixed it !!! :)
I had to get the latest AppleWebkit version for iOS9 and got it updated in the configuration file which resolved the issue

Sencha Touch 2 textfield's focus issue in iOS 7

I'm having an issue with textfields in Sencha Touch 2, this is only occurring in iOS 7 and working fine in iOS 6 and Android.
The issue is when you tap a field the keypad opens but the cursor disappears, it should be focus on selected textfield but it does not. You have to tap the textfield again to focus.
I have checked this issue on iOS 6 and android (on devices as well as on simulators), working fine but not on iOS 7 only.
Is anybody having this issue...?
Is this a bug in sencha or should i missing something, please advice.
Thank you..
I have found this to be directly related to two things:
centered: true
pack: 'center'
When I removed those lines, my app started playing nice. The challenge is to find an alternative way to center your panels.
I spent days figuring this out. Actually there is a problem with Sencha understanding the ViewPort height. In your index.html add a script block with the following code
if (window.device && parseFloat(window.device.version) == 7.0) {
document.body.style.paddingTop = "20px";
Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight() - 20);
}
This does two things for you
It Provides enough space on Top to display the activity bar
It sets the Viewport height to be that of screen height, irrespective of the keyboard being present or not.
Also, If your app works in Portrait and Landscape mode, you will need to add these lines in your Viewport.js (or Main.js)
initialize: function(){
Ext.Viewport.on('orientationchange', 'handleOrientationChange', this, {buffer: 0 });
},
handleOrientationChange: function(){
try{
if (parseFloat(window.device.version) == 7.0) {
Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight() - 20);
}else{
Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight());
}
}catch(e){
// do nothing
}
},
And Yes, Make sure they Keyboard Bounce is TRUE in true (if you are using cordova). This will make sure your field does not get hidden.
Hope this works for you.
add height="device-height" in viewport meta tag, fixes the issue.
ios7 issues with webview focus when using keyboard html

Make/detect the iPhone/iPad post back on double tap

In an asp.net web application - without writing a mobile specific site, is there anyway of stopping double tapping on an iPhone, from zooming? The default behaviour should be to produce a postback (and is on my Android, and in normal web browsers) - but the iPhone appears to take this as a zoom command.
So my query is, how do I get the iPhone/iPad to recognise that I actually want to do a postback?
Thanks for any help,
Mark
if anyone is interested, my specific issue was, I had a popup on each cell of a grid (onmouseover...) - however, to start the postback, you have to actually click on a cell in the the grid, rather than hover over it. However, "hovering" on an iPhone is basically "clicking" on everything else - so when people were clicking, all that was happening, was the popup was showing again, and no postback was carried out - meaning people could not progress.
Solution was to detect for iPhone/Pad/Touch, and not output the "onmouseover" if those devices were detected - then the underlying click was available, and would do as designed.
Code to check for iPhone etc:
Dim iphone as Boolean = False
Dim userAgent = HttpContext.Current.Request.UserAgent.ToLower()
' iPhone is there
If userAgent.Contains("iphone") Then
iphone = True
ElseIf userAgent.Contains("ipad") Then
iphone = True
ElseIf userAgent.Contains("itouch") Then
iphone = True
End If
Hope this helps anyone else with this specific issue,

Html forms and mobile web browsers problem

Mobile keyboard (Android IPhone) has no tab button. That is why native application go to next field when enter is pressed. However browser forms are submitted when enter is pressed.
How can I solve this problem?
Use tabindex properly and it should work just like with native applications.
By the way, on Android at least, native apps don't have to do anything special to get this behavior (at most they have to specify nextFocusForward, if the layout is too complicated and Android can't figure that out by itself).
I assume you're talking about the on-screen keyboard. iPhone will show Previous | Next as a keyboard accessory in web forms. Android will too.
If they don't then something might be wrong with your markup. Is it possible for you to post your form HTML code?
I would also say that nLL's suggestion is correct. It will make it feel more polished.
since you are targeting high-end phones you can handle enter key with simple JavaScript
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
//Do something
}

android + phonegap combo box

I tried to create a combo box using in HTML for building an android phone gap application. Its working perfectly on a browser.But on an emulator the click function fails. Kindly please let me know on what could be the possible reason for this.
You likely need to trigger from 'tap' events instead of 'click'