Friday 4 November 2016

HOW TO Install WordPress on 000webhost | Famous Install 2017









  1. Download and unzip the WordPress package if you haven't already.
  2. Create a database for WordPress on your web server, as well as a MySQL (or MariaDB) user who has all privileges for accessing and modifying it.
  3. (Optional) Find and rename wp-config-sample.php to wp-config.php, then edit the file (see Editing wp-config.php) and add your database information.
  4. Upload the WordPress files to the desired location on your web server:
    • If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (excluding the WordPress directory itself) into the root directory of your web server.
    • If you want to have your WordPress installation in its own subdirectory on your website (e.g. http://example.com/blog/), create the blog directory on your server and upload the contents of the unzipped WordPress package to the directory via FTP.
    • Note: If your FTP client has an option to convert file names to lower case, make sure it's disabled.
  5. Run the WordPress installation script by accessing the URL in a web browser. This should be the URL where you uploaded the WordPress files.
    • If you installed WordPress in the root directory, you should visit: http://example.com/
    • If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/

Wednesday 19 October 2016

HOW TO: ANDROID TOOLBAR TUTORIAL

Hello Guys,
This is my first article. I hope that you guys will like my posts and benefit from them.
In this article I’ll be showing you how to create a toolbar for android apps. I will only be using Android studio for this.

What is a toolbar?


You can consider the Toolbar as a customizable Actionbar where you can change its width, height, color, text colour, padding and gravity. Just as in an Actionbar, you can add actions and icons to the Toolbar. A Toolbar is much better than an Actionbar, for it gives the developer more access to control his App Design .

Toolbar types


As I said, everything in a Toolbar can be customized. These pictures provided by Google show how a Toolbar  can be customized.
Android Floating ToolBar example
Android Floating ToolBar example

Android ToolBar example
Android ToolBar example
for more, click here.

How to add a toolbar to our app


Now lets see how to add a Toolbar to our app. All you need is Android Studio or Eclipse (I am using Android Studio).

What will we do?


  1. Use the  Theme.AppCompat.Light.NoActionBar  to prevent the system from showing the action bar.
  2. Define the app_bar.xml that has the ToolBar.
  3. Use <include> in your layout to show the toolbar.
  4. Instantiate the ToolBar by adding findViewById in your Activity.
  5. You need to call setSupportActionbar() and add your toolbar inside to replace the ActionBar with ToolBar.

So lets start!



  1. First, you need to prevent  the system from showing the Actionbar  in your app. So go to ‘Styles.xml’ and change the theme to
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

  1. Second, we need to create a new Toolbar layout file for the toolbar dimensions, color, and id.
To create a layout file, under layout directory, right click it >>new>>layout resource file and name it as ‘app_bar’ and change the root element to Toolbar. Now, you may get an error in your ‘app_bar.xml’ at <Toolbar ….>. To fix this, replace ‘<Toolbar>’ with ‘<android.support.v7.widget.Toolbar  …>’ and change the ending part to ‘</ android.support.v7.widget.Toolbar  >’. Now clean project by pressing  CTLR+ALT+L and the error should be fixed.
  1. Third in app_bar.xml, be sure that the width to ” match_parent ” and height to “wrap_content” .
  1. Fourth In activity_main.xml, we must add the toolbar to our activity ,to do that  add the following
<include>
layout="@layout/app_bar"
android:id="@+id/app_bar"
</include>
and hit CTRL+ALT+L to clean your preoject
  1. Now lets move to our MainActivity
In MainActivity.Java we need to tell android that “Hey! I am not using your Actionbar anymore. Rather, I am using my own ToolBar!”. To do that you must make a variable for the toolbar. So add  private Toolbar toolbar; .
Now under OnCreate Method write the following:
toolbar = findViewById(R.id.app_bar);
setSuppotActionBar(toolbar);
To customie your ToolBar you can change its color by changing the background color in the app_bar.xml,also you can add icons and components in the ToolBar(the ToolBar i considered as any other component so you can put stuffs above it or anywhere.

 Errors that you may face:


So by this we completed our Tutorial and you got your Actionbar working. Here is a list of errors you may face when adding Toolbar:
1. When creating toolbar layout resource file  you may get an error in your app_bar.xml at <Toolbar ….> , to fix this replace “<Toolbar> ” with ” <android.support.v7.widget.Toolbar  …>” and change the end to “</ android.support.v7.widget.Toolbar  > “  . Now clean project by pressing  CTLR+ALT+L and the error should be fixed.
2. When adding
 toolbar = findViewById(R.id.app_bar);
setSuppotActionBar(toolbar);
to MainActivity.Java you may get an error. To solve it import the toolbar to your project by adding this:
import android.support.v7.widget.Toolbar;

Complete!


Now your ToolBar should be working perfectly.I hope you guys liked this Android ToolBar tutorial and found it helpful. Please be sure to follow our website. Peace!

251INR WORLD’S CHEAPEST SMARTPHONE TO HIT INDIA (3.67$!)

Is it possible to find a smartphone sporting a 4 inch display, running Android 5.1 Lollipop, having WiFi, Bluetooth, a 3.1 rear camera and a 0.3 front Camera, a 1450 mAh Battery and one year warranty, for a price tag of 3.67$? That seems to be impossible. But not in India! A new smartphone, that may be considered as the cheapest smartphone worldwide, is going to hit the Indian markets in less than 2 days, Ringing Bell’s ‘Freedom251’!
The Freedom 251 aims to be a smartphone which anybody can buy. But it’s not just any other cheap smartphone. This smartphone has great features concerning to it’s price, which is 3.67$ or 251 Indian Rupees. Sweet!

Design


This smartphone borrows a lot of it’s looks from the iPhone 6. It has a round home button, curved edges, and the camera is positioned at the top right along with the flash. The Freedom 251 will have a 4 inch qHD IPS display (a resolution of 540 pixels by 960 pixels). Which is the nearly same size as the iPhone 5/5S, so you will not find a lot of difference in size as we were expecting for the price.Freedom 251

Camera


The Freedom 251 packs a 3.2MP rear camera with auto focus, and a 0.3 MP front camera for your selfies. The rear camera will hold up okay, but the front camera seems to be of a very low resolution. We’ll have to test that to see if it’s practically of any use. It will capture a few details in your rear shots, while the front camera might just barely get the job done. No complains though, for the price, we were not even expecting any second camera on the device.

Performance and Storage


The 251 rupees smartphone comes with a surprising 1.3GHz Quadcore processor which will be sufficient enough to give smooth and responsive performance, they claim. 1 GB RAM will be coupled with the processor to make sure that there is no lag at least when lightly using the phone. It comes with 8 GB of internal memory. More you ask? No problem! It supports up to 32 GB of expandable storage via a microSD card!

Battery


On paper, it has a 1450 mAh battery which we think is enough to last you a day or more, as the phone is not resource heavy. Quoting; “With 1450 mAh, you will not need to worry about running out of power! Talk, text, play and do whatever you want !”
We’re going to post a device review once we get hands on this device and get enough time to play and test it. Let us know in the comments what you’d like to know about the device so we can cover up all the things you need to know in the review!
Well that’s it! That’s what a 251 Rupee smartphone can do! So before you decide to have a launch at a local fast-food chain, think well about what can be done with that money!

Thursday 13 October 2016

How To Install TWRP and ROOT S7 EDGE SM-G935F/FD/X | SM-G935K/L/S | SM-G935W8 |Exynos



After the Note 7 has been exploding widely and Samsung stop manufacturing more from it people went to get the previous phone from Samsung,S7 Edge.So I made this tutorial to benefit you guys and guide you to the right way to root your S7 Edge!

After I tried many ways to root my phone and got stuck at some,bricked at another,and boot-loop on some I wen to search more and more until I tried this method last night and got my phone rooted in about 5 minutes!!

No No No I didn't use any of those funny one click root apps,I just flashed TWRP using ODIN then flashed the SuperSU from the recovery !!

Please do not do anything from your mind,watch the video to know how to to that because Odin is usually dangerous! 

WARNING #1: Flashing a custom recovery to your device will trip the Knox warranty bit on your phone. Check with your mobile provider to see if they will still cover warranty on Knox bit triggered devices. If you understand this risk, continue on.
You generally don't have to worry, as it's incredibly hard to brick a Samsung device, and physical damage warranties should be exempt from Knox triggering.

WARNING #2: The Galaxy S7 stock boot image has dm-verity, which prevents you from booting if you swipe to enable system modifications!
SOLUTION: Follow the full rooting steps below, in order, to allow system modifications without the risk of a boot loop!



Don't forget to subscribe and like




Downloads


TWRP for hero2lte.img.tar

SR1-SuperSU-v2.78-SR1-20160915123031.zip

FULL STEPS TO ROOT S7 EDGE


You can follow this video by me above i you want


Otherwise, follow these instructions:

  1. In your ROM, go to Settings -> About device. Tap 7 times on Build number to enable Developer options.
  2. Now go to Settings -> Developer options. (above About device)
    You need to enable OEM unlock, otherwise you might end up with boot problems or be unable to flash later on.
  3. Extract Odin_3.12.3.zip to your computer.
  4. Install Samsung Mobile Phone Drivers for Odin to find your device.
  5. Download a .tar image of TWRP for hero2lte.
  6. Reboot your device into Download mode. To do this, select reboot from the power menu and hold the [Volume Down] + [Home] buttons while your device reboots.
    Once you reach the Download mode warning screen, press [Volume Up] to continue.

  7. Open Odin and place that TWRP tar file in the [AP] slot and disable Auto-Reboot, then press [Start].

  8. Hold [Volume Down] + [Home] + [Power] to get out of Download mode and immediately swap to [Volume Up] when the screen blanks.
    If you don't see then TWRP boot splash try again from step 6.
  9. At this point, you will reach the screen asking you if you want to allow system modifications.
    By swiping right, you will trigger dm-verity, and if you don't follow step 11 you will be unable to boot!
    If you are going to root your device and follow the rest of these steps, then it is safe to swipe right and enable modifications.
  10. Only if you want internal storage or data to work in TWRP:
    Go to [Wipe] -> [Format Data] (not advanced wipe) -> type "yes".
    WARNING: This will wipe your internal storage, disable encryption, and factory reset your phone!
    Go to [Reboot] -> [Recovery].

  1. If you want to be rooted with SuperSU:
    Download the latest SuperSU by Chainfire.
    Without exiting TWRP, transfer the SuperSU zip to your device over MTP* and flash it using [Install] in TWRP.

    If you only want a bootable system partition or writable data in TWRP:
    Download the latest dm-verity and force encryption disabler zip.
    Without exiting TWRP, transfer the no-verity-opt-encrypt zip to your device over MTP* and flash it using [Install] in TWRP.
  2. Go to [Reboot] -> [System].
  3. Wait 2-5 minutes for your device to finish setting itself up.
Steps Taken from Xda thread!

Sunday 9 October 2016

How To add Gadget inside Blogger Blog Header for Any Stuff

Step-1 (Default Header Layout):

Login into your blogger account and visit theLayout section of your blog to see the header position whether it is single or has already been divided. Here is screenshot for the default blogger blog header.
If your blog contains only one column in header section as above, then follow the next steps to divided it into two parts.

Step-2 (Template Editor):

Go to the Template section of your blog and click on Edit HTML text button next to the Customize button. See the screenshot for template Edit HTML button.

Step-3 (Edit Template):

Click on Jump to widget from the top drop down menu and select Header1 as shown in this screenshot.

Step-4 (Delete Default Header Section):

You will see codes which represents default blogger blog header section.

Now, delete all these codes so that the older header section will be deleted.

Step-5 (Insert New Header Section):

Copy and paste these HTML codes in place of old header section deleted codes as shown in this screenshot.
  1. <!-- SWT Header Section START --><div class='region-inner swt-header-inner'>
  2. <b:section class='header-left' id='header-left' maxwidgets='1' name='Header-Left' showaddelement='yes'/>
  3. <b:section class='header-right' id='header-right' maxwidgets='1' name='Header-Right' showaddelement='yes'/>
  4. </div><!-- HELP: http://www.superwebtricks.com/display-adsense-in-blog-header -->
Don’t delete the HELP URL address from the last line of above code as it may help you in future for any updated tutorial and code upgradation.

Step-6 (CSS for New Header Section):

Now, press Ctrl + F for search the ]]></b:skin> and paste the following CSS codes above/before it.
  1. .swt-header-inner { /* HELP: http://www.superwebtricks.com/?p=570 */
  2. width: 100%; display: flex;
  3. }
  4. .header-left {
  5. width:50%;
  6. margin:0;
  7. padding: 0;
  8. float:left;
  9. overflow:hidden;
  10. }
  11. .header-right {
  12. width:50%;
  13. margin:0;
  14. padding: 0;
  15. float:right;
  16. overflow:hidden;
  17. /* Blog Header inserted by www.superwebtricks.com */}
See the screenshot here.
Now, click on Save Template to save the all avobe steps in your blog template.
Customization: You may adjust the width of Header-Left and Header-Right section in accordance with the title/logo of your blog or the size of AdSense Ads to be displayed.
You may also specify the width in pixel instead of percentage. Suppose you want to show your blog LOGO (70px) on the left side and insert AdSense codes (728px) on the right side in header section. Replace the CSS codes of header-left width:70px;and header-right width:730px; depending of your blog layout width (800px).

Step-7 (Insert New Gadget):

Navigate the layout section of your blog to see the difference. Here is the screenshot.T

How To Play Local Video in VideoView Android Studio-Java

Learn from this tutorial how to Play mp4 Movie using VideoView in Android Studio version 1.4.
Create New Project with Application name “Play Video“; Minimum SDK – API 9: Android 2.3 (Gingerbread).
Create New Directory in app -> res with name “raw“.
Copy a video you want to display, in new created folder, raw; I used in this example a video with name “movie.mp4“. You can download it from here.
In file activity_main.xml, create a VideoView to display your video.
<VideoView
android:id="@+id/videoView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
In file activity_main.xml, create a transparent Button to play again video, on click.
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:background="@android:color/transparent" />
Complete code in MainActivity.java (in onCreate).
Button buttonPlayVideo2 = (Button)findViewById(R.id.button1);
getWindow().setFormat(PixelFormat.UNKNOWN);
//displays a video file
VideoView mVideoView2 = (VideoView)findViewById(R.id.videoView1);
String uriPath2 = "android.resource://com.example.toyo.playvideo/"+R.raw.movie;
Uri uri2 = Uri.parse(uriPath2);
mVideoView2.setVideoURI(uri2);
mVideoView2.requestFocus();
mVideoView2.start();
buttonPlayVideo2.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
VideoView mVideoView2 = (VideoView) findViewById(R.id.videoView1);
// VideoView mVideoView = new VideoView(this);
String uriPath = "android.resource://com.example.toyo.playvideo/" + R.raw.movie;
Uri uri2 = Uri.parse(uriPath);
mVideoView2.setVideoURI(uri2);
mVideoView2.requestFocus();
mVideoView2.start();
}
});
how to Play Video in Android Studio 1.4
Run the app in Emulator.
Enjoy the result!
Attention: the app is working only with Video with extension mp4. If you have an .avi movie or other extension, convert it on mp4 and add video to Android project.
Watch the video tutorial to Play Video in Android Studio version 1.4:
Download app PlayVideo.apk from here and install it on your device to play video.
For further questions leave a message.

Thursday 2 April 2015

[TUTORIAL]Create WebView App Using Android Studio [100%]

This Method worked 100% for me and i highly recommend using it

Getting started with the Android WebView is fairly simple, whether you want load a remote URL or display pages stored in your app.
This tutorial walks you through creating a new Android Project, adding a WebView, loading a remote URL, and then loading a local HTML page.
Note: This tutorial assumes you're a developer with limited or no experience with the Android development environment, but have some experience with Java. If you're already familiar with programming for Android, you may want to refer to to Building Web Apps in WebView on the Android developer site instead.
This tutorial uses Android Studio, the new design-and-build IDE for Android. So you'll need start off by installing Android Studio, as described here:
When the installation completes, Android Studio launches and displays the welcome screen.
To create a new project:
  1. Click New Project.
  2. On the next page, enter your application name, package name and target SDKs, and click Next.
    Note: If you only intend to support the Chromium WebView (rather than the old WebKit WebView) setMinimum required SDK to API 19: Android 4.4 (KitKat).
  3. On the next page, you're prompted to enter an application icon. (You can change the icon later, so don't worry if you don't have one right now.) When you're done, click Next.
  4. The next page lets you select the main Android activity for your application. For the purposes of this guide, select Blank Activity and click Next.
    Note: An Android Activity can be viewed as a screen of an app. In this case, the application's main activity will hold the web view. If you're planning to venture further into native Android development, you can find more information in the Android Activities API guide
  5. The next page lets you change the names for the default Activity and layout. Click Finish to accept the defaults and create the project.
    You now have a new Android project. Next, to add the WebView!
Note: After you have your project created, make sure you have the KitKat SDK installed. Go to Tools > AndroidSDK Manager and make sure you have Android 4.4 (API 19) installed.
Android Studio will give you some boilerplate code to set up your application. Your project's structure should look something like this:
A few of the more import folders are identified in the picture:
  1. src/main/java. Android Java source code.
  2. src/main/res. Resources used by the native application.
  3. src/main/res/drawable-type. Image resources used by the native application.
  4. src/main/res/layout. XML layout files that define the structure of UI components.
  5. src/main/res/values. Dimensions, strings, and other values that you might not want to hard-code in your application.
  6. src/main/AndroidManifest.xml. The manifest file defines what's included in the application: activities, permissions, themes, and so on.
You need to add a WebView to the main activity's layout.
  1. Open the activity_main.xml file in the src/main/res/layout directory if it is not already open. (You may also see a fragment_main.xml file. You can ignore this, as it's not required for this tutorial.)
    Select the Text tab at the bottom of the of the activity_main.xml editor to see the XML markup.
    This file defines the layout for your main activity, and the Preview panes show the a preview of the activity. The Blank Activity layout doesn't include any children. You'll need to add the WebView.
  2. In the XML pane, remove the self-closing slash from the end of the FrameLayout element, and add the <WebView> element and a new closing tag, as shown:
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:tools="http://schemas.android.com/tools"
         android:id="@+id/container"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         tools:context=".MainActivity">
         tools:ignore="MergeRootFrame">
         
             <WebView
             android:id="@+id/activity_main_webview"
             android:layout_width="match_parent"
             android:layout_height="match_parent" />
    </FrameLayout>
  3. To use the WebView you need to reference it in the Activity. Open the Java source file for the main activity,MainActivity.java in the src/main/java/<PackageName> directory.
    Add the lines shown in bold.
    public class MainActivity extends Activity {
        
        private WebView mWebView;
        
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            
            mWebView = (WebView) findViewById(R.id.activity_main_webview);
    
    The existing code in the onCreate method does the work of hooking up the Activity with the layout. The added lines create a new member variable, mWebView, to refer to the web view.
    Remove the following code:
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
            .add(R.id.container, new PlaceholderFragment())
            .commit();
    }
    The WebView is identified by the resource ID, which is specified by this line in the layout file:
    android:id="@+id/activity_main_webview"
    After adding the code, you'll see some warning messages in the margin of the editor. This is because you haven't imported the right classes for WebView. Luckily Android Studio can help you fill in the missing classes. The easiest way to do this is click and hover over an unknown class name and wait for a popup showing a "quick fix" -- in this case, adding an import statment for the WebView class.
    Press Alt + Enter (Option + Enter on Mac) to accept the quick fix.
    WebView in hand you can move on to setting it up and and loading some juicy web content.
WebViews don't allow JavaScript by default. To run a web application in the web view, you need to explicitly enable JavaScript by adding the following lines to the onCreate method:
// Enable Javascript
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
If you're going to load data from a remote URL, your application needs permission to access the internet. This permission needs to be added in the application's manifest file.
  1. Open the AndroidManifest.xml file in the src/res directory. Add the line in bold before the closing </manifest> tag.
    <?xml version="1.0" encoding="utf-8"?>
    <manifest ...>
    ...
     
        </application>
        
        <uses-permission android:name="android.permission.INTERNET" />
        
    </manifest>
  2. The next step is to call the loadUrl method on the webview. Add the following line to the end of theonCreate method.
    mWebView.loadUrl("http://beta.html5test.com/");
    Now try running the project. If you don't have a device handy, you can create an emulator (AVD or Android Virtual Device) by going to Tools > Android > AVD Manager.
Note: To detect when a URL has started and finished loading, use WebViewClient.onPageStarted andWebViewClient.onPageFinished.
Now try changing the URL you're loading to http://www.html5rocks.com/ and rerun your application. You'll notice something strange.
If you run the application now with a site that has a redirect like html5rocks.com, your app ends up opening the site in a browser on the device, not in your WebView -- probably not what you expected. This is because of the way the WebView handles navigation events.
Here's the sequence of events:
  1. The WebView tries to load the original URL from the remote server, and gets a redirect to a new URL.
  2. The WebView checks if the system can handle a view intent for the URL, if so the system handles the URL navigation, otherwise the WebView will navigate internally (i.e. the user has no browser installed on their device).
  3. The system picks the user's preferred application for handling an http:// URL scheme -- that is, the user's default browser. If you have more than one browser installed, you may see a dialog at this point.
browser selection dialog
If you're using a WebView inside an Android application to display some simple web content (for example, a help page), this may be exactly what you want to do. However, for more sophisticated applications, you may want to handle the navigation links yourself.
To handle navigation inside the WebView you need to override the WebView's WebViewClient, which handles various events generated by the WebView. You can use it to control how the WebView handles link clicks and page redirects.
The default implementation of WebViewClient makes any URL open in the WebView:
// Force links and redirects to open in the WebView instead of in a browser
mWebView.setWebViewClient(new WebViewClient());
This is a good step forward, but what if you want to handle links for your site only, while opening other URLs in a browser?
To achieve this you need to extend the WebViewClient class and implement theshouldOverrideUrlLoading method. This method is called whenever the WebView tries to navigate to a different URL. If it returns false, the WebView opens the URL itself. (The default implementation always returns false, which is why it works in the previous example.)
Create a new class:
  1. Right-click the package name of your app and select New > Java Class
  2. Enter MyAppWebViewClient as the class name and click OK
  3. In the new MyAppWebViewClient.java file, add the following code (changes shown in bold):
    public class MyAppWebViewClient extends WebViewClient {
            
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                if(Uri.parse(url).getHost().endsWith("html5rocks.com")) {
                    return false;
                }
                 
                Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                view.getContext().startActivity(intent);
                return true;
            }
        }
    The new code defines MyAppWebViewClient as a subclass of WebViewClient and implements theshouldOverrideUrlLoading method.
    The shouldOverrideUrlLoading method is called whenever the WebView is about to load a URL. This implementation checks for the String "html5rocks.com" at the end of the host name of the URL. If the string exists, the method returns false, which tells the platform not to override the URL, but to load it in the WebView.
    For any other hostname, the method makes a request to the system to open the URL. It does this by creating a new Android Intent and using it to launch a new activity. Returning true at the end of the method prevents the URL from being loaded into the WebView.
  4. To use your new custom WebViewClient, add the following lines to your MainActivity class:
    // Stop local links and redirects from opening in browser instead of WebView
        mWebView.setWebViewClient(new MyAppWebViewClient());
        
    Now, a user can click any of the HTML5Rocks links and stay within the app, but links to external sites are opened in a browser.
As you start playing around and navigating the awesome HTML5Rocks articles, hitting the back button on Android exits the application, even though you've explored a few pages of the site.
WebView has a method canGoBack which tells you if there is anything on the page stack that can be popped. All you need to do is detect a back button press and determine if you should step back through the WebView's history or allow the platform to determine the correct behaviour. Inside your MainActivity class, add the following method (in bold):
public class MainActivity extends Activity {
   
 private WebView mWebView;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
     ...
 }
   
    @Override
    public void onBackPressed() {
        if(mWebView.canGoBack()) {
            mWebView.goBack();
        } else {
            super.onBackPressed();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
       ...
    }
    
}
A big advantage of using a WebView inside an installable application is that you can store assets inside the app. This lets your app work offline and improves load times, since the WebView can retrieve assets directly from the local file system.
To store files such as HTML, JavaScript, and CSS locally, put them in the assets directory. This is a reserved directory that Android uses for raw files that your app may need access to (i.e. files it knows it should minimise or compress).
In your project, create the assets directory in main (src/main/assets).
Generally it's good practice to keep your web files in a subdirectory, so create a www directory and put all your web content in it.
Note: Absolute paths do not work in the WebView when referring to other files, such as CSS and JavaScript. So make sure you make all references relative, instead of absolute (for example, instead of "/pages/somelink.html", use "./pages/somelink.html").
Once you have everything in your assets directory, it's as simple as loading in the appropriate file:
mWebView.loadUrl("file:///android_asset/www/index.html");
You'll want to tweak the shouldOverrideUrlLoading method so it opens a browser for non-local pages:
public class MyAppWebViewClient extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if(Uri.parse(url).getHost().length() == 0) {
            return false;
        }

        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        view.getContext().startActivity(intent);
        return true;
    }

}
Now you are set to build a great WebView app!
For tips on getting the visuals just right, see Pixel-Perfect UI in the WebView.
If you run into trouble, the Chrome DevTools are your friends. See Remote Debugging on Android to get started.
source