SmartScheduler.JobScheduledCallback callback = new SmartScheduler.JobScheduledCallback() {
@Override
public void onJobScheduled(Context context, Job job) {
// Handle onJobScheduled here
}
};
Job.Builder builder = new Job.Builder(JOB_ID, callback, jobType, JOB_PERIODIC_TASK_TAG)
.setRequiredNetworkType(networkType)
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
public class MyHTMapActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
// Your Activity's onCreate() code here | |
// Instantiate HTMapFragment placed inside your activity layout | |
HTMapFragment htHTMapFragment = (HTMapFragment) getSupportFragmentManager().findFragmentById(R.id.htMapfragment); | |
MyHTMapAdapter adapter = new MyHTMapAdapter(this); | |
// Set your implementation of HTMapAdapter |
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
if (uri != null) { | |
try { | |
// Check if Scheme & Path for this link matches the one specified in Dashboard settings | |
if (!TextUtils.isEmpty(uri.getScheme()) | |
&& uri.getScheme().equalsIgnoreCase("<scheme_specified_in_dashboard_settings>") | |
&& !TextUtils.isEmpty(uri.getPath()) | |
&& uri.getPath().equalsIgnoreCase("<path_specified_in_dashboard_settings>")) { | |
Set<String> queryParamNames = uri.getQueryParameterNames(); | |
if (queryParamNames == null || queryParamNames.isEmpty()) { |
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
if (uri != null) { | |
try { | |
// Check if Scheme & Path for this link matches the one specified in Dashboard settings | |
if (!TextUtils.isEmpty(uri.getScheme()) | |
&& uri.getScheme().equalsIgnoreCase("<scheme_specified_in_dashboard_settings>") | |
&& !TextUtils.isEmpty(uri.getPath()) | |
&& uri.getPath().equalsIgnoreCase("<path_specified_in_dashboard_settings>")) { | |
Set<String> queryParamNames = uri.getQueryParameterNames(); | |
if (queryParamNames == null || queryParamNames.isEmpty()) { |
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
``` java | |
dependencies { | |
... | |
compile 'io.hypertrack:smart-scheduler:0.0.3' | |
... | |
} | |
``` |
dependencies {
...
compile 'io.hypertrack:smart-scheduler:0.0.3'
...
}
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
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
... | |
// Check if location settings have been enabled by the user | |
checkForLocationSettings(); | |
} |
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
HyperTrack.setGnssStatusCallback(new GnssStatus.Callback() { | |
@Override | |
public void onStarted() { | |
super.onStarted(); | |
// Handle onStarted method here | |
... | |
} | |
@Override | |
public void onStopped() { | |
super.onStopped(); |
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
/** | |
* For Build.VERSION.SDK_INT < 18 i.e. JELLY_BEAN_MR2 | |
* Check if MockLocation setting is enabled or not | |
* | |
* @param context Pass Context object as parameter | |
* @return Returns a boolean indicating if MockLocation is enabled | |
*/ | |
public static Boolean isMockLocationEnabled(Context context) { | |
return !Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ALLOW_MOCK_LOCATION).equals("0"); | |
} |
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
/** | |
* Method to animate marker to destination location | |
* @param destination destination location (must contain bearing attribute, to ensure | |
* marker rotation will work correctly) | |
* @param marker marker to be animated | |
*/ | |
public static void animateMarker(Location destination, Marker marker) { | |
if (marker != null) { | |
LatLng startPosition = marker.getPosition(); | |
LatLng endPosition = new LatLng(destination.getLatitude(), destination.getLongitude()); |
OlderNewer