How to Get list of preffered access points by other applicatioins in J2me
Article Metadata
Tested with
Devices(s): Java Runtime 1.4
Compatibility
Platform(s): MIDP 2.0
Article
Keywords: IAPInfo, APN, DN, Access point, Destination Network
Created: ektasrv
(30 Aug 2010)
Last edited: hamishwillee
(05 Jul 2012)
Contents |
Problem
How to Get list of preferred access points by other applications in J2me ?
Solution
Use IAPInfo API 1.0, available on devices with Java Runtime 1.4 to access Internet Access point information from the native database.
Sample Code
Imports
import com.nokia.mid.iapinfo.*;
Get list of preferred APN
public AccessPoint[] getLastUsedAPN() throws IAPInfoException
{
//Obtain IAPInfo object by factory
IAPInfo iapinfo = IAPInfo.getIAPInfo();
//Get the list of preferred APN.
AccessPoint ap[];
try{
ap[]= iap.getConnectionPreferences();
return ap[];
}catch(Exception e) {return null}
}
Note
Check your target device spec's (http://www.developer.nokia.com/Devices/Device_specifications/?filter1=all) for support of IAPInfo API on it before using it.
--Submitted by Meetu Ekta at 21:58(IST), 30 August 2010.


(no comments yet)