Tag Archives: webview

Html in CDATA doesn't show in webview

Questions: I am using webview in my application. I used it like below code: String htmlHeader = “<html>\n” + ” <head>\n” + ” <style>\n” + ” @font-face {\n” + ” font-family: \”VFont\”;\n” + ” src: url(‘file:///android_asset/fonts/vazir_bold.ttf’);\n” + ” }\n” + ” p,body {font-family: \”VFont\”}\n” + ” </style>\n” + ” </head>\n” + “<body dir=\”rtl\”,\n” + “font-family:… Read More »

Image saved from webview but not showing in Gallery

Questions: I want to download image from WebView by long press. The code works smoothly and downloads the image as far i think it saves in cache because whenever i try to open image it vanishes. I want to save permanently image in internal download folder. But if i set request.setDestinationInExternalPublicDir(); it crashes. what to… Read More »

Android Studio – Ad under webview doesn't load

Questions: I have an app, with webview, and under it – ad. It doesn’t show any sign of the ad! xml: <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.MainActivity”> <WebView android:id=”@+id/webwiew” android:layout_width=”match_parent” android:layout_height=”wrap_content” /> <com.google.android.gms.ads.AdView xmlns:ads=”http://schemas.android.com/apk/res-auto” android:id=”@+id/adView” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_alignParentBottom=”true” android:layout_centerHorizontal=”true” ads:adSize=”BANNER” ads:adUnitId=”adUnitId”> </com.google.android.gms.ads.AdView> </RelativeLayout> (I inserted adUnitId) Java: MobileAds.initialize(this, “App Identify”); AdView… Read More »

Change Camera in Webview

Questions: I am working on a WebView based app in which I am trying to access a link from which I can do a Video Call. All works fine but there is one problem that I can’t switch cameras. The link on which Video Call happens by default access rear camera, and I want to… Read More »

Android default locale change after webview open

Questions: I am stuck with webview and Locale. in my multilingual app when user change app language from app settings and then user navigate to webview inside app then app locale change to English which is device default language. Below is my code to change language from setting – private String Locale_English = “en”; private… Read More »

Alternative to JavaFX Webview which supports all audio sources? [on hold]

Questions: I am trying to embed https://virtualpiano.net/ into an application using JavaFX’s webview, however for some reason when the keys are pressed they do not play sound (animations confirm the mouseclick is registered though). I am assuming this is a shortcoming of webview and not a specific workaround that virtualpiano has to prevent ripping, if… Read More »

How to configure a clickable “WebView” that displays an image?

Questions: I created in Android Studio, a Layout which display CardView, and in each CardView there are a TextView widget and a WebView widget. <android.support.v7.widget.CardView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”280dp” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_margin=”2dp” app:cardCornerRadius=”6dp” android:gravity=”center”> <LinearLayout android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent” android:gravity=”center” android:id=”@+id/linearLayout_id” android:clickable=”true” android:foreground=”?android:attr/selectableItemBackground”> <WebView android:id=”@+id/card_web_id” android:layout_gravity=”center_vertical” android:layout_width=”match_parent” android:layout_height=”240dp”/> <TextView android:id=”@+id/card_title_id” android:textColor=”#2d2d2d” android:gravity=”center” android:textSize=”17dp” android:layout_width=”match_parent” android:layout_height=”match_parent” android:text=”Title”/> </LinearLayout> </android.support.v7.widget.CardView>… Read More »