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.content.Context;
import android.os.Environment;

import java.io.*;

public class Main {
    private static String getResourcesPath(Context context, String url) {

        String dir = String.format("/Android/data/%s/files/", context.getPackageName());
        File sd = Environment.getExternalStorageDirectory();
        File filePath = new File(sd.getPath() + dir + "savedResources");
        filePath.mkdirs();

        return filePath + url.substring(url.lastIndexOf("/"));
    }
}