View Single Post
Old 05-28-2009, 07:40 PM   #10
shwemp
New Member
 
Join Date: Dec 2006
Location: KC
Model: 8330
Carrier: Verizon Wireless
Posts: 9
Default

Tyth over at crackberry.com forums says this bit of code should work.

Code:
LocationProvider provider;
try
{
    provider = LocationProvider.getInstance(null);
    int vendorId = Branding.getVendorId();
    if (provider == null)
    {
        Dialog.alert("GPS unsupported on this device.");
        System.exit(0);
    }
    else if (vendorId == 105 || vendorId == 226 || vendorId == 237)
    {
        try
        {
            GPSSettings.setPDEInfo("127.0.0.1;12569612;F5468C61EE541421908597C54975B584", 0);
        }
        catch (IllegalArgumentException iae)
        {
            // shouldn't happen
            Dialog.alert("Failed in sending PDE credentials to carrier.");
            System.exit(0);
        }
        catch (UnsupportedOperationException uoe)
        {
            // not a CDMA device
        }
    }
    // set up the location listener here
    provider.setLocationListener(<object implementing LocationListener>, 1, 1, 1);
}
catch (LocationException le)
{
    Dialog.alert("Failed to instantiate the location provider.");
    System.exit(0);
}
Offline   Reply With Quote