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.util.ArrayList;
import java.util.List;

public class Main {
    private static final String CORE_PREFIX = "Core_";
    private static final String FAE_PREFIX = "FAE_";

    /**
     * Get a list of all saved characters names.
     */
    public static List<String> listCharacterFileNames(Context context) {
        List<String> names = new ArrayList<>();

        for (String name : context.fileList()) {
            if (name.startsWith(CORE_PREFIX) || name.startsWith(FAE_PREFIX)) {
                names.add(name);
            }
        }

        return names;
    }
}