// Path: androidpn/src/main/java/com/githang/android/apnbb/Constants.java
// public class Constants {
// 
//     // PROPERTY
//     public static final String PROP_FILE_NAME = "androidpn";
// 
//     // PROPERTY KEYS
// 
//     public static final String PROP_API_KEY = "apiKey";
//     public static final String PROP_XMPP_HOST = "xmppHost";
//     public static final String PROP_XMPP_PORT = "xmppPort";
//     public static final String PROP_PACKET_LISTENER = "packetListener";
//     public static final String PROP_IQ = "iq";
//     public static final String PROP_IQ_PROVIDER = "iqProvider";
//     public static final String PROP_NOTIFY_ACTIVITY= "notifyActivity";
// 
//     // PROPERTY DEFAULT VALUES
// 
//     public static final String DEFAULT_HOST = "127.0.0.1";
//     public static final String DEFAULT_PORT = "5222";
// 
// 
//     // PREFERENCE
//     public static final String SHARED_PREFERENCE_NAME = "client_preferences";
// 
//     // PREFERENCE KEYS
// 
//     public static final String CALLBACK_ACTIVITY_PACKAGE_NAME = "CALLBACK_ACTIVITY_PACKAGE_NAME";
// 
//     public static final String CALLBACK_ACTIVITY_CLASS_NAME = "CALLBACK_ACTIVITY_CLASS_NAME";
// 
//     public static final String API_KEY = "API_KEY";
// 
//     public static final String VERSION = "VERSION";
// 
//     public static final String XMPP_HOST = "XMPP_HOST";
// 
//     public static final String XMPP_PORT = "XMPP_PORT";
// 
//     public static final String XMPP_USERNAME = "XMPP_USERNAME";
// 
//     public static final String XMPP_PASSWORD = "XMPP_PASSWORD";
// 
//     public static final String DEVICE_ID = "DEVICE_ID";
// 
//     public static final String EMULATOR_DEVICE_ID = "EMULATOR_DEVICE_ID";
// 
//     public static final String NOTIFICATION_ICON = "NOTIFICATION_ICON";
// 
//     public static final String SETTINGS_NOTIFICATION_ENABLED = "SETTINGS_NOTIFICATION_ENABLED";
// 
//     public static final String SETTINGS_SOUND_ENABLED = "SETTINGS_SOUND_ENABLED";
// 
//     public static final String SETTINGS_VIBRATE_ENABLED = "SETTINGS_VIBRATE_ENABLED";
// 
//     public static final String SETTINGS_TOAST_ENABLED = "SETTINGS_TOAST_ENABLED";
// 
//     // NOTIFICATION FIELDS
// 
//     public static final String NOTIFICATION_ID = "NOTIFICATION_ID";
// 
//     public static final String NOTIFICATION_API_KEY = "NOTIFICATION_API_KEY";
// 
//     public static final String NOTIFICATION_TITLE = "NOTIFICATION_TITLE";
// 
//     public static final String NOTIFICATION_MESSAGE = "NOTIFICATION_MESSAGE";
// 
//     public static final String NOTIFICATION_URI = "NOTIFICATION_URI";
// 
//     public static final String PACKET_ID = "PACKET_ID";
// 
// 
//     // INTENT ACTIONS
// 
//     public static final String ACTION_SHOW_NOTIFICATION = "org.androidpn.client.SHOW_NOTIFICATION";
// 
//     public static final String ACTION_NOTIFICATION_CLICKED = "org.androidpn.client.NOTIFICATION_CLICKED";
// 
//     public static final String ACTION_NOTIFICATION_CLEARED = "org.androidpn.client.NOTIFICATION_CLEARED";
// 
//     // INTENT_EXTRA
//     public static final String INTENT_EXTRA_IQ = "INTENT_IQ";
// 
//     // NAMESPACE
//     public static final String DEFAULT_NAMESPACE = "androidpn:iq:notification";
//     // ELEMENT_NAME
//     public static final String ELEMENT_NAME = "notification";
// 
// }
// 
// Path: androidpn/src/main/java/com/githang/android/apnbb/NotifierConfig.java
// public class NotifierConfig {
//     public static String packetListener;
//     public static String iq;
//     public static String iqProvider;
//     public static String notifyActivity;
// }


import java.util.Properties;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.util.Log;
import com.githang.android.apnbb.Constants;
import com.githang.android.apnbb.NotifierConfig;
import org.jivesoftware.smack.SmackConfiguration;


    private String xmppHost;

    private String xmppPort;

    private String callbackActivityPackageName;

    private String callbackActivityClassName;

    public ServiceManager(Context context) {
        this.context = context;

        if (context instanceof Activity) {
            Log.i(LOGTAG, "Callback Activity...");
            Activity callbackActivity = (Activity) context;
            callbackActivityPackageName = callbackActivity.getPackageName();
            callbackActivityClassName = callbackActivity.getClass().getName();
        }

        props = loadProperties();
        apiKey = props.getProperty(Constants.PROP_API_KEY, "");
        xmppHost = props.getProperty(Constants.PROP_XMPP_HOST, Constants.DEFAULT_HOST);
        xmppPort = props.getProperty(Constants.PROP_XMPP_PORT, Constants.DEFAULT_PORT);
        NotifierConfig.packetListener = props.getProperty(Constants.PROP_PACKET_LISTENER, null);
        NotifierConfig.iq = props.getProperty(Constants.PROP_IQ, null);
        NotifierConfig.iqProvider = props.getProperty(Constants.PROP_IQ_PROVIDER, null);
        NotifierConfig.notifyActivity = props.getProperty(Constants.PROP_NOTIFY_ACTIVITY, null);
        Log.i(LOGTAG, "apiKey=" + apiKey);
        Log.i(LOGTAG, "xmppHost=" + xmppHost);
        Log.i(LOGTAG, "xmppPort=" + xmppPort);

// Path: androidpn/src/main/java/com/githang/android/apnbb/Constants.java
// public class Constants {
// 
//     // PROPERTY
//     public static final String PROP_FILE_NAME = "androidpn";
// 
//     // PROPERTY KEYS
// 
//     public static final String PROP_API_KEY = "apiKey";
//     public static final String PROP_XMPP_HOST = "xmppHost";
//     public static final String PROP_XMPP_PORT = "xmppPort";
//     public static final String PROP_PACKET_LISTENER = "packetListener";
//     public static final String PROP_IQ = "iq";
//     public static final String PROP_IQ_PROVIDER = "iqProvider";
//     public static final String PROP_NOTIFY_ACTIVITY= "notifyActivity";
// 
//     // PROPERTY DEFAULT VALUES
// 
//     public static final String DEFAULT_HOST = "127.0.0.1";
//     public static final String DEFAULT_PORT = "5222";
// 
// 
//     // PREFERENCE
//     public static final String SHARED_PREFERENCE_NAME = "client_preferences";
// 
//     // PREFERENCE KEYS
// 
//     public static final String CALLBACK_ACTIVITY_PACKAGE_NAME = "CALLBACK_ACTIVITY_PACKAGE_NAME";
// 
//     public static final String CALLBACK_ACTIVITY_CLASS_NAME = "CALLBACK_ACTIVITY_CLASS_NAME";
// 
//     public static final String API_KEY = "API_KEY";
// 
//     public static final String VERSION = "VERSION";
// 
//     public static final String XMPP_HOST = "XMPP_HOST";
// 
//     public static final String XMPP_PORT = "XMPP_PORT";
// 
//     public static final String XMPP_USERNAME = "XMPP_USERNAME";
// 
//     public static final String XMPP_PASSWORD = "XMPP_PASSWORD";
// 
//     public static final String DEVICE_ID = "DEVICE_ID";
// 
//     public static final String EMULATOR_DEVICE_ID = "EMULATOR_DEVICE_ID";
// 
//     public static final String NOTIFICATION_ICON = "NOTIFICATION_ICON";
// 
//     public static final String SETTINGS_NOTIFICATION_ENABLED = "SETTINGS_NOTIFICATION_ENABLED";
// 
//     public static final String SETTINGS_SOUND_ENABLED = "SETTINGS_SOUND_ENABLED";
// 
//     public static final String SETTINGS_VIBRATE_ENABLED = "SETTINGS_VIBRATE_ENABLED";
// 
//     public static final String SETTINGS_TOAST_ENABLED = "SETTINGS_TOAST_ENABLED";
// 
//     // NOTIFICATION FIELDS
// 
//     public static final String NOTIFICATION_ID = "NOTIFICATION_ID";
// 
//     public static final String NOTIFICATION_API_KEY = "NOTIFICATION_API_KEY";
// 
//     public static final String NOTIFICATION_TITLE = "NOTIFICATION_TITLE";
// 
//     public static final String NOTIFICATION_MESSAGE = "NOTIFICATION_MESSAGE";
// 
//     public static final String NOTIFICATION_URI = "NOTIFICATION_URI";
// 
//     public static final String PACKET_ID = "PACKET_ID";
// 
// 
//     // INTENT ACTIONS
// 
//     public static final String ACTION_SHOW_NOTIFICATION = "org.androidpn.client.SHOW_NOTIFICATION";
// 
//     public static final String ACTION_NOTIFICATION_CLICKED = "org.androidpn.client.NOTIFICATION_CLICKED";
// 
//     public static final String ACTION_NOTIFICATION_CLEARED = "org.androidpn.client.NOTIFICATION_CLEARED";
// 
//     // INTENT_EXTRA
//     public static final String INTENT_EXTRA_IQ = "INTENT_IQ";
// 
//     // NAMESPACE
//     public static final String DEFAULT_NAMESPACE = "androidpn:iq:notification";
//     // ELEMENT_NAME
//     public static final String ELEMENT_NAME = "notification";
// 
// }
// 
// Path: androidpn/src/main/java/com/githang/android/apnbb/NotifierConfig.java
// public class NotifierConfig {
//     public static String packetListener;
//     public static String iq;
//     public static String iqProvider;
//     public static String notifyActivity;
// }


// Path: androidpn/src/main/java/org/androidpn/client/ServiceManager.java
import java.util.Properties;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.util.Log;
import com.githang.android.apnbb.Constants;
import com.githang.android.apnbb.NotifierConfig;
import org.jivesoftware.smack.SmackConfiguration;


    private String xmppHost;

    private String xmppPort;

    private String callbackActivityPackageName;

    private String callbackActivityClassName;

    public ServiceManager(Context context) {
        this.context = context;

        if (context instanceof Activity) {
            Log.i(LOGTAG, "Callback Activity...");
            Activity callbackActivity = (Activity) context;
            callbackActivityPackageName = callbackActivity.getPackageName();
            callbackActivityClassName = callbackActivity.getClass().getName();
        }

        props = loadProperties();
        apiKey = props.getProperty(Constants.PROP_API_KEY, "");
        xmppHost = props.getProperty(Constants.PROP_XMPP_HOST, Constants.DEFAULT_HOST);
        xmppPort = props.getProperty(Constants.PROP_XMPP_PORT, Constants.DEFAULT_PORT);
        NotifierConfig.packetListener = props.getProperty(Constants.PROP_PACKET_LISTENER, null);
        NotifierConfig.iq = props.getProperty(Constants.PROP_IQ, null);
        NotifierConfig.iqProvider = props.getProperty(Constants.PROP_IQ_PROVIDER, null);
        NotifierConfig.notifyActivity = props.getProperty(Constants.PROP_NOTIFY_ACTIVITY, null);
        Log.i(LOGTAG, "apiKey=" + apiKey);
        Log.i(LOGTAG, "xmppHost=" + xmppHost);
        Log.i(LOGTAG, "xmppPort=" + xmppPort);

        Log.i(LOGTAG, "packetListener=" + NotifierConfig.packetListener);
