Tuesday, October 21, 2008

How to get UserAgent for S60 v3.x devices.

use the following code to get the user agent of the device.

iRepository= CRepository::NewLC(TUid::Uid(0x101f8731));
TBuf<255> tmp;
iRepository->Get(7, tmp);
iUserAgent = HBufC8::NewL(tmp.Length());
iUserAgent->Des().Copy(tmp);

2 comments:

DeathBaba said...

On which devices have you tested this code? It doesn't work on 3.2 platform :(

DeathBaba said...

Oh I already found the reason. On 3.2 devices I've tested, another key index should be used (5 instead of 7, for example)

stats counter