久久久久久久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ì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問題描述

                  我是 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 中訪問 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),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(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>

                          • 主站蜘蛛池模板: 伊人看片 | cao在线| 欧美黄色绿像 | 91av亚洲| 久久精品一区二区 | 午夜理伦三级理论三级在线观看 | 秋霞精品 | 日韩午夜 | 日韩精品一区二区三区视频播放 | 国产一区在线免费观看视频 | 一二区成人影院电影网 | 国产一区在线免费 | 成人免费黄视频 | 一区中文 | 成人免费淫片aa视频免费 | 伊人二区| 午夜羞羞| 特黄特色大片免费视频观看 | 中文字幕在线免费观看 | 凹凸日日摸日日碰夜夜 | 在线观看中文字幕 | 精品精品视频 | 黄色毛片网站在线观看 | 九九热在线视频 | 日韩av一区二区在线观看 | 日本精品久久久久 | 色综合成人网 | 在线播放精品视频 | 国产欧美日韩一区 | 久久久久亚洲国产| 欧美日本高清 | 精品欧美一区免费观看α√ | 欧美黄色片 | 欧美日韩1区2区 | 久久久国| 成人精品久久 | 狠狠爱网址 | 国产精品视频在 | 日韩av在线免费 | 久久精品高清视频 | 亚洲免费精品 |