Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.*;
import android.content.pm.*;

import android.net.*;

import android.util.DisplayMetrics;

import java.util.*;

public class Main {
    private static String c;
    private static DisplayMetrics e;

    public static String e(Context context) {
        if (c == null) {
            StringBuilder stringbuilder = new StringBuilder();
            PackageManager packagemanager = context.getPackageManager();
            List list = packagemanager.queryIntentActivities(
                    new Intent("android.intent.action.VIEW", Uri.parse("geo:0,0?q=donuts")), 0x10000);
            if (list == null || list.size() == 0)
                stringbuilder.append("m");
            List list1 = packagemanager.queryIntentActivities(
                    new Intent("android.intent.action.VIEW", Uri.parse("market://search?q=pname:com.google")),
                    0x10000);
            if (list1 == null || list1.size() == 0) {
                if (stringbuilder.length() > 0)
                    stringbuilder.append(",");
                stringbuilder.append("a");
            }
            List list2 = packagemanager.queryIntentActivities(
                    new Intent("android.intent.action.VIEW", Uri.parse("tel://6509313940")), 0x10000);
            if (list2 == null || list2.size() == 0) {
                if (stringbuilder.length() > 0)
                    stringbuilder.append(",");
                stringbuilder.append("t");
            }
            c = stringbuilder.toString();
        }
        return c;
    }
}