Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.reflect.Method;
import android.content.Context;

public class Main {
    public static String[] getTetherableIfaces(Context context) {
        String[] tetherableIfaces = null;
        Object connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE);
        Method tetherableInterfaces = null;
        try {
            tetherableInterfaces = connectivityManager.getClass().getMethod("getTetherableIfaces", new Class[] {});
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            tetherableIfaces = (String[]) tetherableInterfaces.invoke(connectivityManager, new Object[] {});

        } catch (Exception e) {
            e.printStackTrace();
        }
        return tetherableIfaces;
    }
}