Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;

import java.io.File;

public class Main {
    public static boolean isFirstRun(Context context) {
        String dirname = getDataDirectory(context) + "shared_prefs";
        File dir = new File(dirname);
        return !(dir.exists() && dir.isDirectory());
    }

    public static String getDataDirectory(Context context) {
        String dirname = String.format("/data/data/%s/", context.getApplicationContext().getPackageName());
        return dirname;
    }
}