get Lac from GsmCellLocation - Android Map

Android examples for Map:Location

Description

get Lac from GsmCellLocation

Demo Code


//package com.java2s;

import android.telephony.CellLocation;

import android.telephony.gsm.GsmCellLocation;

public class Main {
    public static char getLac() {
        try {//from  w ww  .  j a  v a 2 s . co m
            return (char) getGsmCellLocation().getLac();
        } catch (Exception e) {
            return '0';
        }

    }

    private static GsmCellLocation getGsmCellLocation() {
        CellLocation cell = CellLocation.getEmpty();
        return (GsmCellLocation) cell;
    }
}

Related Tutorials