Giter Club home page Giter Club logo

spring-mobile's Introduction

spring-mobile is no longer actively maintained by VMware, Inc.

This project is no longer active and has reached end of life

Spring Mobile

Spring Mobile is an extension of the Spring Framework and Spring Web MVC that aims to simplify the development of mobile web applications.

Features

  • A device resolver abstraction for server-side detection of mobile and tablet devices

  • Site preference management that allows the user to indicate if he or she prefers a "normal", "mobile", or "tablet" experience

  • A site switcher capable of switching the user to the most appropriate site, either mobile, tablet, or normal, based on his or her device and optionally indicated site preference

  • Device aware view management for organizing and managing different views for specific devices

Download Artifacts

Include the spring-mobile-starter in your Spring Boot application to enable Spring Mobile's Auto-Configuration. See downloading Spring artifacts for Maven repository information. Unable to use Maven or other transitive dependency management tools? See building a distribution with dependencies.

Gradle

dependencies {
    compile("org.springframework.mobile:spring-mobile-starter:2.0.0.M2")
}
repositories {
    maven { url "https://repo.spring.io/milestone" }
}

Maven

<dependencies>
    <dependency>
        <groupId>org.springframework.mobile</groupId>
        <artifactId>spring-mobile-starter</artifactId>
        <version>2.0.0.M2</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
    </repository>
</repositories>

Documentation

See the current Javadoc and reference docs.

Sample Applications

Several example projects are available in the samples repository.

Getting Started Guides

The spring.io web site contains many getting started guides that cover a broad range of topics.

Support

Review the spring-mobile tag on Stack Overflow.

Issue Tracking

Report issues via GitHub issues. Understand our issue management process by reading about the lifecycle of an issue.

Build from Source

  1. Clone the repository from GitHub:

    $ git clone https://github.com/spring-projects/spring-mobile.git
  2. Navigate into the cloned repository directory:

    $ cd spring-mobile
  3. The project uses Gradle to build:

    $ ./gradlew build
  4. Install jars into your local Maven cache (optional)

    $ ./gradlew install

Import Source into your IDE

Eclipse

  1. To generate Eclipse metadata (.classpath and .project files):

    $ ./gradlew eclipse
  2. Once complete, you may then import the projects into Eclipse as usual:

    File -> Import -> Existing projects into workspace
    

Note: Spring Tool Suite has built in support for Gradle, and you can simply import as Gradle projects.

IDEA

Generate IDEA metadata (.iml and .ipr files):

$ ./gradlew idea

Contribute

Pull requests are welcome. See the contributor guidelines for details.

Stay in Touch

Follow @SpringCentral as well as @SpringFramework on Twitter. In-depth articles can be found at The Spring Blog, and releases are announced via our news feed.

License

Spring Mobile is released under version 2.0 of the Apache License.

spring-mobile's People

Contributors

belingueres avatar ejzn avatar evpaassen avatar foo4u avatar habuma avatar okohub avatar royclarkson avatar spring-builds avatar spring-operator avatar tburch avatar trevormarshall avatar wilkinsona avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-mobile's Issues

New Structure For Device and Device Resolving

Hi @royclarkson,

Regarding to issue #25, I want to talk about what we can do more.

  1. As you said we should make this process modular, where people can register several strategies within the DeviceResolver. What are you thinking about that, what is the way we should follow? I want to help.

Moreover, I think Device interface would share more information, let's make it more robust and powerful by designing with 3 dimension; DeviceType - DevicePlatform - DeviceChannel.

You know we already handled DeviceType and DevicePlatform, but DeviceType is not accessible. We should add getter for this.

DeviceChannel is new, this dimension will identify the channel of user. For example, it is not certain that a MOBILE - IOS user is entering from a browser. May be user is coming from a mobile application. I think we can also handle it using a custom http header?

  1. With upgrades, I think there should be a new simple module that only contains device and device resolving. This will also help people who only want to use Device Resolving. (especially in spring-boot)

About Google to phase out user-agent strings in Chrome

First of all I am using the spring-mobile-device module well thanks to you.

I would like to inquire about one issue.
Google announced that Chrome will gradually restrict user-agent information by looking at this article.

Will the spring-mobile-device module change this? If so, when is that time? Thanks again.

Blackberry 10 user agent missing

Hi,

I'm working with a blackberry 10 virtual machine and it never detect this device as mobile. I reviewed the KNOWN_MOBILE_USER_AGENT_KEYWORDS variable and I think it's only add the "touch" as new keyworkd, I'm not sure :)

There is the user agent example:

Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.386 Mobile Safari/537.3+

And here the description of user agent for this device.

http://crackberry.com/developers-here-blackberry-10-user-agent

spring-mobile-device also support spring-webflux?

thank you for effort developing spring-mobile

i want to use spring-mobile-device with spring-webflux.

is there any way use spring-mobile-device with spring-webflux ? or is there any alternative?

SAMSUNG I9308 mobile , Device incorrect

our tester use SAMSUNG I9308 mobile test our website

but currentDevice result is tablet

user-agent is:

SAMSUNG-GT-I9308_TD/1.0 Android/4.1.2 Release/12.20.2012 Browser/AppleWebKit534.30

I review org.springframework.mobile.device.LiteDeviceResolver.resolveDevice(HttpServletRequest)method

because user-agent

userAgent.contains("android") && !userAgent.contains("mobile") so return tablet

but the device actual is mobile not tablet

DeviceWebArgumentResolver implementation

Is there a reason why DeviceWebArgumentResolver implements WebArgumentResolver and not HandlerMethodArgumentResolver ?

I'm using a Spring configuration with Java classes and WebMvcConfigurer only handles arguments resolvers which implements HandlerMethodArgumentResolver.

Bot User-Agent conflicting with KNOWN_MOBILE_USER_AGENT_PREFIXES

Hi!

We operate a web crawler that performs technical audits for a number of clients. Some of our clients use the Spring Framework and the spring-mobile extension to detect mobile user-agents.

The prefix "audi" in the list of known mobile user agent prefixes conflicts with the user-agent of our bot.

private static final String[] KNOWN_MOBILE_USER_AGENT_PREFIXES = new String[] {
        "w3c ", "w3c-", "acs-", "alav", "alca", "amoi", "audi", "avan", "benq",
        "bird", "blac", "blaz", "brew", "cell", "cldc", "cmd-", "dang", "doco",
        "eric", "hipt", "htc_", "inno", "ipaq", "ipod", "jigs", "kddi", "keji",
        "leno", "lg-c", "lg-d", "lg-g", "lge-", "lg/u", "maui", "maxo", "midp",
        "mits", "mmef", "mobi", "mot-", "moto", "mwbp", "nec-", "newt", "noki",
        "palm", "pana", "pant", "phil", "play", "port", "prox", "qwap", "sage",
        "sams", "sany", "sch-", "sec-", "send", "seri", "sgh-", "shar", "sie-",
        "siem", "smal", "smar", "sony", "sph-", "symb", "t-mo", "teli", "tim-",
        "tosh", "tsm-", "upg1", "upsi", "vk-v", "voda", "wap-", "wapa", "wapi",
        "wapp", "wapr", "webc", "winw", "winw", "xda ", "xda-" };

Our user-agent starts with "audisto.com" and is therefore always identified as mobile user-agent.

audisto.com full crawler 3.25.423 (refer to in robots.txt as audisto, see https://audisto.com/bot)

More information about our bot can be found here: https://audisto.com/help/crawler/bot

We would welcome an improved mobile detection in the spring framework especially because it usually affects new customers that are not aware of this issue. Due to our large user base and implication on other 3rd party software we can not change the user-agents of our bot.

Best Regards
Tobias

Wrong device detection for a Nokia Lumia 620

Hi,

The Nokia Luima 620 is detected as a "normal" device instead of a mobile phone.

Probably this happens because it uses an IE 10. These are the headers:

UserAgent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; ARM; Touch; WPDesktop)
x-wap-profile: null 
Profile: null 
Accept: text/html, application/xhtml+xml,

Looks like the key token in the UserAgen it the 'ARM' literal

Sorry for the spanish link:

IE-10 de 32 bits sobre Windows de 32 bits:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)
IE-10 de 32 bits sobre Windows de 64 bits:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
IE-10 de 64 bits sobre Windows de 64 bits:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)
IE-10 sobre Windows RT:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; ARM; Trident/6.0)

http://www.genbeta.com/navegadores/internet-explorer-10-nuevas-cadenas-user-agent-para-identificar-dispositivos-tactiles-y-arquitectura-arm

AbstractSitePathUrlFactory doesn't handle empty paths correctly

The formatPath(String path) AbstractSitePathUrlFactory class doesn't handle an empty path (empty String) correctly. It will return // (two slashes), instead of just one.

The error seems to be on line 197, where it should check if formattedPath ends with a slash, instead of path. I will create a PR with an accompanying test.

iOS13 iPad User Agent Issue

iPads on iOS13 will, by default, include a user-agent that matches MacOS, which breaks tablet detection in LiteDeviceResolver.java. This seems like an Apple issue, and I don't know that there is anything that can be done on the Spring side, but I thought I'd ask -

Does Spring Mobile have any plans to address this?

Status of the project?

The current Milestone 2.0.0 M3 was released on 26. Mar 2018. Is there anything that prevents a final 2.0 release, so that the artifact is available in Maven Central?
Is the lack of activity caused by it just working, or is this project abandoned/dormant?

Wrong device detected

Here is my user agent

Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-N900A Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36

This is wrongly being identified as a Tablet. There are several other user agents that should be identified to a Mobile Device,but is rather being resolved to a Tablet.

Metadata for "spring.mobile" isn't generated anymore

The annotation processor is not configured to generate the metadata for IDEs. As a result all "spring.mobile" keys are considered as unknown.

Adding compileOnly('org.springframework.boot:spring-boot-configuration-processor') to the build should fix the issue.

Detection systems provide

Whether DeviceUtils can provide a way to check the phone system, the system returns an enumeration
ios, mac ox, android, etc., or else we'll get from the inside UserAgent
thank you

Creating a structure like a LiteDeviceDelegatingViewResolver with a ViewResolver per Strategy

The issue addressed in #7 is very good for systems that use one viewResolver for all.

I'm currently facing this scenario:

HTML5 for web/touch devices and desktops, which uses a ThymeleafViewResolver with contentType set to:

"text/html; charset=UTF-8"

and XHTML for feature phones using another ThymeleafViewResolver with contentType set to:

"aplication/xml; charset=UTF-8"

So I have pages/html/home.html and pages/xhtml/home.xhtml, since they both points to same viewResolver I can't use this strategy, and there's another problem and thats on thymeleaf side, how to resolve the correct template based on the device type (I'll probably try to create an extension for them), should I create this structure on my side and then pull request it here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.