Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.net.Uri;

public class Main {

    public static boolean isWo2bHost(String url) {
        String host = getHost(url);
        if (host != null && host.indexOf("wo2b.com") != -1)
        // if (host != null && host.indexOf("wo2b") != -1)
        {
            return true;
        }

        return false;
    }

    public static String getHost(String url) {
        if (url == null || url.length() == 0) {
            return "<Unknown>";
        }

        return Uri.parse(url).getHost();
    }
}