1. <small id='epI3q'></small><noframes id='epI3q'>

      <tfoot id='epI3q'></tfoot>
      <legend id='epI3q'><style id='epI3q'><dir id='epI3q'><q id='epI3q'></q></dir></style></legend>
      • <bdo id='epI3q'></bdo><ul id='epI3q'></ul>

        <i id='epI3q'><tr id='epI3q'><dt id='epI3q'><q id='epI3q'><span id='epI3q'><b id='epI3q'><form id='epI3q'><ins id='epI3q'></ins><ul id='epI3q'></ul><sub id='epI3q'></sub></form><legend id='epI3q'></legend><bdo id='epI3q'><pre id='epI3q'><center id='epI3q'></center></pre></bdo></b><th id='epI3q'></th></span></q></dt></tr></i><div id='epI3q'><tfoot id='epI3q'></tfoot><dl id='epI3q'><fieldset id='epI3q'></fieldset></dl></div>
      1. 将网络位置保存为 .txt 文件(不使用 GPS)

        时间:2023-09-30

          <small id='fLSXt'></small><noframes id='fLSXt'>

              <tbody id='fLSXt'></tbody>

              <i id='fLSXt'><tr id='fLSXt'><dt id='fLSXt'><q id='fLSXt'><span id='fLSXt'><b id='fLSXt'><form id='fLSXt'><ins id='fLSXt'></ins><ul id='fLSXt'></ul><sub id='fLSXt'></sub></form><legend id='fLSXt'></legend><bdo id='fLSXt'><pre id='fLSXt'><center id='fLSXt'></center></pre></bdo></b><th id='fLSXt'></th></span></q></dt></tr></i><div id='fLSXt'><tfoot id='fLSXt'></tfoot><dl id='fLSXt'><fieldset id='fLSXt'></fieldset></dl></div>
            1. <tfoot id='fLSXt'></tfoot><legend id='fLSXt'><style id='fLSXt'><dir id='fLSXt'><q id='fLSXt'></q></dir></style></legend>

                <bdo id='fLSXt'></bdo><ul id='fLSXt'></ul>
                  本文介绍了将网络位置保存为 .txt 文件(不使用 GPS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我是安卓编程的初学者.我的研究生项目是关于跟踪移动设备的,我需要将位置(不使用 GPS)保存为文本文件的代码.有人建议我这样做的代码.这对我有很大的帮助.

                  I am a beginner in android programming. My Graduate project is about tracking a mobile device and i need the code to save the location( Without using GPS) as a text file. Someone suggest me the codes for doing that. It will be a great help for me.

                  推荐答案

                  试试这个.

                  locationManagerNetwork = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
                      Location location2 = locationManagerNetwork
                                      .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
                  
                       if (location2 != null) {       
                                  String message = String
                                          .format("Yout location : 
                   Longitude: %1$s 
                   Latitude: %2$s",
                                                  location2.getLongitude(), location2.getLatitude());
                                  Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG)
                                          .show();
                  
                  
                      //use here file writer if you want to write the coordinates in a text file
                              }
                  

                  <小时>

                  用于写入 sd 卡


                  for writing sd card

                  File sdcard = Environment.getExternalStorageDirectory();
                          File f = new File(sdcard, "/yourfile");
                  
                  if(!f.exsist()){
                  f.createNewFile();
                  //Use outwriter here, outputstream search how to write into a file in java code 
                  }
                  

                  这篇关于将网络位置保存为 .txt 文件(不使用 GPS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:最后一个已知位置是多久前记录的? 下一篇:如何在Android中获得气压高度?

                  相关文章

                  最新文章

                1. <i id='YIliK'><tr id='YIliK'><dt id='YIliK'><q id='YIliK'><span id='YIliK'><b id='YIliK'><form id='YIliK'><ins id='YIliK'></ins><ul id='YIliK'></ul><sub id='YIliK'></sub></form><legend id='YIliK'></legend><bdo id='YIliK'><pre id='YIliK'><center id='YIliK'></center></pre></bdo></b><th id='YIliK'></th></span></q></dt></tr></i><div id='YIliK'><tfoot id='YIliK'></tfoot><dl id='YIliK'><fieldset id='YIliK'></fieldset></dl></div>
                  • <bdo id='YIliK'></bdo><ul id='YIliK'></ul>

                  <small id='YIliK'></small><noframes id='YIliK'>

                    <tfoot id='YIliK'></tfoot><legend id='YIliK'><style id='YIliK'><dir id='YIliK'><q id='YIliK'></q></dir></style></legend>