Web App Native Function Access via Localhost Socket Listener
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current technologies require developing custom browser plugins for each combination of hardware, operation systems, and browsers to enable mobile web applications to access native functions, leading to impractical efforts due to high compatibility requirements and limitations in cross-domain communication, resulting in unidirectional communication.
Innovation Solution
Implementing a TCP/IP socket listener module on mobile devices that listens for localhost IP addresses and port numbers, allowing web applications to submit cross-domain HTTP requests to trigger native functions, bypassing security restrictions and enabling bidirectional communication through HTML iFrame tags.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If custom browser plugins are developed for each combination of hardware, operation systems, and browsers to enable mobile web applications to access native functions, then native function access is enabled, but development effort and complexity become unmanageably high
Solution Approach 1:
The patent implements a universal communication mechanism using standard HTTP requests and localhost sockets that works across all browsers, operating systems, and device types without requiring custom plugins for each combination. The web application server acts as a universal intermediary that can trigger native functions on any mobile device through standardized protocols, eliminating the need for multiple platform-specific implementations.
Solution Approach 2:
The patent introduces a web application server as an intermediary between the web application and native device functions. Instead of requiring direct plugin-based access from the browser to native functions, the system uses the server as a mediator that receives HTTP requests, processes them, and triggers appropriate native functions on the device through standardized communication channels, thereby simplifying the architecture and reducing development complexity.
2Ease of operation
If standard XML HTTP requests are used for cross-domain communication, then web application functionality is improved, but browser security policies block the requests
Solution Approach 1:
Instead of having the mobile device browser initiate cross-domain HTTP requests to external servers (which are blocked by security policies), the patent inverts the approach by having the web application server communicate with the device through localhost sockets. The server sends HTTP requests to the device's local web application, which then triggers native functions. This reversal of communication direction bypasses cross-domain security restrictions while maintaining functionality.
3Ease of operation
If iFrame cross-domain calls are used, then client-to-server requests are enabled, but response handling is not supported resulting in unidirectional communication
Solution Approach 1:
The patent implements a feedback mechanism where the device's web application can send HTTP requests to the web application server, and the server can respond by triggering native functions and sending results back to the device. This creates a bidirectional communication loop where information flows both from the server to the device and from the device back to the server, enabling versatile two-way interaction rather than unidirectional communication.
Data Source
AI summary
Enabling a web application to call at least one native function of a mobile device includes accessing the web application by a browser of the mobile device. The web application includes at least one GUI element. The mobile device operates a listener module that is a TCP/IP socket listener listening for an address including a localhost IP address and a port number. Upon selection of the GUI element, a cross domain HTTP request is submitted by the browser to the listener localhost IP address. The listener module receives the request and calls the at least one native function in dependence on the received request.


