cancel
Showing results for 
Search instead for 
Did you mean: 

Identifying browser/device

Former Member
0 Kudos

Hello all.

Is there a way to identify a browser or device in runtime? I want to write a piece of code that checks if the user is accessing the application through a normal browser (IE/Firefox) or using a mobile device (Blackberry), so my app can redirect to a more complex UI in case of ordinary browsers or to a simpler UI (fewer fields) in case of a mobile device.

I tried this without success:

ClientInfoFactory factory = ClientInfoFactory.newInstance();

ClientInfo clientInfo = factory.newClientInfo();

IWDProtocolAdapter protAdapter = WDProtocolAdapter.getProtocolAdapter();

IWDRequest request = protAdapter.getRequestObject();

clientInfo.load(request);

String deviceName = clientInfo.getDeviceName();

I get ClassNotFoundException or NullPointerException depending on how clientinfo.jar is referrenced in the project.

Anyone knows any solution to this? Any help is appreciated,

regards,

Paulo.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Paulo,

I´m facing the same problem, did you solve it?

Thanks in advance.