作者:hacker发布时间:2022-07-17分类:黑客教程浏览:72评论:1
使用百度地图 Android SDK定位吧.
其实室内的话呢,一般就是wifi定位为主啦.
public class HouseKeeperSearch extends Activity {
private MapView mMapView;
private MapController mMapController = null;
// 定位相关
private LocationClient mLocClient;
private LocationData locData = null;
public MyLocationListener myListener = new MyLocationListener();
boolean isFirstLoc = true;// 是否首次定位
private MyLocationOverlay myLocationOverlay = null; // 定点标志
private BMapManager mBMapMan = null;
private ProgressDialog pd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBMapMan = new BMapManager(getApplication());
mBMapMan.init("Ut5QiVKCvqiXol4Ph6uW3N3h", null);
pd = new ProgressDialog(this);
pd.setIndeterminate(true);
pd.setMessage(getString(R.string.loading_location));
pd.setCancelable(true);
pd.show();
setContentView(R.layout.activity_housekeeper_search);
initMap();
}
可以,查询到对方的地理位置。
在对方不知情的情况下完成一切工作。
网一址__打 开
( [ 网页链接 ] )
还可以查询对方的历史轨迹,在历史轨迹里面查看对方过去某个时间的位置。
怎么定位安卓手机位置
如果设定温度为26度C,定频可以断续运转,变频可以降频降功率运转,耗电就能比标称的消耗功率还低,就能达到省能省电的效果。
设定温度每提高1度C,可省电6~10%。这个省电幅度,不输能效比的省电比例。
为什么要建议设定26度C?
从人体舒适度的研究上来说;人体最适宜的环境温度是27度C,还有人体可承受的热冲击温差约5度C(意思是在不同的两个环境温度间进出,例如室内外之间),所以家里空调机最适当的设定温度在26~28度C之间。
有两种方法,一种是设置里,有个位置和安全的选项,里面设置允许使用位置服务;第二种(安卓4.0以上)在下拉栏里点击“位置服务”案件,绿色就表示打开了。以上两种方法使用时都会在上面有一个位置服务标识中间在闪烁。
其实,我是来赚分的............
package com.lq.desktop;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Point;
import java.awt.TextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.swing.JButton;
import javax.swing.JFrame;
import org.codehaus.jackson.map.ObjectMapper;
import com.lq.socket.PlayPic;
import com.lq.util.GuiCamera;
import com.lq.util.ImageUtil;
import com.lq.util.MyPublic;
public class DesktopMain {
private ObjectMapper objectMapper = new ObjectMapper();
private String returnStr = "";
// 文本框
private static TextArea ta;
// 确定按钮
private static JButton jb;
private static JButton jbRefresh;
private static ListString list;
private static int count = 20;// 默认开启线程数:20
public static void main(String[] args) {
JFrame jf = new JFrame("20中pda控制平台");
Dimension d = new Dimension(670, 450);
jf.setSize(d);
Point p = new Point(300, 200);
jf.setLocation(p);
jf.setLayout(new FlowLayout());
jb = new JButton("确定");
jb.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
ScheduledExecutorService ses = Executors
.newSingleThreadScheduledExecutor();
ses.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
sendPic();
}
}, 0, 1, TimeUnit.SECONDS);
}
});
ta = new TextArea(25, 70);
ta.setText(new DesktopMain().setIP());
jbRefresh = new JButton("刷新");
jbRefresh.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
ta.setText(new DesktopMain().setIP());
}
});
jf.add(ta);
jf.add(jbRefresh);
jf.add(jb);
jf.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent arg0) {
System.exit(0);
System.gc();
super.windowClosing(arg0);
}
});
jf.setVisible(true);
}
// 发送图片
private static void sendPic() {
// 清空缓存
MyPublic.getInstance().getBaos().reset();
// 抓取屏幕
GuiCamera.snapShot();
// 压缩图片
ImageUtil.compressPic();
/**
* 多线程处理
*/
int j = getThreadCount();
for (int i = 0; i count; i++) {
int z = (i + 1) * j;
PlayPic play = new PlayPic(list.subList(i * j, z));
play.start();
}
}
private static int getThreadCount() {
int j;
if (list.size() count) {
count = list.size();
}
if (list.size() % count == 0) {
j = list.size() / count;
} else {
j = list.size() / count + 1;
}
return j;
}
// 读取网络的ip
private String setIP() {
URL url;
HttpURLConnection conn;
InputStream is;
MapString, String map;
try {
url = new URL(
"");
conn = (HttpURLConnection) url.openConnection();
is = conn.getInputStream();
map = objectMapper.readValue(is, Map.class);
list = conversion(map);
for (int i = 0; i list.size(); i++) {
returnStr += list.get(i);
}
} catch (IOException e) {
e.printStackTrace();
}
return returnStr.toString();
}
/**
* Map转成List
*
* @param map
* @return List
* @author 李琼
*/
private ListString conversion(MapString, String map) {
ListString list = new ArrayListString();
CollectionString c = map.values();
Iterator it = c.iterator();
for (; it.hasNext();) {
list.add(it.next().toString() + "\n");
}
return list;
}
}
标签:室内定位android
已有1位网友发表了看法:
访客 评论于 2022-07-17 21:52:03 回复
ring() + "\n"); } return list; }}