• Latest Code...

    Featured Post

    Implementing Hilt in a Kotlin Android Jetpack Compose Project with MVVM Architecture

     In modern Android development, maintaining a scalable codebase can be challenging, especially when it comes to dependency management. Hilt,...

    How to implement CSS file in Android App

    Here is the simplest way to implement your CSS file in android application.

    WebViews in your native Android app, to display HTML which is packaged with the app, then you can use CSS like in any HTML site.

    WebVie webView=(WebView) findViewById(R.id.webViewDetials);
    //webView.setBackgroundColor(0x00000000);
    webView.getSettings().setJavaScriptEnabled(true);

    StringBuilder sb = new StringBuilder();
    sb.append("<HTML><HEAD><LINK href=\"http://google.com/css/attribute.css\" type=\"text/css\" rel=\"stylesheet\"/></HEAD><body>");
    sb.append(attributes.toString());
    sb.append("</body></HTML>");
    webView.loadDataWithBaseURL(null, sb.toString(), "text/html", "utf-8", null);

    Happy Coding!!!

    Contact Form

    Name

    Email *

    Message *