Android WebView Alternative

I need to call a website inside my application that does not display correctly using its own web view that comes with Android.

I already searched the web for some answers, but I found a lot next to this Is there an alternative to web browsing? .

As suggested in the above post, I have already tested the crosswalk. However, the intersection has many disadvantages:

  • Very unstable and incomplete
  • Too much volume (including a walkway will blow you up by at least 50 MB).
  • IMHO is not ready for production.

So, I am really very desperately looking for an alternative, but cannot find.

Does anyone know a working and finished webview? That would help me a lot.

edit:

I had to add webView.getSettings().setDomStorageEnabled(true);to make the site work.

+4
source share
2 answers

New custom Chrome tabs for Android app developers.

You can get more detailed control by creating a user experience viewing on top of Androids WebView, but at the expense of more complex technical and unfamiliar work for users. A new feature in the latest version of Chrome, called user - defined tabs , addresses this trade-off by letting the app customize how Chrome looks and feels, making the transition from app to web content quick and seamless.

Google Chrome

: -

, Chrome

enter image description here

+2

- , @pRaNaY. :

    private static final String EXTRA_CUSTOM_TABS_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR";
    private static final String PACKAGE_NAME = "com.android.chrome";
    private CustomTabsClient mClient;


@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        warmUpChrome();
        launchUrl();
    }

   private void warmUpChrome() {
        CustomTabsServiceConnection service = new CustomTabsServiceConnection() {
            @Override
            public void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client) {               
                mClient = client;
                mClient.warmup(0);
            }

            @Override
            public void onServiceDisconnected(ComponentName name) {               
                mClient = null;
            }
        };

        CustomTabsClient.bindCustomTabsService(getApplicationContext(),PACKAGE_NAME, service);
    }

private void launchUrl() {
        Uri uri = getIntent().getData();
        if (uri == null) {
            return;
        }
        CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder().build();
        customTabsIntent.intent.setData(uri);
        customTabsIntent.intent.putExtra(EXTRA_CUSTOM_TABS_TOOLBAR_COLOR, getResources().getColor(R.color.red));


        PackageManager packageManager = getPackageManager();
        List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(customTabsIntent.intent, PackageManager.MATCH_DEFAULT_ONLY);

        for (ResolveInfo resolveInfo : resolveInfoList) {
            String packageName = resolveInfo.activityInfo.packageName;
            if (TextUtils.equals(packageName, PACKAGE_NAME))
                customTabsIntent.intent.setPackage(PACKAGE_NAME);
        }

        customTabsIntent.launchUrl(this, uri);
    }

Gradle:

  compile "com.android.support:customtabs:23.0.0"

:

hotUpChrome . deeplinks, , startUrl URI String . stackoverflow, .

+2

Source: https://habr.com/ru/post/1612732/


All Articles