Webview not displaying Twitter on some Droids - android

This is an obscure, possibly hardware dependent error.
I have a webview that is trying to display a twitter feed like this: http://twitter.com/HP
The view works fine on a Droid 2, but fails on Droid and Droid X.
Instead of displaying the page, it just displays the twitter logo and hangs forever.
about the devices:
All running the same software, and Android 2.2. However, they are running different flavors of Android 2.2.
Droid X: 2.2.1
Droid 1: 2.2.2
Droid 2: 2.2
It seems that Verizon must have added a bug or fixed a bug in their later versions of 2.2.

This is the answer:
add this:
webView.getSettings().setDomStorageEnabled(true);
(plus use code from here:
http://www.codelark.com/2010/09/13/backwards-compatibility-in-android-using-reflection/)
I have no idea why, but if you ever see an error message like this:
Web Console: Uncaught TypeError: Cannot read property 'profile' of undefined
then try adding this setting.

Related

Oreo - unable to set fresh values through setUserAgentString in WebView

I am facing an issue in WebView in devices running API 27 (8.1.0).
I pass off my params in the userAgentString based on which a php page loads the appropriate data. When I open the WebView for the first time it works well.
However, whenever I open the WebView after this first time (I call setUserAgentString each time I load it, with fresh values), it persists with that old value of userAgentString, thus not loading the correct data. This happens irrespective of whether I am in the same activity and re-using the same WebView, or move to a different activity where a new instance of WebView is used.
The following devices gave this odd behaviour -
Google Pixel 2XL, version 8.1.0
Xiaomi Mi A1, version 8.1.0
...and the webview was working perfectly on the following devices, not showing this behaviour -
Samsumg GALAXY Tab SM-T825, version 8.0.0
Moto G4, version 7.0.0
HTC Desire 526, version 4.4.2
I think this could be linked with how the Android Webview implementation has been changed to Chrome in Oreo.
However, the behaviour did not change irrespective of what I set as "Webview Implementation" in Developer settings, implying that may not be the cause.
Additionally, only when I clear data, or do a fresh install, is the userAgentString value reset.
I have read dozens of posts on SO, and tried all sorts of methods related to WebView and WebSettings, but I haven't managed to find a solution.
What am I missing here?
Maybe, this code can help you.
webView.clearCache(true);
webView.clearHistory();
webView.getSettings().setAppCacheEnabled(false);
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
Lucky :)
I experienced this issue recently and the problem was that the device had an outdated Chrome WebView framework. Simply update it via the Play Store and the issue should resolve.

Application running really slow when android os update to 4.1.2

I have made HTML5 application which is using vmoss platform, similar to phonegap. The application was running smoothly on samsung galaxy 10.1 tab with android version 4.0.4. After the client updated the device to android 4.1.2 now he is complaining of following issues.
Calendar control not working in new version
Text box controls having focus issues
Application GUI Issues because response is very slow
The page where issue of slowness comes is the page where child pages are loaded inside one of its div.
Can someone tell me, is it android os update issue or what?
i think it's because of the platform not updated to work/cope well with version 4.1.2
this one is vmoss platform issue.
Better try to run simple Html page with all these control without using the VMOSS at backend and see if there will be any issue.
Some time the version of Jquery doesn't fully support by the browser.

Problems with Twitter on Android App

I'm trying to show one public twitter profile in one WebView of my app, is not necessary to login twitter, in the MotoDev Simulator this works fine, but in the physical device don't work, this: "403 fobiden limite exceed rate" error appears, this is the simple code line that I'm using:
webView.loadUrl("https://mobile.twitter.com/#!/asambleaecuador");
and works fine into de MotoDev simulator AVD
....can somebody helpme please!!!
Thanks
Did you figure this out?
I was just wondering why you're trying to use "https://mobile.twitter.com/#!/asambleaecuador" instead of simply using "https://mobile.twitter.com/asambleaecuador".
Anyway, I just wanted to say that there's no "MOTODEV simulator AVD", MOTODEV Studio uses the regular Android SDK emulator, nothing special to it. And the problem you're facing is probably due to differences between the underlying implementation of the AVD browser and the one you have on your physical device - Android devices have a great amount of different browser implementations.

Weirdness on Android 2.1 browser: Twitter user page doesn't load

The URL which points to the user "coopthink" which works in most browsers, including Chrome and Safari on iOS is:
http://www.twitter.com/coopthink
However, if I try this on Android (I'm writing an app, but this even occurs directly in the browser), it redirects to:
https://mobile.twitter.com/#!/coopthink
and then says "Sorry, that page doesn't exist". Any idea what is wrong and what would be the correct URL?
EDIT: This seems to work on Android 2.2 and higher; only 2.1 (and possibly lower) show this problem.
Try this on a 2.2 and 2.1 emulator. I was getting some strange behavior previously with Android 2.2 and meta-tags on an emulator. See my previous post. It seems to be a bug with hashes and lower versions of the emulator code. I haven't tested it though on an actual device of the same generation.

sencha touch > phonegap > android 3.1 Acer A500 web page contains error

I have deployed android application made with sencha touch and phonegap,
and I don't have any problem with classic smartphone.
But with an ACER A500 on Android 3.1, a user have a problem :
"Application Error
The Web page contains an error. (file:///android_asset/www/index.html#false&en)"
false&en is my method for passed android variable preference to js.
after i split this.
The problem is when I use emulator (android 3.1) I don't have any error.
Have you an idea ?
See this Android issue ticket. It seems that URL's with the file protocol and parameters cause the problem in Android version > 3.0.
For example file://android_asset/index.html can be loaded OK, but
file://android_asset/index.html?dddd
or
file://android_asset/index.html#dddd
gives an error, regardless of notifying character ?, #, or whatever.
Interestingly, simulators does not spit out errors.

Categories

Resources