开发者

Getting Original Phone useragent with J2ME

开发者 https://www.devze.com 2023-02-18 21:12 出处:网络
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\

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 wi开发者_运维问答thin 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.


The fool-proof way is to detect the user-agent when the web browser requests the jad, and set the value in the returned jad file.

0

精彩评论

暂无评论...
验证码 换一张
取 消