2

Kinda new to J2ME. I was wondering how I could go about in getting a J2ME midlet to send the original user agent of the mobile device to a server instead of: "Profile/MIDP-1.0 Configuration/CLDC-1.0"?

The problem here is that I wont be able to kno the specific device the midlet runs on in order to manually set the useragent. This is because I'm developing a J2ME SDK that will be widely distributed for advertising purposes within other applications. It's like a plugin that fetches and display ads within an app.

For example, if the midlet runs on a sonyericsson, how can i get the midlet to send the original phone useragent:

"SonyEricssonW300i/R4EA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"

to my server without actually using

"setRequestProperty(" User-Agent", "SonyEricssonW300i/R4EA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1")" ?

I want to detect the true device using WURFL on the server-side. If the midlet sends "Profile/MIDP-1.0 Configuration/CLDC-1.0" as the useragent, WURFL will detect the phone as "Generic J2ME midlet" instead of SonyEricsson W300.

I'd really appreciate it if someone assist.

4

1 回答 1

3

万无一失的方法是在浏览器请求 jad 时检测到 user-agent,并在返回的 jad 文件中设置值。

于 2011-04-12T20:27:52.900 回答