如何使用类发送经度和纬度扩展了广播接收器

时间:2015-03-18 02:52:10

标签: android android-broadcast

好吧,我正在开发一个应用程序,如果我得到任何消息的单词(位置),它将通过类扩展广播接收器发回经度纬度。谁能请帮忙 提前致谢

    locationmanager = (LocationManager)     getSystemService(Context.LOCATION_SERVICE);
    Criteria criteria = new Criteria();
    String provider = locationmanager.getBestProvider(criteria, true);

    mylocation = locationmanager.getLastKnownLocation(provider);
    longitude = mylocation.getLongitude();
    latitude = mylocation.getLatitude();

发送部分

if(msgBody.equals("Location")){

          try {
                 SmsManager smsManager = SmsManager.getDefault();
                  smsManager.sendDataMessage(destinationAddress, scAddress, destinationPort, data, sentIntent, deliveryIntent)

              } catch (Exception e) {

                 e.printStackTrace();
              }

如何处理smsManager.sendDataMessage()?

0 个答案:

没有答案