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
| UseAge: | |
| 1:create providedJar dir at subProject | |
| 2:use:providAAR 'xxxx' in subproject | |
| Code in root build.gradle: | |
| buildscript { | |
| repositories { | |
| mavenLocal() |
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
| abstarct public class SimpleBackgroundTask<T> extends AsyncTask<Void,Void,T>{ | |
| WeakReference<Activity> weakActivity | |
| public SimpleBackgroundTask(Activity activity){ | |
| weakActivity = new WeakReference<Activity>(activity); | |
| } | |
| @Override | |
| protected final T doInBackground(Void... voids) { |
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
| private static final double EARTH_RADIUS = 6378137; | |
| private static double rad(double d) | |
| { | |
| return d * Math.PI / 180.0; | |
| } | |
| public static double getDistanceofPoint(Location locationA, Location locationB) { | |
| double radLat1 = rad(locationA.getLatitude()); | |
| double radLat2 = rad(locationB.getLatitude()); |