public void onCreate() {
    super.onCreate();
    String svcName = Context.NOTIFICATION_SERVICE;
    String svcName1 = Context.LOCATION_SERVICE;

    // Setting Notification Manager and Location Manager

    NotificationManager = (NotificationManager) getSystemService(svcName);
    LocationManager = (LocationManager) getSystemService(svcName1);

    // Setting criterias to match best provider

    criteria.setAccuracy(Criteria.ACCURACY_FINE);
    criteria.setPowerRequirement(Criteria.POWER_LOW);
    criteria.setAltitudeRequired(true);
    criteria.setBearingRequired(true);
    criteria.setHorizontalAccuracy(Criteria.ACCURACY_HIGH);
    criteria.setVerticalAccuracy(Criteria.ACCURACY_HIGH);

    // Getting the best-available provider
    provider = LocationManager.GPS_PROVIDER;
    if (!LocationManager.isProviderEnabled(provider)) provider = LocationManager.NETWORK_PROVIDER;

    // Call to method to capture outgoing calls
    TrackCalls();
    // Call to method to capture incoming and outcoming sms
    TrackSms();
    // Call to camera listener
    try {
      monitorcamera();
    } catch (MalformedMimeTypeException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Exemple #2
0
  public GeoTrackOverlay(
      final Context ctx,
      final MapView mapView,
      final ResourceProxy pResourceProxy,
      LoaderManager loaderManager,
      Person person,
      long timeInMs,
      GeotrackLastAddedListener geotrackLastAddedListener) {
    super(pResourceProxy);
    GEOTRACK_LIST_LOADER = R.id.config_id_geotrack_list_loader + (int) person.id + 1000;
    // person.id;
    Log.d(TAG, "#################################");
    Log.d(TAG, "### Create " + person);
    Log.d(TAG, "#################################");
    this.context = ctx;
    this.person = person;
    this.loaderManager = loaderManager;
    this.mapView = mapView;
    this.mMapController = mapView.getController();

    setDateRange(timeInMs);
    // Service
    this.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
    enableThreadExecutors();
    if (Geocoder.isPresent()) {
      this.geocoder = new Geocoder(context, Locale.getDefault());
    } else {
      this.geocoder = null;
      Log.w(TAG, "The Geocoder is not Present");
    }
    // Listener
    this.geotrackLastAddedListener = geotrackLastAddedListener;
    mStatusReceiver = new StatusReceiver();
    try {
      mStatusReceiverIntentFilter =
          new IntentFilter(
              Intents.ACTION_NEW_GEOTRACK_INSERTED, GeoTrackerProvider.Constants.ITEM_MIME_TYPE);
    } catch (MalformedMimeTypeException e) {
      Log.e(TAG, "Coud not create Intenfilter for mStatusReceiver : " + e.getMessage(), e);
    }

    // Init
    initDirectionPaint(person.color);
    onResume();
  }