久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='0I3rl'></tfoot>

    <bdo id='0I3rl'></bdo><ul id='0I3rl'></ul>
  • <legend id='0I3rl'><style id='0I3rl'><dir id='0I3rl'><q id='0I3rl'></q></dir></style></legend>

    <small id='0I3rl'></small><noframes id='0I3rl'>

    1. <i id='0I3rl'><tr id='0I3rl'><dt id='0I3rl'><q id='0I3rl'><span id='0I3rl'><b id='0I3rl'><form id='0I3rl'><ins id='0I3rl'></ins><ul id='0I3rl'></ul><sub id='0I3rl'></sub></form><legend id='0I3rl'></legend><bdo id='0I3rl'><pre id='0I3rl'><center id='0I3rl'></center></pre></bdo></b><th id='0I3rl'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0I3rl'><tfoot id='0I3rl'></tfoot><dl id='0I3rl'><fieldset id='0I3rl'></fieldset></dl></div>

        如何使用 kivy、pyjnius 為 android 制作 GPS 應(yīng)用程序

        How to make GPS-app for android using kivy, pyjnius?(如何使用 kivy、pyjnius 為 android 制作 GPS 應(yīng)用程序?)
        <tfoot id='OLyzU'></tfoot>

          <legend id='OLyzU'><style id='OLyzU'><dir id='OLyzU'><q id='OLyzU'></q></dir></style></legend>
              <tbody id='OLyzU'></tbody>
              • <bdo id='OLyzU'></bdo><ul id='OLyzU'></ul>

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

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

                  本文介紹了如何使用 kivy、pyjnius 為 android 制作 GPS 應(yīng)用程序?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我是 KIVY、pyjnius 和 python-android 的新手.我需要為 android 制作簡(jiǎn)單的應(yīng)用程序,它顯示 GPS 坐標(biāo).但是,正如我所說(shuō),我是 kivy 和 pyforandroid 的新手.有人可以顯示/給我示例,它在簡(jiǎn)單的 kivy-label-widget 中顯示我的坐標(biāo)嗎?非常感謝!

                  Im new in KIVY, pyjnius and python-android. I need to make simple app for android, which shows GPS coordinates. But, as i said, i'm new in kivy and pyforandroid. Can somebody show/give me example,which shows my coordinates in simple kivy-label-widget? Thanks a lot!

                  我試過(guò)做這樣的事情,但是......

                  I ve tried to do something like this but...

                      package org.renpy.android;
                  
                  //import java.util.ArrayList;
                  //import java.util.List;
                  
                  import android.location.Location;
                  import android.location.LocationListener;
                  import android.location.LocationManager;
                  import android.content.Context;
                  import android.os.Bundle;
                  import android.os.Looper;
                  import java.lang.Thread;
                  import android.app.Activity;
                  
                  public class KivyGps {
                      LocationManager lm;
                      Thread gpsThread;
                      public long minDistance = 1;
                      public int  minTime = 1000;
                  
                  
                     static class KivyLocationListener implements LocationListener {
                  
                      public Location lastLocation = new Location("Other");
                      //private List<LocationListener> listeners = new ArrayList<LocationListener>();
                  
                      public void onLocationChanged(Location location) {
                          // TODO Auto-generated method stub
                          lastLocation = location;
                          //updateListeners(location);
                      }
                  
                      public void onProviderDisabled(String provider) {
                          // TODO Auto-generated method stub
                      }
                  
                      public void onProviderEnabled(String provider) {
                          // TODO Auto-generated method stub
                      }
                  
                      public void onStatusChanged(String provider, int status, Bundle extras) {
                          // TODO Auto-generated method stub
                      }
                  
                          // TODO Auto-generated method stub
                          return lastLocation;
                      }
                  
                      }
                  
                      static public KivyLocationListener locationListener = new KivyLocationListener();
                      public Thread init(final Activity currActivity) {
                  
                          gpsThread = new Thread( new Runnable() {
                  
                            public void run() {
                              try {
                                  Looper.prepare();
                                   lm = (LocationManager) currActivity.getSystemService( Context.LOCATION_SERVICE );
                                   lm.requestLocationUpdates( LocationManager.GPS_PROVIDER, minTime, minDistance, locationListener );
                                   Looper.loop();
                  
                                  }
                              catch ( Exception e ) {
                                  e.printStackTrace();
                              }
                            }
                  
                          } );
                          return gpsThread;    
                      }
                      //gpsThread.start();
                  
                  }
                  

                  在python中

                  from jnius import autoclass
                  
                  LocationListener = autoclass('android.location.LocationListener')
                  LocationManager = autoclass('android.location.LocationManager')
                  LocationProvider = autoclass('android.location.LocationProvider')
                  Location = autoclass('android.location.Location')
                  Looper = autoclass('android.os.Looper')
                  Context = autoclass('android.content.Context')
                  KivyGps = autoclass('org.renpy.android.KivyGps')
                  
                  currentActivity = cast('android.app.Activity', PythonActivity.mActivity)
                  lm = currentActivity.getSystemService( Context.LOCATION_SERVICE)
                  if lm.isProviderEnabled( LocationManager.GPS_PROVIDER ):
                      print 'CON GPS'
                  
                  else:
                      print 'SIN GPS'
                  
                  
                  lps = lm.getAllProviders()
                  for lp in lps.toArray():
                      print lp
                  #Arreglar problema de derechos ACCESS_FINE_LOCATION en Kivy Launcher
                  lp = lm.getProvider('gps')
                  
                  ll = KivyGps.locationListener
                  kgps = KivyGps()
                  gpsThread = kgps.init( currentActivity )
                  gpsThread.start()
                  
                  loc = ll.getCurrentLocation()
                  if loc:
                      print loc.getLatitude()
                      print loc.getLongitude()
                  

                  推薦答案

                  我前段時(shí)間做了一個(gè)在 Kivy/pyjnius 中訪問(wèn) GPS 的演示:

                  I did while ago a demo of accessing GPS within Kivy/pyjnius:

                  https://github.com/tito/android-demo

                  看源碼,什么都在里面.

                  Look at the source code, everything is in it.

                  這篇關(guān)于如何使用 kivy、pyjnius 為 android 制作 GPS 應(yīng)用程序?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶(hù)的當(dāng)前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測(cè)位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                  Get current location during app launch(在應(yīng)用啟動(dòng)期間獲取當(dāng)前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

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

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

                    <legend id='lSlS5'><style id='lSlS5'><dir id='lSlS5'><q id='lSlS5'></q></dir></style></legend>

                          <tbody id='lSlS5'></tbody>
                          • <bdo id='lSlS5'></bdo><ul id='lSlS5'></ul>

                          • 主站蜘蛛池模板: 在线中文字幕亚洲 | 亚洲精品久久久久avwww潮水 | 国产精品精品 | 亚洲国产自产 | 男女网站在线观看 | 成人av片在线观看 | 日韩精品一区二区三区中文在线 | 国产精品国产三级国产aⅴ无密码 | 成人免费视频在线观看 | 亚洲精品自在在线观看 | 色综合久久伊人 | 综合久久av | 亚洲日韩中文字幕一区 | 久久一日本道色综合久久 | 欧美日韩亚洲国产综合 | 欧美国产日韩一区 | 亚洲视频在线观看一区二区三区 | 欧美精品a∨在线观看不卡 欧美日韩中文字幕在线播放 | 草草草影院 | 欧美精品第一页 | 男人的天堂久久 | 91日韩 | 久久久久午夜 | 日韩一级免费电影 | 中文字幕一区在线观看视频 | 人人澡视频 | 狠狠操在线 | 永久免费在线观看 | 亚洲精品久久 | 久久成 | 奇米久久久 | wwwxxx日本在线观看 | 在线视频成人 | 欧美视频在线播放 | 国产一区二区在线视频 | 日本天天操 | 久久这里只有精品首页 | 99日韩| 中文字幕精品视频在线观看 | 亚洲一区二区视频在线播放 | 欧美日韩国产在线观看 |