Android Open Source - geocamMemoAndroid Geo Cam Memo Robo Application






From Project

Back to project page geocamMemoAndroid.

License

The source code is released under:

NASA OPEN SOURCE AGREEMENT VERSION 1.3 THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN COMPUTER SOFTWARE ORI...

If you think the Android project geocamMemoAndroid 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

// __BEGIN_LICENSE__
// Copyright (C) 2008-2010 United States Government as represented by
// the Administrator of the National Aeronautics and Space Administration.
// All Rights Reserved.
// __END_LICENSE__
// w  ww  . j a v  a 2  s  . com
package gov.nasa.arc.geocam.memo;
import gov.nasa.arc.geocam.memo.service.GeoLocationListener;

import java.util.List;

import roboguice.application.RoboApplication;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.location.Location;
import android.location.LocationManager;
import android.preference.PreferenceManager;

import com.google.inject.Injector;
import com.google.inject.Module;

/**
 * The Class GeoCamMemoRoboApplication.
 */
public class GeoCamMemoRoboApplication extends RoboApplication {
  
  /** The listener. */
  private GeoLocationListener listener;
  
  /** The module. */
  private Module module = new GeoCamMemoModule();
    
  /* (non-Javadoc)
   * @see android.app.Application#onCreate()
   */
  @Override
  public void onCreate() {
    listener = new GeoLocationListener();
    
    final Injector injector = getInjector();
    LocationManager locationManager = injector.getInstance(LocationManager.class);
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 1, listener);    
    
    injector.injectMembers(this);
    setDefaultSettings();
        super.onCreate();
  }
  
  /* (non-Javadoc)
   * @see roboguice.application.RoboApplication#addApplicationModules(java.util.List)
   */
  protected void addApplicationModules(List<Module> modules) {
        modules.add(this.module);
    }
    
    /**
     * Sets the module.
     *
     * @param module the new module
     */
    public void setModule(Module module) {
        this.module = module;
        
    }
    
    /**
     * Gets the location.
     *
     * @return the location
     */
    public Location getLocation() {
      return listener.getLocation();
    }
    
    
    /**
     * Sets the default settings.
     */
    private void setDefaultSettings() {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);

        Editor editor = prefs.edit();
        
        if(null == prefs.getString("webapp_username", null))
            editor.putString("webapp_username", getString(R.string.default_username));
        if(null == prefs.getString("webapp_password", null))
          editor.putString("webapp_password", getString(R.string.default_password));
        editor.commit();
    }
}




Java Source Code List

gov.nasa.arc.geocam.memo.GeoCamMemoModule.java
gov.nasa.arc.geocam.memo.GeoCamMemoRoboApplication.java
gov.nasa.arc.geocam.memo.UIUtils.java
gov.nasa.arc.geocam.memo.activity.GeoCamMemoCreateActivity.java
gov.nasa.arc.geocam.memo.activity.GeoCamMemoHomeActivity.java
gov.nasa.arc.geocam.memo.activity.GeoCamMemoMapActivity.java
gov.nasa.arc.geocam.memo.activity.GeoCamMemoMessageArrayAdapter.java
gov.nasa.arc.geocam.memo.activity.GeoCamMemoSettings.java
gov.nasa.arc.geocam.memo.bean.GeoCamMemoMessage.java
gov.nasa.arc.geocam.memo.exception.AuthenticationFailedException.java
gov.nasa.arc.geocam.memo.service.DjangoMemoImplementation.java
gov.nasa.arc.geocam.memo.service.DjangoMemoInterface.java
gov.nasa.arc.geocam.memo.service.DjangoMemoJsonConverterImplementation.java
gov.nasa.arc.geocam.memo.service.DjangoMemoJsonConverterInterface.java
gov.nasa.arc.geocam.memo.service.GeoLocationListener.java
gov.nasa.arc.geocam.memo.service.MemoMapOverlay.java
gov.nasa.arc.geocam.memo.service.SiteAuthCookieImplementation.java
gov.nasa.arc.geocam.memo.service.SiteAuthInterface.java