Android Open Source - nosey Nosey






From Project

Back to project page nosey.

License

The source code is released under:

Apache License

If you think the Android project nosey listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.btellez.noseyexplorer;
/*ww  w. j  a v a2s  . c om*/
import android.content.Context;
import android.content.Intent;

import java.util.HashMap;
import java.util.Map;

import io.realm.RealmObject;

public class Nosey {
    protected Map<String, Class> objectTypes = new HashMap<String, Class>();
    
    private static Nosey instance;
    private Context context;

    private Nosey(Context context) {
        this.context = context;
    }
    
    public static Nosey getInstance(Context context) {
        if (instance == null)
            instance = new Nosey(context);
        return instance;
    }

    /**
     * Start the Nosey Explorer.
     */
    public void start() {
        Intent intent = new Intent(context, ModelSelectionActivity.class);
        context.startActivity(intent);
    }

    /**
     * Register a model to be explored
     * @param type
     * @return
     */
    public Nosey register(Class<? extends RealmObject> type) {
        objectTypes.put(type.getSimpleName(), type);
        return this;
    }
    
    public Nosey unregister(Class<? extends RealmObject> type) {
        objectTypes.remove(type.getSimpleName());
        return this;
    }

    public boolean isRegistered(String className) {
        return objectTypes.containsKey(className);
    }
}




Java Source Code List

com.btellez.nosey.ApplicationTest.java
com.btellez.nosey.MainActivity.java
com.btellez.nosey.SomeModelA.java
com.btellez.noseyexplorer.ApplicationTest.java
com.btellez.noseyexplorer.DisplayModelActivity.java
com.btellez.noseyexplorer.Inspector.java
com.btellez.noseyexplorer.ModelSelectionActivity.java
com.btellez.noseyexplorer.Nosey.java