on 01-25-2008 4:22 PM
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.
Hello Paulo,
I´m facing the same problem, did you solve it?
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.