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

      • <bdo id='cKbE7'></bdo><ul id='cKbE7'></ul>

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

      <tfoot id='cKbE7'></tfoot>

        <legend id='cKbE7'><style id='cKbE7'><dir id='cKbE7'><q id='cKbE7'></q></dir></style></legend>
      1. 将网络位置保存为 .txt 文件(不使用 GPS)

        Save network location as a .txt file (Without using GPS)(将网络位置保存为 .txt 文件(不使用 GPS))

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

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

                <legend id='UOmJr'><style id='UOmJr'><dir id='UOmJr'><q id='UOmJr'></q></dir></style></legend>
                  <tbody id='UOmJr'></tbody>

                • <tfoot id='UOmJr'></tfoot>

                • 本文介绍了将网络位置保存为 .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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                    <tfoot id='b8285'></tfoot>

                          <bdo id='b8285'></bdo><ul id='b8285'></ul>
                          • <small id='b8285'></small><noframes id='b8285'>

                              <tbody id='b8285'></tbody>

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