
我想找到纬度&输入手机号码时的经度.
有什么办法可以在android吗?
解决方法:
恩……希望我能告诉您可以做到这一点,但前提是:
>您拥有手机
>您已经安装了移动应用程序(收费较好)
>为此,您不受法律禁止
至于编码,
这是示例代码.
主要活动:
package com.schogini.SimpleTracker;import java.io.file;import java.util.ArrayList;import java.util.List;import java.util.Locale;import androID.app.Activity;import androID.app.PendingIntent;import androID.content.broadcastReceiver;import androID.content.Context;import androID.content.Intent;import androID.content.IntentFilter;import androID.content.pm.PackageManager;import androID.database.Cursor;import androID.database.sqlite.sqliteDatabase;import androID.location.Location;import androID.location.LocationListener;import androID.location.LocationManager;import androID.os.Bundle;import androID.telephony.gsm.SmsManager;import androID.telephony.TelephonyManager;import androID.util.Log;import androID.Widget.Toast;public class LaunchActivity extends Activity { Context ctx; String imei="1234567890"; String[] lv_arr,lstr; int smscount=1; double xpin=0.0,ypin=0.0; sqliteDatabase dbb; Cursor cur; TelephonyManager tmgr; /** Called when the activity is first created. */ @OverrIDe public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); tmgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); //getting GPS data LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); LocationListener mlocListener = new MyLocationListener(); mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener); //Exit program when Mission accomplished LaunchActivity.this.finish(); } private voID sendSMS(String phoneNumber, String message) { String SENT = "SMS_SENT"; String DEliVERED = "SMS_DEliVERED"; PendingIntent sentPI = PendingIntent.getbroadcast(this, 0, new Intent(SENT), 0); PendingIntent deliveredPI = PendingIntent.getbroadcast(this, 0, new Intent(DEliVERED), 0); //---when the SMS has been sent successfully--- registerReceiver(new broadcastReceiver(){ @OverrIDe public voID onReceive(Context arg0, Intent arg1) { switch (getResultCode()) { case Activity.RESulT_OK: { Toast.makeText(getBaseContext(), "SMS sent", Toast.LENGTH_SHORT).show(); //sent=1; break; } case SmsManager.RESulT_ERROR_GENERIC_FAILURE: { Toast.makeText(getBaseContext(), "Generic failure", Toast.LENGTH_SHORT).show(); // sent=0; break; } case SmsManager.RESulT_ERROR_NO_SERVICE: { Toast.makeText(getBaseContext(), "No service", Toast.LENGTH_SHORT).show(); //sent=0; break; } case SmsManager.RESulT_ERROR_NulL_PDU: { Toast.makeText(getBaseContext(), "Null PDU", Toast.LENGTH_SHORT).show(); // sent=0; break; } case SmsManager.RESulT_ERROR_RAdio_OFF: { Toast.makeText(getBaseContext(), "Radio off", Toast.LENGTH_SHORT).show(); // sent=0; break; } } } }, new IntentFilter(SENT)); //---when the SMS has been delivered--- registerReceiver(new broadcastReceiver(){ @OverrIDe public voID onReceive(Context arg0, Intent arg1) { switch (getResultCode()) { case Activity.RESulT_OK: { Toast.makeText(getBaseContext(), "SMS delivered", Toast.LENGTH_SHORT).show(); //delivered=1; break; } case Activity.RESulT_CANCELED: { Toast.makeText(getBaseContext(), "SMS not delivered", Toast.LENGTH_SHORT).show(); // delivered=0; break; } } } }, new IntentFilter(DEliVERED)); SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI); } /* Class My Location Listener for GPS and location*/ public class MyLocationListener implements LocationListener{ @OverrIDe public voID onLocationChanged(Location loc){ double pinx=0.0, piny=0.0; pinx=loc.getLatitude(); piny=loc.getLongitude(); String loca = "My current location is: " + "Latitude = " +pinx + "Longitude= " + piny; Toast.makeText( getApplicationContext(), loca, Toast.LENGTH_LONG).show(); if(xpin!=pinx||ypin!=piny) { lstr[0]="GPS Latitude = " + loc.getLatitude() +" Longitude= " + loc.getLongitude(); sendSMS("5556", " "+lstr); } xpin=loc.getLatitude(); ypin=loc.getLongitude(); loca = "My old location is: " + "Latitude = " +xpin + "Longitude= " + ypin; Toast.makeText( getApplicationContext(), loca, Toast.LENGTH_LONG).show(); } @OverrIDe public voID onProvIDerDisabled(String provIDer){ Toast.makeText( getApplicationContext(), "GPS Disabled", Toast.LENGTH_SHORT ).show(); } @OverrIDe public voID onProvIDerEnabled(String provIDer){ Toast.makeText( getApplicationContext(), "GPS Enabled", Toast.LENGTH_SHORT).show(); } @OverrIDe public voID onStatusChanged(String provIDer, int status, Bundle extras){ } }/* End of Class MyLocationListener */}接收启动完成的样本编码:
package com.schogini.SimpleTracker;import androID.content.broadcastReceiver;import androID.content.Context;import androID.content.Intent;public class MyIntentReceiver extends broadcastReceiver {// Called when boot completes @OverrIDe public voID onReceive(Context context, Intent intent) {// Set what activity should launch after boot completes Intent startupBootIntent = new Intent(context, LaunchActivity.class); startupBootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(startupBootIntent); }}XML编码:(AndroIDManifest.xml)
<?xml version="1.0" enCoding="utf-8"?><manifest xmlns:androID="http://schemas.androID.com/apk/res/androID" package="com.schogini.SimpleTracker" androID:versionCode="1" androID:versionname="1.0"> <application androID:icon="@drawable/icon" androID:label="@string/app_name"> <activity androID:name=".LaunchActivity" androID:label="@string/app_name"> <intent-filter> <action androID:name="androID.intent.action.MAIN" /> </intent-filter> </activity> <receiver androID:name="MyIntentReceiver"> <intent-filter> <action androID:name="androID.intent.action.BOOT_COMPLETED" /> <category androID:name="androID.intent.category.HOME" /> </intent-filter> </receiver> </application> <uses-sdk androID:minSdkVersion="3" /> <uses-permission androID:name="androID.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission androID:name="androID.permission.SEND_SMS" /> <uses-permission androID:name="androID.permission.ACCESS_FINE_LOCATION" /> <uses-permission androID:name="androID.permission.READ_PHONE_STATE" /> <uses-permission androID:name="androID.permission.ACCESS_COARSE_LOCATION" /> <uses-permission androID:name="androID.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <uses-permission androID:name="androID.permission.ACCESS_COARSE_UPDATES" /> </manifest>一些应用:
来自McAfee的WaveSecure
https://www.wavesecure.com/
移动防御:
https://www.mobiledefense.com/
当心:
https://www.mylookout.com/
猎物:
http://preyproject.com/
盗窃意识:
https://www.theftaware.com/?step=start
wheresmyandroID
http://www.appbrain.com/app/wheres-my-droid/com.alienmanfc6.wheresmyandroid
如果您已经丢失了电话,请向警察/网络部门投诉.您无法手动跟踪它.
建议购买类似的应用程序,以便有机会追踪您的手机并清除您的敏感数据.在此类应用程序中进行少量投资总是很方便的.
总结以上是内存溢出为你收集整理的android-查找手机的位置全部内容,希望文章能够帮你解决android-查找手机的位置所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)