// Path: src/org/emergent/android/weave/util/Dbg.java
// @SuppressWarnings("ConstantConditions")
// public static class Log {
// 
//   private static final int SHAMAN_LOG_LEVEL = android.util.Log.INFO;
// 
//   public static void v(String tag, String msg) {
//     if (android.util.Log.VERBOSE >= SHAMAN_LOG_LEVEL) android.util.Log.v(tag, msg);
//   }
// 
//   public static void d(String tag, String msg) {
//     if (android.util.Log.DEBUG >= SHAMAN_LOG_LEVEL) android.util.Log.d(tag, msg);
//   }
// 
//   public static void d(String tag, String msg, Throwable tr) {
//     if (android.util.Log.DEBUG >= SHAMAN_LOG_LEVEL) android.util.Log.d(tag, msg, tr);
//   }
// 
//   public static void i(String tag, String msg) {
//     if (android.util.Log.INFO >= SHAMAN_LOG_LEVEL) android.util.Log.i(tag, msg);
//   }
// 
//   public static void w(String tag, String msg) {
//     if (android.util.Log.WARN >= SHAMAN_LOG_LEVEL) android.util.Log.w(tag, msg);
//   }
// 
//   public static void w(String tag, Throwable tr) {
//     if (android.util.Log.WARN >= SHAMAN_LOG_LEVEL) android.util.Log.w(tag, tr);
//   }
// 
//   public static void w(String tag, String msg, Throwable tr) {
//     if (android.util.Log.WARN >= SHAMAN_LOG_LEVEL) android.util.Log.w(tag, msg, tr);
//   }
// 
//   public static void e(String tag, String msg) {
//     if (android.util.Log.ERROR >= SHAMAN_LOG_LEVEL) android.util.Log.e(tag, msg);
//   }
// 
//   public static void e(String tag, String msg, Throwable tr) {
//     if (android.util.Log.ERROR >= SHAMAN_LOG_LEVEL) android.util.Log.e(tag, msg, tr);
//   }
// }


import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import org.emergent.android.weave.util.Dbg.Log;
import java.io.File;
/*
 * Copyright 2012 Patrick Woodworth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.emergent.android.weave;



/**
 * @author Patrick Woodworth
 */
public class ShamanApplication extends Application implements Constants.Implementable {

  private static ShamanApplication sm_instance;

  @Override
  public void onCreate() {
    super.onCreate();
    sm_instance = this;
  }

  public static ShamanApplication getInstance() {
    return sm_instance;
  }

  public static String getApplicationName() {
    String retval = "?";
    try {
      Context context = getInstance();
      String pkgName = context.getPackageName();
      PackageInfo pInfo = context.getPackageManager().getPackageInfo(pkgName, 0);
      retval = context.getString(pInfo.applicationInfo.labelRes);
    } catch (PackageManager.NameNotFoundException e) {
// Path: src/org/emergent/android/weave/util/Dbg.java
// @SuppressWarnings("ConstantConditions")
// public static class Log {
// 
//   private static final int SHAMAN_LOG_LEVEL = android.util.Log.INFO;
// 
//   public static void v(String tag, String msg) {
//     if (android.util.Log.VERBOSE >= SHAMAN_LOG_LEVEL) android.util.Log.v(tag, msg);
//   }
// 
//   public static void d(String tag, String msg) {
//     if (android.util.Log.DEBUG >= SHAMAN_LOG_LEVEL) android.util.Log.d(tag, msg);
//   }
// 
//   public static void d(String tag, String msg, Throwable tr) {
//     if (android.util.Log.DEBUG >= SHAMAN_LOG_LEVEL) android.util.Log.d(tag, msg, tr);
//   }
// 
//   public static void i(String tag, String msg) {
//     if (android.util.Log.INFO >= SHAMAN_LOG_LEVEL) android.util.Log.i(tag, msg);
//   }
// 
//   public static void w(String tag, String msg) {
//     if (android.util.Log.WARN >= SHAMAN_LOG_LEVEL) android.util.Log.w(tag, msg);
//   }
// 
//   public static void w(String tag, Throwable tr) {
//     if (android.util.Log.WARN >= SHAMAN_LOG_LEVEL) android.util.Log.w(tag, tr);
//   }
// 
//   public static void w(String tag, String msg, Throwable tr) {
//     if (android.util.Log.WARN >= SHAMAN_LOG_LEVEL) android.util.Log.w(tag, msg, tr);
//   }
// 
//   public static void e(String tag, String msg) {
//     if (android.util.Log.ERROR >= SHAMAN_LOG_LEVEL) android.util.Log.e(tag, msg);
//   }
// 
//   public static void e(String tag, String msg, Throwable tr) {
//     if (android.util.Log.ERROR >= SHAMAN_LOG_LEVEL) android.util.Log.e(tag, msg, tr);
//   }
// }


// Path: src/org/emergent/android/weave/ShamanApplication.java
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import org.emergent.android.weave.util.Dbg.Log;
import java.io.File;

/*
 * Copyright 2012 Patrick Woodworth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.emergent.android.weave;



/**
 * @author Patrick Woodworth
 */
public class ShamanApplication extends Application implements Constants.Implementable {

  private static ShamanApplication sm_instance;

  @Override
  public void onCreate() {
    super.onCreate();
    sm_instance = this;
  }

  public static ShamanApplication getInstance() {
    return sm_instance;
  }

  public static String getApplicationName() {
    String retval = "?";
    try {
      Context context = getInstance();
      String pkgName = context.getPackageName();
      PackageInfo pInfo = context.getPackageManager().getPackageInfo(pkgName, 0);
      retval = context.getString(pInfo.applicationInfo.labelRes);
    } catch (PackageManager.NameNotFoundException e) {
      Log.e(StaticUtils.TAG, "Application name not found!", e);