Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Different welcome files depending on device used  RSS feed

 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,

I am working on a project, where I am creating a custom version of a existing .jsp website. The website provides my company with details about orders etc.
Right now I am developing a tool for the Motorola Smart Badge. The Smart badge contains a barcode scanner, this barcode scanner will be used in the warehouse, to pick orders etc.

The badge displays, a custom view of the existing webpages, I have changed the CSS and styles, so the badge can display them.
The website requires a user to log in, right now I am hosting a local tomee server, so in the web.xml I have set the login page to the Badge version.

I would like to know if its possible to have multiple login pages depending on the device used (Webbrowser/Badge).
If the welcome pages can be device specific I would also like to know if it is possible with the error pages as well.

Thanks & Regards,

PB
 
Tim Cooke
Marshal
Posts: 3648
184
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you elaborate on what you mean by "different devices". How are you hoping to detect / select those devices?
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the fast response!

Its quite simple, I have 1 other device (The Motorola Bagde). I was hoping its possible to do a check in the META data.
The badge uses a custom webbrowser so I think it should be possible to check the device used, but is it possible to do some kind of if()else in the web.xml ?

Thanks
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm maby i have an idea, If i create a page that check the device and then redirects to the appropriate login. That should work i guess.
But than my question remains for the error pages.
 
Tim Cooke
Marshal
Posts: 3648
184
Clojure IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you just want to use different CSS for different devices because of the screen size? For example using a different style for a mobile (small screen) device and a desktop (large screen) device?

If so, then CSS Media Queries might be something to consider. They allow you to conditionally include sections of your CSS based on characteristics of the requesting device such as screen width.
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No its more then the CSS, the badge is a really small screen so i have created a custom CSS and also adjusted the pages so they suit the badge.
 
Tim Cooke
Marshal
Posts: 3648
184
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pelle Braam wrote:adjusted the pages

Go on ....
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me get some screenshots.
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The badge uses a ink display so only black/white. And its really small like 3 inch.
Knipsel.PNG
[Thumbnail for Knipsel.PNG]
Webbrowser version
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It didnt add the second image so here it is
Knipsel2.PNG
[Thumbnail for Knipsel2.PNG]
Badge version
 
Tim Cooke
Marshal
Posts: 3648
184
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks like only style changes to me. If you know the resolution of the device, which I assume you do, then you can use the Media query to apply the relevant CSS for that. There also appears to be some options to detect the available colour palette, but I haven't used those so may require some experimentation.

You mention that there's "more than the CSS". What else is it?
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The webbrowser page contains clickable links, and other stuff. I will have a look at your link.
But what about a if,else like construction? The error pages for the browser cannot be displayed on the badge.
The badge uses a custom .js to include buttons etc.
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Cooke wrote:CSS Media Queries


Hmm media queries seem to work in the basics, let me try to fix it this way!

Thanks a lot
 
Tim Cooke
Marshal
Posts: 3648
184
Clojure IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the CSS "display: none;" for elements that you want to hide.
 
Peter Braams
Greenhorn
Posts: 10
Chrome Java Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again for your reply, i did some testing and got it working now!

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!