nes-num-old"> 1223
1224
1225 1141
                final String sql = "SELECT id,status,poi_jing,poi_wei,total_num,fast_num,slow_num,belong_attribute,suit_car,charge_cost_way,city,own_pay FROM zhan_list WHERE " + conditionSql + " AND " + RangConditionStr;
1226
1227
//                new Thread(new Runnable() {
1228
//                    @Override
1229
//                    public void run() {
1230 1142
                getZhanListData(sql);
1231
//                    }
1232
//                }).start();
1233
1234 1143
                count = 0;
1235 1144
                RangConditionStr = "";
1236 1145
            }
@ -1249,9 +1158,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1249 1158
                }
1250 1159
            }).start();
1251 1160
        }
1252
1253
//        initOver(list_zhan);
1254
1255 1161
    }
1256 1162
1257 1163
    private void getZhanData() {
@ -1369,12 +1275,9 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1369 1275
                continue;
1370 1276
            }
1371 1277
            Double zhan_jing = Double.parseDouble(zhanDataList.get(i).getPoi_jing());
1372
//            Log.e(TAG, "getZhanPoint: zhan_jing="+zhan_jing );
1373 1278
            Double zhan_wei = Double.parseDouble(zhanDataList.get(i).getPoi_wei());
1374
//            Log.e(TAG, "getZhanPoint: zhan_wei="+zhan_wei );
1375 1279
            for (int j = 0; j < rectList.size(); j++) {
1376 1280
                Double mMinLat = rectList.get(j).getMinLat();
1377
//                Log.e(TAG, "getZhanPoint: mMinLat="+mMinLat );
1378 1281
                Double mMinLon = rectList.get(j).getMinLon();
1379 1282
                Double mMaxLat = rectList.get(j).getMaxLat();
1380 1283
                Double mMaxLon = rectList.get(j).getMaxLon();
@ -1413,32 +1316,19 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1413 1316
        try {
1414 1317
            SQLiteDatabase db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);
1415 1318
1416
//            Log.e("sql===",sql);
1417 1319
            Cursor cursor = db.rawQuery(sql, null);
1418 1320
            Zhan zhan;
1419 1321
            while (cursor.moveToNext()) {
1420 1322
                zhan = new Zhan();
1421 1323
1422 1324
                zhan.setPoi_jing(cursor.getString(cursor.getColumnIndex("poi_jing")));
1423
//                Log.e(k+"==",cursor.getString(cursor.getColumnIndex("poi_jing")));
1424 1325
                zhan.setPoi_wei(cursor.getString(cursor.getColumnIndex("poi_wei")));
1425
//                Log.e(k+"==",cursor.getString(cursor.getColumnIndex("poi_wei")));
1426 1326
                zhan.setZhan_id(cursor.getString(cursor.getColumnIndex("id")));
1427 1327
                zhan.setStatus(cursor.getString(cursor.getColumnIndex("status")));
1428 1328
                zhan.setSuit_car(cursor.getString(cursor.getColumnIndex("suit_car")));
1429 1329
                zhan.setOwn_pay(cursor.getString(cursor.getColumnIndex("own_pay")));
1430 1330
                list_zhan.add(zhan);
1431 1331
            }
1432
//            Log.e("size===",list_db.size()+"");
1433
//            Log.e("list===", list.size() + "");
1434
1435
//            new Thread(new Runnable() {
1436
//                @Override
1437
//                public void run() {
1438
//                    initOver(list);
1439
//                }
1440
//            }).start();
1441
1442 1332
            cursor.close();
1443 1333
            db.close();
1444 1334
        } catch (Exception e) {
@ -1529,7 +1419,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1529 1419
                    p3 = my[2];
1530 1420
                }
1531 1421
1532
                Log.e("ssss", p1 + "---" + p2 + "---" + p3);
1533 1422
                for (int i = 0; i < list.size(); i++) {
1534 1423
                    if (!list.get(i).getPoi_wei().equals("") && !list.get(i).getPoi_jing().equals("")
1535 1424
                            && !String.valueOf(list.get(i).getId()).equals(p1) && !String.valueOf(list.get(i).getId()).equals(p2) && !String.valueOf(list.get(i).getId()).equals(p3)) {
@ -1540,9 +1429,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1540 1429
                            ll = new LatLng(Double.parseDouble(list.get(i).getPoi_wei()), Double.parseDouble(list.get(i).getPoi_jing()));
1541 1430
                        } else if (position <= 13) {
1542 1431
                            double dwei = Double.parseDouble(list.get(i).getPoi_wei());
1543
//                System.out.print("wei:"+l.get(i).getPoi_wei());
1544 1432
                            double djing = Double.parseDouble(list.get(i).getPoi_jing());
1545
//                System.out.println("jing:"+l.get(i).getPoi_jing());
1546 1433
                            getGaode(djing, dwei);
1547 1434
1548 1435
                            ll = new LatLng(Double.parseDouble(gd_wei), Double.parseDouble(gd_jing));
@ -1680,21 +1567,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1680 1567
1681 1568
    }
1682 1569
1683
//    @Override
1684
//    public void onArriveDestination(NaviStaticInfo naviStaticInfo) {
1685
//
1686
//    }
1687
//
1688
//    @Override
1689
//    public void onArriveDestination(AMapNaviStaticInfo aMapNaviStaticInfo) {
1690
//
1691
//    }
1692
//
1693
//    @Override
1694
//    public void onCalculateRouteSuccess() {
1695
//
1696
//    }
1697
1698 1570
    @Override
1699 1571
    public void onCalculateRouteFailure(int errorInfo) {
1700 1572
@ -1795,12 +1667,10 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1795 1667
1796 1668
    public void chooseStart(View view) {
1797 1669
        Toast.makeText(this, "请在地图上点选起点", Toast.LENGTH_SHORT).show();
1798
        mapClickStartReady = true;
1799 1670
    }
1800 1671
1801 1672
    public void chooseEnd(View view) {
1802 1673
        Toast.makeText(this, "请在地图上点选终点", Toast.LENGTH_SHORT).show();
1803
        mapClickEndReady = true;
1804 1674
    }
1805 1675
1806 1676
    public void goToGPSActivity(View view) {
@ -1816,7 +1686,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1816 1686
1817 1687
    @Override
1818 1688
    public void activate(OnLocationChangedListener onLocationChangedListener) {
1819
//        Toast.makeText(getApplicationContext(), "activate", Toast.LENGTH_SHORT).show();
1820 1689
        mListener = onLocationChangedListener;
1821 1690
        if (mlocationClient == null) {
1822 1691
            mlocationClient = new AMapLocationClient(this);
@ -1826,7 +1695,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1826 1695
            //设置为高精度定位模式
1827 1696
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
1828 1697
            mLocationOption.setGpsFirst(true);
1829
//            mLocationOption.setOnceLocation(true);
1830 1698
            mLocationOption.setInterval(1500);
1831 1699
1832 1700
            //设置是否强制刷新WIFI,默认为强制刷新
@ -1866,32 +1734,14 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1866 1734
                } catch (NullPointerException e) {
1867 1735
                    e.printStackTrace();
1868 1736
                }
1869
//                ProfileManager.getInstance().setAtCity(getApplicationContext(), MainApplication.atCity);
1870 1737
                center = new LatLng(amapLocation.getLatitude(), amapLocation.getLongitude());
1871
//                Toast.makeText(getApplicationContext(), "!!!" + amapLocation.getLongitude() + "---" + amapLocation.getLatitude(), Toast.LENGTH_SHORT).show();
1872 1738
                mlocationClient.stopLocation();
1873 1739
                dialog.cancel();
1874 1740
1875 1741
                initDatas();
1876
//                Log.e("!@#$",amapLocation.getLatitude()+"```"+amapLocation.getLongitude());
1877
////                Toast.makeText(this, amapLocation.getAddress(), Toast.LENGTH_SHORT).show();
1878
////                Toast.makeText(this, amapLocation.getCity(), Toast.LENGTH_SHORT).show();
1879
//                ete("{\"fun\":\"timer\"}");
1880
//                if (isFirstLoc) {
1881
//                    //设置缩放级别
1882
//                    aMap.moveCamera(CameraUpdateFactory.zoomTo(14));
1883
//                    //将地图移动到定位点
1884
//                    aMap.moveCamera(CameraUpdateFactory.changeLatLng(center));
1885
//
1886
//                    //点击定位按钮 能够将地图的中心移动到定位点
1887
//                    mListener.onLocationChanged(amapLocation);
1888
//                    isFirstLoc = false;
1889
//                }
1890
//                initDatas();
1891 1742
            } else {
1892 1743
                String errText = "定位失败," + amapLocation.getErrorCode() + ": " + amapLocation.getErrorInfo();
1893 1744
                Log.e("AmapErr", errText);
1894
//                mLocationErrText.setVisibility(View.VISIBLE);
1895 1745
                Toast.makeText(this, errText, Toast.LENGTH_SHORT).show();
1896 1746
            }
1897 1747
        }
@ -1902,10 +1752,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1902 1752
        amap.setMyLocationEnabled(true);// 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
1903 1753
        // 设置定位的类型为定位模式 ,可以由定位、跟随或地图根据面向方向旋转几种
1904 1754
        amap.setMyLocationType(AMap.LOCATION_TYPE_LOCATE);
1905
//        aMap.moveCamera();
1906
//        amap.moveCamera(CameraUpdateFactory.zoomTo(14));
1907
1908
        Log.d("??", "!");
1909 1755
    }
1910 1756
1911 1757
    @Override
@ -2003,7 +1849,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2003 1849
                                for (int i = 0; i < changedScreenList.length; i++) {
2004 1850
                                    if (changedScreenList[i]) {
2005 1851
                                        String t = "";
2006
                                        if (i==0){
1852
                                        if (i == 0) {
2007 1853
                                            t = "红包站点";
2008 1854
                                        } else if (i == 1) {
2009 1855
                                            t = "免费停车";
@ -2029,12 +1875,8 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2029 1875
            case R.id.rl_route_tip:
2030 1876
                ivListStatus.setImageResource(R.drawable.icon_route_list_open);
2031 1877
                tvOpen.setText("显示地图");
2032
//                Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_route);
2033
//                animation1.setDuration(2000);
2034 1878
                lvRouteInfo.setVisibility(View.VISIBLE);
2035 1879
                AnimatorStart();
2036
2037
//                llOpenView.startAnimation(animation1);
2038 1880
                break;
2039 1881
            case R.id.ll_open:
2040 1882
                if (canRoute == false) {
@ -2044,8 +1886,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2044 1886
                        showListData(routeOverlays, routeNum);
2045 1887
                        ivListStatus.setImageResource(R.drawable.icon_route_list_open);
2046 1888
                        tvOpen.setText("显示地图");
2047
//                Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_route);
2048
//                animation1.setDuration(2000);
2049 1889
                        lvRouteInfo.setVisibility(View.VISIBLE);
2050 1890
                        AnimatorStart();
2051 1891
@ -2075,7 +1915,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2075 1915
                dialog.show();
2076 1916
                new Handler().postDelayed(new Runnable() {
2077 1917
                    public void run() {
2078
//                        showSimpleBottomSheetGrid();
2079 1918
                        mapScreenShot();
2080 1919
                    }
2081 1920
                }, 1000);
@ -2123,12 +1962,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2123 1962
2124 1963
                    //必须告诉AMapNavi 你最后选择的哪条路
2125 1964
                    aMapNavi.selectRouteId(routeIds[0]);
2126
//                Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
2127
//                Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
2128 1965
                    final List<NaviLatLng> nl = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
2129
//                Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy(), Toast.LENGTH_SHORT).show();
2130
2131
2132 1966
                    routeIndex++;
2133 1967
2134 1968
                    chooseRouteSuccess = true;
@ -2250,13 +2084,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2250 2084
2251 2085
                    //必须告诉AMapNavi 你最后选择的哪条路
2252 2086
                    aMapNavi.selectRouteId(routeIds[2]);
2253
//                Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
2254
//                Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[2]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
2255 2087
                    final List<NaviLatLng> nlll = (aMapNavi.getNaviPaths()).get(routeIds[2]).getCoordList();
2256
2257
//                Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[2]).getStrategy(), Toast.LENGTH_SHORT).show();
2258
2259
2260 2088
                    routeIndex++;
2261 2089
2262 2090
                    chooseRouteSuccess = true;
@ -2286,7 +2114,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2286 2114
                        MobclickAgent.onEvent(getApplicationContext(), "0308");
2287 2115
                        if ("0".equals(save_id)) {
2288 2116
                            if (noNameCount == haveNameCount)
2289
//                                LogUtils.e(noNameCount+"---"+haveNameCount);
2290 2117
                                creatSaveData();
2291 2118
                        } else {
2292 2119
                            AlertDialog.Builder builder = new AlertDialog.Builder(RoutePlanMapActivity.this);
@ -2297,7 +2124,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2297 2124
                                @Override
2298 2125
                                public void onClick(DialogInterface dialog, int which) {
2299 2126
                                    if (noNameCount == haveNameCount)
2300
//                                        LogUtils.e(noNameCount+"---"+haveNameCount);
2301 2127
                                        creatSaveData();
2302 2128
                                }
2303 2129
                            });
@ -2317,7 +2143,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2317 2143
                } else {
2318 2144
                    if (select == 0) {
2319 2145
                        exchangeView(1);
2320
//                        amap.clear();
2321 2146
                        for (int i = 0; i < routeIds.length; i++) {
2322 2147
                            AMapNaviPath path = (aMapNavi.getNaviPaths()).get(routeIds[i]);
2323 2148
                            //你可以通过这个AMapNaviPath生成一个RouteOverLay用于加在地图上
@ -2344,22 +2169,12 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2344 2169
2345 2170
                        }
2346 2171
                        routeOverlays.get(routeIds[0]).setTransparency(0.8f);
2347
2348
2349 2172
                        //必须告诉AMapNavi 你最后选择的哪条路
2350 2173
                        aMapNavi.selectRouteId(routeIds[0]);
2351
//                Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
2352
//                Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
2353 2174
                        List<NaviLatLng> nnll = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
2354
//                Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy(), Toast.LENGTH_SHORT).show();
2355
2356
2357 2175
                        routeIndex++;
2358 2176
2359 2177
                        chooseRouteSuccess = true;
2360
//                        if (nnll != null) {
2361
//                            getRouteZhan(nnll);
2362
//                        }
2363 2178
                    }
2364 2179
                    if (chooseRouteSuccess && calculateSuccess) {
2365 2180
                        MobclickAgent.onEvent(getApplicationContext(), "0309");
@ -2392,12 +2207,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2392 2207
2393 2208
                break;
2394 2209
            case R.id.iv_back:
2395
//                tag = 0;
2396 2210
                finish();
2397
//                amap.setLocationSource(this);// 设置定位监听
2398
//            amap.setMyLocationEnabled(true);// 是否可触发定位并显示定位层
2399
////            ?aMap.moveCamera(CameraUpdateFactory.zoomTo(14));
2400
//            mlocationClient.startLocation();
2401 2211
                break;
2402 2212
            default:
2403 2213
                break;
@ -2594,7 +2404,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2594 2404
                        }
2595 2405
                        if (strategyFlag >= 0) {
2596 2406
                            aMapNavi.calculateDriveRoute(startList, endList, zhongList, strategyFlag);
2597
//                                                Toast.makeText(getApplicationContext(), "策略:" + strategyFlag, Toast.LENGTH_LONG).show();
2598 2407
                        }
2599 2408
                        rl_infowindow.setVisibility(View.GONE);
2600 2409
                    } else {
@ -2726,34 +2535,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2726 2535
2727 2536
    }
2728 2537
2729
    private void getBaidu(Double jing, Double wei) {
2730
        double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
2731
        double x = jing;
2732
        double y = wei;
2733
        double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
2734
        double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
2735
        bd_lon = z * Math.cos(theta) + 0.0065;
2736
        bd_lat = z * Math.sin(theta) + 0.006;
2737
    }
2738
2739
    private boolean isAvilible(Context context, String packageName) {
2740
        //获取packagemanager
2741
        final PackageManager packageManager = context.getPackageManager();
2742
        //获取所有已安装程序的包信息
2743
        List<PackageInfo> packageInfos = packageManager.getInstalledPackages(0);
2744
        //用于存储所有已安装程序的包名
2745
        List<String> packageNames = new ArrayList<String>();
2746
        //从pinfo中将包名字逐一取出,压入pName list中
2747
        if (packageInfos != null) {
2748
            for (int i = 0; i < packageInfos.size(); i++) {
2749
                String packName = packageInfos.get(i).packageName;
2750
                packageNames.add(packName);
2751
            }
2752
        }
2753
        //判断packageNames中是否有目标程序的包名,有TRUE,没有FALSE
2754
        return packageNames.contains(packageName);
2755
    }
2756
2757 2538
    public static Bitmap getBitmapFromView(View view) {
2758 2539
        view.destroyDrawingCache();
2759 2540
        view.measure(View.MeasureSpec.makeMeasureSpec(0,

cdzApp - Gogs: Go Git Service

充电桩app代码

huyuguo b98aa2e34f 代码修改 преди 6 години
..
src b98aa2e34f 代码修改 преди 6 години
.gitignore e1cf244fe0 remove Useless dependence преди 7 години
build.gradle b98aa2e34f 代码修改 преди 6 години
proguard-rules.pro e1cf244fe0 remove Useless dependence преди 7 години