Android Open Source - security-cam Settings Activity






From Project

Back to project page security-cam.

License

The source code is released under:

MIT License

If you think the Android project security-cam 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 berlin.reiche.securitas.activities;
// w ww . j  a va 2 s  .  c  o  m
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.util.Log;
import berlin.reiche.securitas.Client;
import berlin.reiche.securitas.R;
import berlin.reiche.securitas.util.NotificationDialog;

/**
 * Settings activity for configuring the server endpoint.
 * 
 * @author Konrad Reiche
 * 
 */
/**
 * @author Konrad
 *
 */
/**
 * @author Konrad
 * 
 */
public class SettingsActivity extends PreferenceActivity {

  /**
   * Key for the host preference.
   */
  public static final String HOST = "pref_host";

  /**
   * Key for the port preference.
   */
  public static final String PORT = "pref_port";

  /**
   * Key for the user preference.
   */
  public static final String USER = "pref_user";

  /**
   * Key for the password preference.
   */
  public static final String PASSWORD = "pref_password";

  /**
   * Key for the GCM Sender ID preference.
   */
  public static final String GCM_SENDER_ID = "pref_gcm_sender_id";

  /**
   * Key for displaying instruction boolean.
   */
  public static final String DISPLAY_INSTRUCTION = "displayInstruction";

  /**
   * Tag for logging.
   */
  private static final String TAG = SettingsActivity.class.getSimpleName();

  /**
   * Creates the preference screen and issues a notification dialog based on
   * the intent that started this activity.
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "onCreate");
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.preferences);
    if (getIntent().getExtras().getBoolean(DISPLAY_INSTRUCTION)) {
      NotificationDialog.create(this, R.string.configuration_hint).show();
    }
  }

  /**
   * When the user hits the back button the settings need to be updated and
   * propagated.
   */
  @Override
  public void onPause() {
    Log.i(TAG, "onPause");
    super.onPause();
    if (Client.isConfigured(this)) {
      Client.getController().restoreClientState();
    }
  }

}




Java Source Code List

berlin.reiche.securitas.Client.java
berlin.reiche.securitas.Settings.java
berlin.reiche.securitas.activities.Action.java
berlin.reiche.securitas.activities.LauncherActivity.java
berlin.reiche.securitas.activities.MainActivity.java
berlin.reiche.securitas.activities.SettingsActivity.java
berlin.reiche.securitas.activities.package-info.java
berlin.reiche.securitas.controller.ClientController.java
berlin.reiche.securitas.controller.Controller.java
berlin.reiche.securitas.controller.GCMIntentService.java
berlin.reiche.securitas.controller.GCMReceiver.java
berlin.reiche.securitas.controller.InboxHandler.java
berlin.reiche.securitas.controller.states.ControllerState.java
berlin.reiche.securitas.controller.states.DetectionState.java
berlin.reiche.securitas.controller.states.IdleState.java
berlin.reiche.securitas.controller.states.package-info.java
berlin.reiche.securitas.controller.tasks.BitmapDownloadTask.java
berlin.reiche.securitas.controller.tasks.DetectionRequest.java
berlin.reiche.securitas.controller.tasks.DeviceRegistration.java
berlin.reiche.securitas.controller.tasks.StatusTask.java
berlin.reiche.securitas.controller.tasks.package-info.java
berlin.reiche.securitas.controller.package-info.java
berlin.reiche.securitas.model.ClientModel.java
berlin.reiche.securitas.model.Model.java
berlin.reiche.securitas.model.Protocol.java
berlin.reiche.securitas.model.package-info.java
berlin.reiche.securitas.util.FlushedInputStream.java
berlin.reiche.securitas.util.HttpUtilities.java
berlin.reiche.securitas.util.NotificationDialog.java
berlin.reiche.securitas.util.package-info.java
berlin.reiche.securitas.package-info.java