Sign in to follow this  
benryves

[web] Installing applications on mobile devices via WAP - just link to .jad?

Recommended Posts

I'm trying to add a download link to a Java application on my website. (Via WAP) I tried just a hyperlink pointed at the .jad file - no luck, my phone keeps reporting a "file format unknown" (and I've been able to download files to my phone before - how do people do it?) Any ideas? The website is located at www.benryves.com (it should switch to the WAP mode if you try and access on a phone).

Share this post


Link to post
Share on other sites
Sounds like your server isn't set up correctly for sending the proper Content-Type/MIME types for jad and jar files? If you're using Apache, add a .htaccess file with AddType directives to specify the required Content-Types.

A useful tool for checking that you have the correct MIME types set up on your server is the web-based header reader at:
http://www.delorie.com/web/headers.html

You enter the URL of your WML, JAD, or JAR file (use correct case) and click on the view page button. The website then makes a request to your site and displays information about the HTTP headers that are returned. The header results should be:

JAD file:
Content-Type: text/vnd.sun.j2me.app-descriptor

JAR file:
Content-Type: application/java-archive

WML file:
Content-Type: text/vnd.wap.wml
(The WML MIME type this is probably OK if your WAP site is working OK, most hosts have this set up correctly anyway)

[Edited by - abstractworlds on August 5, 2004 3:46:32 AM]

Share this post


Link to post
Share on other sites
Hopefully this isn't the case, but you may have 2 problems to overcome.

The first problem is to do with MIME types which I've already mentioned.

The second problem is to do with Vodafone in the UK and their recently introduced Content Control system. Unfortunately if Vodafone are blocking access to your jad or jar the user just gets an unhelpful message like response unknown or invalid file format. To minimise this problem you should use the same address links in your WML file's link to jad, and jad file's link to jar as your WAP site address, i.e. if your WAP site is http://www.benryves.com/... then dont have your jad or jar link as an IP address http://123.123.123.123/....
If you still think there is still a problem with Content Control, try browsing with a different operator's WAP settings (e.g. 02), and if this proves that Vodafone is blocking, 'try' to get in touch with Vodafone.

Share this post


Link to post
Share on other sites
Quote:
Original post by abstractworlds
Hopefully this isn't the case, but you may have 2 problems to overcome.

The first problem is to do with MIME types which I've already mentioned.

The second problem is to do with Vodafone in the UK and their recently introduced Content Control system. Unfortunately if Vodafone are blocking access to your jad or jar the user just gets an unhelpful message like response unknown or invalid file format. To minimise this problem you should use the same address links in your WML file's link to jad, and jad file's link to jar as your WAP site address, i.e. if your WAP site is http://www.benryves.com/... then dont have your jad or jar link as an IP address http://123.123.123.123/....
If you still think there is still a problem with Content Control, try browsing with a different operator's WAP settings (e.g. 02), and if this proves that Vodafone is blocking, 'try' to get in touch with Vodafone.


I recognise the name :) [I looked at your site to try and get some ideas]. I'm not in control of my hosting at the moment - as in, I can't work with my .htaccess file - however, in the not-so-distant future I'm changing hosts to one where I do have access to that elusive file. Hopefully then I can fix that problem ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by benryves
I'm not in control of my hosting at the moment - as in, I can't work with my .htaccess file


I don't think that you need access to the site's .htaccess file. With my webhost it is possible to just create a web directory, create a text .htaccess file locally and upload it to that directory. Apache will abide by the rules of the .htaccess file it finds in the directory, if it can't find one it treekwalks up the directories, if it still cant find one it just uses some global .htaccess file (I think).

Share this post


Link to post
Share on other sites
Ah; good point :)
Next question:
I doubt it highly, but I might as well ask - I'm developing an HRM system in PHP. We'd like to integrate that with a WAP service as all the members of the company have company mobiles with set numbers - however, logging in to the secured system is probably quite tricky - what would be ideal is if you could (in the PHP) look up the phone number of the person browsing the site (I doubt that's possible) and instead of a username/password using that to log them into the system. Do phones send out a unique number or something when browsing WAP that could be used as a unique ID so that it could be looked up on the database and set user levels as required?

Share this post


Link to post
Share on other sites
I think most WAP phones support cookies. You can use a cookie to remember that they are logged in for a long period.

The first time they arrive, you'll need to prompt for a phone number and security code or something.

Don't use a (alphanumeric) password because it's a pain to type on a phone. Either send them a SMS containing the PIN, or physically hand it over on a piece of paper.

You can renew the cookie each time they visit the site. I don't know whether the cookies are stored in the device or the WAP gateway, but it doesn't really matter.

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by markr
I think most WAP phones support cookies. You can use a cookie to remember that they are logged in for a long period.

The first time they arrive, you'll need to prompt for a phone number and security code or something.

Don't use a (alphanumeric) password because it's a pain to type on a phone. Either send them a SMS containing the PIN, or physically hand it over on a piece of paper.

You can renew the cookie each time they visit the site. I don't know whether the cookies are stored in the device or the WAP gateway, but it doesn't really matter.

Mark


OK, I can imagine that reducing passwords to a 4-digit PIN would be best - and if cookies are stored then they'd only have to enter their username once.
Thanks :)

Share this post


Link to post
Share on other sites
OK, I've fixed the MIME type problems, without having to mess around with the server config (which I can't do!) - here is a simple ASP file that does the trick:

<%

fileType = mid(request("file"),instr(request("file"),".")+1,3)

if fileType = "jad" then
Response.ContentType = "text/vnd.sun.j2me.app-descriptor"
else
Response.ContentType = "application/java-archive"
end if

server.execute(request("file"))

%>


Now, for a link just specify the target as getfile.asp?file=FILE.EXT, where FILE.EXT is the filename. Of course, you also have to edit the .jad file so that the jar target is getfile.asp?file=x.jar, but I tried it on my mobile and successfully installed a Java application to it via WAP. Shame that about 10 minutes after fixing it I had to move my web hosting :( so no website for a few days as they fix up the DNS.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this