This file contains hidden or 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
• FusedLocationProviderClient - get location update continuously. | |
implementation 'com.google.android.gms:play-services-location:17.0.0' | |
implementation 'com.google.android.gms:play-services-maps:17.0.0' | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
• MainActivity | |
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { |
This file contains hidden or 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
/** | |
* This would be the activity which registers the receiver class via it's interface | |
*/ | |
public class MainActivity implements NetworkStateReceiver.NetworkStateReceiverListener { | |
private NetworkStateReceiver networkStateReceiver; // Receiver that detects network state changes | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
/***/ |
This file contains hidden or 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
function drawSector(lat, lng, r, azimuth, width) { | |
var centerPoint = new google.maps.LatLng(lat, lng); | |
var PRlat = (r/3963) * (180 / Math.PI); // using 3963 miles as earth's radius | |
var PRlng = PRlat/Math.cos(lat*((Math.PI / 180))); | |
var PGpoints = []; | |
PGpoints.push(centerPoint); | |
with (Math) { | |
lat1 = lat + (PRlat * cos( ((Math.PI / 180)) * (azimuth - width/2 ))); | |
lon1 = lng + (PRlng * sin( ((Math.PI / 180)) * (azimuth - width/2 ))); |
This file contains hidden or 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
import android.content.Intent; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.ArrayAdapter; | |
import android.widget.Button; | |
import android.widget.ListView; | |
public class TransitionThemeActivity extends AppCompatActivity implements View.OnClickListener { |