android-webview

Automatic Testing for Cordova/Phonegap Webview on Android

坚强是说给别人听的谎言 提交于 2020-01-11 18:32:47
问题 I'm currently looking for a solution to test Android Apps automatically, native Android apps as well as hybrid Cordova/Phonegap apps. The UI Automator from Google looks pretty fine, but can not deal with WebViews, which makes it unusable for me. Then I found the promising automation framework Appium based on Selenium, which should also be able to deal with hybrid apps, but I couldn't get it to work with WebViews, it seems to not be implemented fully yet, as also several posts prove. After

Android setLayerType Webview

社会主义新天地 提交于 2020-01-11 10:56:11
问题 I am trying to create a WebView dynamically using the following code: mWebView = new WebView(this); mWebView.setId(R.id.webview); mWebView.setVerticalScrollBarEnabled(false); mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); mWebView.setHorizontalScrollBarEnabled(false); mWebView.setWebViewClient(mWebViewClient); mWebView.setWebChromeClient(mWebChromeClient); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); But,

How to set WebView Content in Center?

不羁岁月 提交于 2020-01-11 07:36:40
问题 I am loading some HTML content in WebView but its always coming in the top left corner of my WebView. I have tried to use stylesheet also, in stylesheet I have added center related tages but its not coming in center. others tags in stylesheet works fine. How to set content in WebView vertically and horizontally center ? my HTML Code <html><head> <style type=\"text/css\"> @font-face { font-family: MyCustomFont; src:url(\"file:///android_asset/fonts/MyriadPro-Regular.otf\") } body { font-family

WebView: webpage not available but I load it from an html string

你说的曾经没有我的故事 提交于 2020-01-11 07:06:48
问题 My html string is like this: <meta http-equiv=\"Content-Type\" content=\"text/html\"; charset=\"UTF-8\" /> <p style="text-align: justify;"> paragraph </p> <p style="text-align: justify;"> another one with <strong> strong attr </p> <p style="text-align: justify;"> in general p have <strong> strong</strong> and <em> em parts</em></p> and I load with: view.loadData(htmlString, "text/html", "UTF-8"); I have different html string, some of them are ok, but others give me this error...where is the

WebView: webpage not available but I load it from an html string

不羁岁月 提交于 2020-01-11 07:06:09
问题 My html string is like this: <meta http-equiv=\"Content-Type\" content=\"text/html\"; charset=\"UTF-8\" /> <p style="text-align: justify;"> paragraph </p> <p style="text-align: justify;"> another one with <strong> strong attr </p> <p style="text-align: justify;"> in general p have <strong> strong</strong> and <em> em parts</em></p> and I load with: view.loadData(htmlString, "text/html", "UTF-8"); I have different html string, some of them are ok, but others give me this error...where is the

Android - when exiting a WebView, the audio still keeps playing

落花浮王杯 提交于 2020-01-09 09:49:50
问题 I have this code which works and the only problem with it is that if I leave the WebView and even close the app, and even press power on the phone, the audio from the podcasts keeps playing. Would anyone know how to stop that? Here is the code: public class PodcastsActivity extends BaseActivity //implements ActionBar.OnNavigationListener { WebView webview = null; @Override public void onCreate(Bundle savedInstanceState) { //setTheme(R.style.Theme_Sherlock_Light); super.onCreate

How to get POST parameters from android webview's URL in onPageStart() method

风流意气都作罢 提交于 2020-01-07 07:10:33
问题 I'm making an webview app for Android and iPhone. In Android I'm facing an Issue I have a webview with custom WebviewClient like this webView.setWebViewClient(new MyWebViewClient()); here is my Custom WebviewClient class private class MyWebViewClient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { if (url.equalsIgnoreCase(MyConstants.fb_share)) { view.stopLoading(); //Want to get POST parameters embedded with the url. Intent i = new

Android webview file browser opens but file not selectable

被刻印的时光 ゝ 提交于 2020-01-07 02:11:46
问题 HTML Input type file in my android webview was not working for me so I found this solution (File Upload in WebView) and implemented the same, now I am able to open file browser. But now the problem is I can't select file. Nothing happens on tapping on any file and its shown grayed out as well (like disabled). I've checked on android 5 & 6 both none of them is working for me. Also I have these line in my manifest <uses-permission android:name="android.permission.INTERNET"/> <uses-permission

Html5 cache problems with android webview

感情迁移 提交于 2020-01-06 05:43:24
问题 Hello I tried to cache my web application with my android device. I tried everything but nothing will work. The Cache will not refresh only on android devices and not on other devices! Below you see all the settings I've set to cache the web application. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); web = (WebView) findViewById(R.id.webview); web.setWebViewClient(new myWebClient()); web.getSettings()

android phonegap/cordova change property on webview

江枫思渺然 提交于 2020-01-06 04:31:22
问题 In the past, I have changed a normal Webview property on Android. For example: wv.getSettings().setAllowUniversalAccessFromFileURLs(true); where wv is a variable of webview. Now, I have an phonegap/cordova app, and I want to change the same line of code, I have been trying the the following way: super.appView.getSettings().setAllowUniversalAccessFromFileURLs(true); and also like: super.appView.getSettings().setAllowUniversalAccessFromFileURLs(true); I don't get any compiling errors, but when