-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chandrakant naik
committed
Jan 1, 2020
1 parent
ed671e3
commit 9c7779a
Showing
19 changed files
with
1,301 additions
and
143 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/com/transerve/locationservices/manager/AppConstant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.transerve.locationservices.manager; | ||
|
||
public class AppConstant { | ||
|
||
public static final String HDOP_VALUE = "hdop"; | ||
public static final String PDOP_VALUE = "pdop"; | ||
public static final String VDOP_VALUE = "vdop"; | ||
public static final String SATELLITE_COUNT = "satellieCount"; | ||
public static final String NM_GNGSA = "$GNGSA"; | ||
public static final String NM_GPGSA = "$GPGSA"; | ||
|
||
} |
247 changes: 210 additions & 37 deletions
247
src/main/java/com/transerve/locationservices/manager/CoordinateManager.java
Large diffs are not rendered by default.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
src/main/java/com/transerve/locationservices/manager/models/DilutionOfPrecision.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2016 Sean J. Barbeau (sjbarbeau@gmail.com) | ||
* | ||
* 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 com.transerve.locationservices.manager.models; | ||
|
||
/** | ||
* Container class for DOP values | ||
*/ | ||
public class DilutionOfPrecision { | ||
|
||
double mPositionDop; | ||
|
||
double mHorizontalDop; | ||
|
||
double mVerticalDop; | ||
|
||
public DilutionOfPrecision(double positionDop, double horizontalDop, double verticalDop) { | ||
this.mPositionDop = positionDop; | ||
this.mHorizontalDop = horizontalDop; | ||
this.mVerticalDop = verticalDop; | ||
} | ||
|
||
public double getPositionDop() { | ||
return mPositionDop; | ||
} | ||
|
||
public void setPositionDop(double positionDop) { | ||
this.mPositionDop = positionDop; | ||
} | ||
|
||
public double getHorizontalDop() { | ||
return mHorizontalDop; | ||
} | ||
|
||
public void setHorizontalDop(double horizontalDop) { | ||
this.mHorizontalDop = horizontalDop; | ||
} | ||
|
||
public double getVerticalDop() { | ||
return mVerticalDop; | ||
} | ||
|
||
public void setVerticalDop(double verticalDop) { | ||
this.mVerticalDop = verticalDop; | ||
} | ||
} |
120 changes: 120 additions & 0 deletions
120
src/main/java/com/transerve/locationservices/manager/models/SatelliteStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
package com.transerve.locationservices.manager.models; | ||
|
||
import com.transerve.locationservices.manager.utils.GnssType; | ||
import com.transerve.locationservices.manager.utils.SbasType; | ||
|
||
public class SatelliteStatus { | ||
|
||
private int svid; | ||
private GnssType gnssType; | ||
private Float cn0DbHz; | ||
private Boolean hasAlmanac; | ||
private Boolean hasEphemeris; | ||
private Boolean usedInFix; | ||
private Float elevationDegrees; | ||
private Float azimuthDegrees; | ||
private SbasType sbasType; | ||
private Boolean hasCarrierFrequency; | ||
private Float carrierFrequencyH ; | ||
|
||
public SatelliteStatus(int svid, GnssType gnssType, Float cn0DbHz, Boolean hasAlmanac, Boolean hasEphemeris, Boolean usedInFix, Float elevationDegrees, Float azimuthDegrees) { | ||
this.svid = svid; | ||
this.gnssType = gnssType; | ||
this.cn0DbHz = cn0DbHz; | ||
this.hasAlmanac = hasAlmanac; | ||
this.hasEphemeris = hasEphemeris; | ||
this.usedInFix = usedInFix; | ||
this.elevationDegrees = elevationDegrees; | ||
this.azimuthDegrees = azimuthDegrees; | ||
sbasType = SbasType.UNKNOWN; | ||
hasCarrierFrequency = false; | ||
} | ||
|
||
public int getSvid() { | ||
return svid; | ||
} | ||
|
||
public void setSvid(int svid) { | ||
this.svid = svid; | ||
} | ||
|
||
public GnssType getGnssType() { | ||
return gnssType; | ||
} | ||
|
||
public void setGnssType(GnssType gnssType) { | ||
this.gnssType = gnssType; | ||
} | ||
|
||
public Float getCn0DbHz() { | ||
return cn0DbHz; | ||
} | ||
|
||
public void setCn0DbHz(Float cn0DbHz) { | ||
this.cn0DbHz = cn0DbHz; | ||
} | ||
|
||
public Boolean getHasAlmanac() { | ||
return hasAlmanac; | ||
} | ||
|
||
public void setHasAlmanac(Boolean hasAlmanac) { | ||
this.hasAlmanac = hasAlmanac; | ||
} | ||
|
||
public Boolean getHasEphemeris() { | ||
return hasEphemeris; | ||
} | ||
|
||
public void setHasEphemeris(Boolean hasEphemeris) { | ||
this.hasEphemeris = hasEphemeris; | ||
} | ||
|
||
public Boolean getUsedInFix() { | ||
return usedInFix; | ||
} | ||
|
||
public void setUsedInFix(Boolean usedInFix) { | ||
this.usedInFix = usedInFix; | ||
} | ||
|
||
public Float getElevationDegrees() { | ||
return elevationDegrees; | ||
} | ||
|
||
public void setElevationDegrees(Float elevationDegrees) { | ||
this.elevationDegrees = elevationDegrees; | ||
} | ||
|
||
public Float getAzimuthDegrees() { | ||
return azimuthDegrees; | ||
} | ||
|
||
public void setAzimuthDegrees(Float azimuthDegrees) { | ||
this.azimuthDegrees = azimuthDegrees; | ||
} | ||
|
||
public SbasType getSbasType() { | ||
return sbasType; | ||
} | ||
|
||
public void setSbasType(SbasType sbasType) { | ||
this.sbasType = sbasType; | ||
} | ||
|
||
public Boolean getHasCarrierFrequency() { | ||
return hasCarrierFrequency; | ||
} | ||
|
||
public void setHasCarrierFrequency(Boolean hasCarrierFrequency) { | ||
this.hasCarrierFrequency = hasCarrierFrequency; | ||
} | ||
|
||
public Float getCarrierFrequencyH() { | ||
return carrierFrequencyH; | ||
} | ||
|
||
public void setCarrierFrequencyH(Float carrierFrequencyH) { | ||
this.carrierFrequencyH = carrierFrequencyH; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/com/transerve/locationservices/manager/utils/ActivityCallbackProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.transerve.locationservices.manager.utils; | ||
|
||
import android.app.Activity; | ||
import android.content.IntentSender; | ||
import android.content.pm.PackageManager; | ||
import android.support.v4.app.ActivityCompat; | ||
import android.support.v4.content.ContextCompat; | ||
import android.util.Log; | ||
|
||
import com.google.android.gms.common.api.ResolvableApiException; | ||
import com.google.android.gms.location.LocationServices; | ||
import com.google.android.gms.location.LocationSettingsRequest; | ||
import com.google.android.gms.location.SettingsClient; | ||
import com.google.android.gms.tasks.Task; | ||
import com.transerve.locationservices.manager.MockActivityCallbackProvider; | ||
|
||
import static android.content.ContentValues.TAG; | ||
|
||
public class ActivityCallbackProvider { | ||
|
||
private Activity activity; | ||
private SettingsClient settingsClient; | ||
|
||
public ActivityCallbackProvider(Activity activity) { | ||
if (activity != null) { | ||
this.activity = activity; | ||
settingsClient = LocationServices.getSettingsClient(activity); | ||
} | ||
} | ||
|
||
public static ActivityCallbackProvider getMocker() { | ||
return new MockActivityCallbackProvider(); | ||
} | ||
|
||
public Task checkLocationSettings(LocationSettingsRequest mLocationSettingsRequest) { | ||
return settingsClient.checkLocationSettings(mLocationSettingsRequest); | ||
} | ||
|
||
public void requestPermissions(String[] strings, int requestPermissionsRequestCode) { | ||
ActivityCompat.requestPermissions(activity, strings, requestPermissionsRequestCode); | ||
} | ||
|
||
public boolean checkSelfPermission(String accessFineLocation) { | ||
int result = ContextCompat.checkSelfPermission(activity | ||
, accessFineLocation); | ||
return result == PackageManager.PERMISSION_GRANTED; | ||
} | ||
|
||
public void showGPSSettingDialog(Exception e, int data) { | ||
ResolvableApiException rae = (ResolvableApiException) e; | ||
try { | ||
rae.startResolutionForResult(activity, data); | ||
} catch (IntentSender.SendIntentException e1) { | ||
Log.i(TAG, "PendingIntent unable to execute request."); | ||
} | ||
} | ||
|
||
public boolean isAttached() { | ||
return true; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/transerve/locationservices/manager/utils/GnssType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (C) 2013 Sean J. Barbeau | ||
* | ||
* 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 com.transerve.locationservices.manager.utils; | ||
|
||
/** | ||
* Types of Global Navigation Satellite Systems | ||
*/ | ||
public enum GnssType { | ||
NAVSTAR, GLONASS, GALILEO, QZSS, BEIDOU, IRNSS, SBAS, UNKNOWN | ||
} |
Oops, something went wrong.