Code example for LocationProvider

Methods: requiresCell, requiresNetwork, requiresSatellite

0
 
    private long positioningMethods (String provider)
    { 
        long positioningMethod=0;
        LocationProvider providerInfo=m_locationManager.getProvider(provider);
        if(providerInfo.requiresSatellite())
        { 
            positioningMethod=0x000000ff;//Satellite-based positioning methods such as GPS
        } 
        if(providerInfo.requiresCell()||providerInfo.requiresNetwork())
        { 
            //0xffffff00 is for other-based positioning methods 
            //0xffffffff is for all methods 
            positioningMethod|= 0xffffff00;
        } 
        return positioningMethod;
    } 
 
    public void requestUpdates(long minTime)
    { 
        m_getMinTime=minTime;