aspose file tools*
The moose likes Java Micro Edition and the fly likes User-Agent is not being send + midlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "User-Agent is not being send + midlet" Watch "User-Agent is not being send + midlet" New topic
Author

User-Agent is not being send + midlet

Michael Hubele
Ranch Hand

Joined: Dec 17, 2005
Posts: 182
Hi

I am trying to use asp.net to grab the user-Agent then display it on the a phone.

However I noticed when the midlet connection to my asp.net website application no user-agent is sent and I don't understand why.

Here is my code:



Here is my midlet code:



When I check the debugger of my asp.net app only 2 header fields get sent to it.

1.context-length
2. host

That's it nothing else. I am not sure what I am missing.
Rashid Mayes
Ranch Hand

Joined: Jan 11, 2006
Posts: 160
User agents are not required at a protocol level and, unlike microbrowsers are not default when using the low level API.

You can set the user agent header by using:

c.setRequestProperty("User-Agent","myUserAgentString");

Some suggest using a User Agent based off the platform:

System.getProperty("microedition.platform");

We usually create a user agent which includes the application name and version.


Rashid Mayes
http://www.hostj2me.com/ - http://www.worlddeveloper.org/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: User-Agent is not being send + midlet
 
Similar Threads
NullPointerException
Connecting MIDlets to Servlets
failing to get login right from servlet and midlet
J2ME and RMI or CORBA
MIDlet cann't connect to servlet on website