Zurück   Flashforum > Flex und AIR > Adobe AIR

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 13-02-2012, 14:18   #1 (permalink)
Kein Meister
 
Benutzerbild von DabelDirk
 
Registriert seit: Feb 2011
Ort: Zuhause. Näheres auf Anfrage.
Beiträge: 33
Question Air und Android. Geolocation Status ändert sich nicht

Hallo zusammen,

ich habe ein Problem mit Air für Android und der Geolocation API.

Hier kurz mein (vereinfachter) Code (Teile des Codes sind von hier):
PHP-Code:
protected function startGpsLocating():void
{
    if(
Geolocation.isSupported)
    {
        
this.log.appendText("GPS is supported\n");
        
this.geoCheckCount 0;
        
this.geo = new Geolocation();
        
this.geo.addEventListener(StatusEvent.STATUSstatus_ChangeHandler);
        if(!
this.geo.muted)
        {
            
this.geo.setRequestedUpdateInterval(500);
            
this.log.appendText("Starting GPS locating\n");
            
this.geo.addEventListener(GeolocationEvent.UPDATEonUpdate);
        }
        else
        {
            
this.log.appendText("GPS is muted on this device\n");
        }
    }
    else
    {
        
this.log.appendText("GPS not supported on this device\n");
    }
}
protected function 
status_ChangeHandler(event:StatusEvent):void
{
    if(
this.geo.muted)
    {
        
this.log.appendText("GPS is now muted on this device\n");
    }
    else
    {
        
this.log.appendText("GPS is now unmuted on this device\n");
        
this.geo.setRequestedUpdateInterval(500);
        if(!
this.geo.hasEventListener(GeolocationEvent.UPDATE))
        {
            
this.geo.addEventListener(GeolocationEvent.UPDATEonUpdate);                            
        }
    }
}
protected function 
onUpdate(event:GeolocationEvent):void
{
    ++
this.geoCheckCount;
    if(
this.geoCheckCount <= 1) return; // Throw away the first location event because it's almost always the last known location, not current location
    
    
this.geoLastEvent event;
    
    if(
event.horizontalAccuracy <= 150)
    {
        
this.log.appendText((this.geoCheckCount-2).toString()+":LOCATION: " event.latitude " / " event.longitude " - " event.horizontalAccuracy "\n");
    }

Das ganze funktioniert soweit, d.h. ich bekomme die Geodaten im Log (TextArea) angezeigt.
Nur das "muted" und der Eventhandler für den Status funktionieren nicht. "muted" ist immer "false", auch wenn ich das GPS deaktiviere (und dann erst die App starte) und auch der Handler für den Statuswechsel wird nie aufgerufen, wenn ich das GPS deaktiviere/aktiviere, wenn die App läuft.
Ich dachte schon das muss am Gerät (Galaxy Pad) liegen oder an der Os Version (Android 2.2), aber die Navigation von Google-Maps merkt das ja auch, wenn das GPS nicht eingeschaltet ist.

Weiß da jemand mehr dazu, oder kennt Informationsquellen wo das stehen könnte?
(Hier in dem Video sieht man auch nur die grundlegende Vorgehensweise)
__________________
Grüße,
Dirk
dabelstein.com

Geändert von DabelDirk (13-02-2012 um 14:19 Uhr) Grund: Typo
DabelDirk ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
LineStyle ändert sich nicht denniz ActionScript 3 1 23-01-2009 19:05
Linienfarbe ändert sich nicht Kasimirkass ActionScript 1 2 25-05-2005 09:35
Textfarbe ändert sich nicht Pan_Tau ActionScript 1 2 07-04-2005 15:17
Uhrzeit ändert sich, Grafik ändert sich, wie? Don Caracho Flash MX 2004 3 03-03-2004 17:07
Random ändert sich nicht ChatJack ActionScript 1 5 03-01-2003 15:35


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:41 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele