CN111399939A - Method and system for realizing photographing and photo selection in webView - Google Patents

Method and system for realizing photographing and photo selection in webView Download PDF

Info

Publication number
CN111399939A
CN111399939A CN202010166861.2A CN202010166861A CN111399939A CN 111399939 A CN111399939 A CN 111399939A CN 202010166861 A CN202010166861 A CN 202010166861A CN 111399939 A CN111399939 A CN 111399939A
Authority
CN
China
Prior art keywords
photo
webview
camera
album
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010166861.2A
Other languages
Chinese (zh)
Inventor
朱小军
李梁
滑立栋
王彬彬
韩晓芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Jinxi Intelligent Technology Co ltd
Original Assignee
Suzhou Jinxi Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Jinxi Intelligent Technology Co ltd filed Critical Suzhou Jinxi Intelligent Technology Co ltd
Priority to CN202010166861.2A priority Critical patent/CN111399939A/en
Publication of CN111399939A publication Critical patent/CN111399939A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method, a system, a device and a medium for realizing photographing and photo selection in webView, which can realize that a webView component is used for calling a camera to photograph and calling an album to select photos, and meet the requirements in read-native and H5 mixed development, and the method comprises the following steps: step 1: rewriting a webView component of read-native through an android native code; step 2: the read-native acquires the webView component rewritten in the step 1; and step 3: photos or photographs were selected in the H5 page by the rewritten webView component.

Description

Method and system for realizing photographing and photo selection in webView
Technical Field
The invention relates to the technical field of read-native and H5 mixed development, in particular to a method and a system for realizing photographing and photo selection in webView.
Background
While the hybrid development of RN (read-native) and H5 can greatly save cost and development efficiency, a real-native webview component is required in the hybrid development of RN and H5, and it is found in the process of project development that a camera cannot be called to take a picture and an album cannot be called to select the picture by using the webview component on the device.
Disclosure of Invention
Aiming at the problems, the invention provides a method, a system, a device and a medium for realizing photographing and photo selection in webView, which can realize that a webView component is used to call a camera to photograph and call an album to select photos, and meet the requirements in the mixed development of read-native and H5.
The technical scheme is as follows: the method for realizing photographing and photo selection in webView is characterized by comprising the following steps of:
step 1: rewriting a webView component of read-native through an android native code;
step 2: the read-native acquires the webView component rewritten in the step 1;
and step 3: photos or photographs were selected in the H5 page by the rewritten webView component.
Further, in step 1, a method for selecting an observed object by adding a file in a kernel client in the rewritten webView component is used for providing an entry for file selection operation and determining an entry event position, and specifically includes setting a command for taking a picture to open a camera and setting a command for selecting a photo to open an album.
Further, in step 3, clicking to take a picture in a page H5, and calling a method for selecting the observed object by using a file of the webView component to open the camera; clicking on the select photo in the H5 page invokes the webView component's file to select the method for the observed object to open the album.
Further, the supported photo albums include a system photo album and a third party photo album, and the supported cameras include a system camera and a third party camera.
A system for enabling photography and photo selection in webView, comprising:
the rewriting module is used for rewriting the read-native webView component through the android native code;
the acquisition module is used for enabling the read-native to acquire the webView component rewritten by the rewriting module;
and a calling module for selecting a picture or taking a picture in the H5 page through the rewritten webView component.
Further, the rewriting module adds a method for selecting an observed object by a file in a kernel client in a rewritten webView component, and is used for providing an entry for file selection operation and determining an entry event position, specifically including setting a command for taking a picture to open a camera and setting a command for selecting a picture to open an album.
Further, the calling module clicks in a page H5 to take a picture, and calls a method for selecting an observed object by a file of the webView component to open the camera; clicking on the select photo in the H5 page invokes the webView component's file to select the method for the observed object to open the album.
Furthermore, the photo albums supported by the calling module comprise a system photo album and a third-party photo album, and the supported cameras comprise a system camera and a third-party camera.
Device that realizes shooing and photo selection in webView, its characterized in that, it includes: comprising a processor, a memory, and a program;
the program is stored in the memory, and the processor calls the program stored in the memory to execute the method for realizing photographing and photo selection in webView.
A computer-readable storage medium characterized by: the computer readable storage medium is configured to store a program configured to perform the above-described method of enabling taking and photo selection in webView.
By the method, the system, the device and the medium for realizing photographing and photo selection in the webView, the webView component can realize photographing and photo selection, the method for selecting the observed object by the rewritten file can be triggered by clicking the photographing or photo selection on the user interface, and the requirements in read-native and H5 mixed development are met.
Drawings
FIG. 1 is a flow chart of a method of implementing photographing and photo selection in webView in accordance with the present invention;
FIG. 2 is a block diagram of a system for implementing photography and photo selection in webView according to the present invention.
Detailed Description
Referring to fig. 1, the method for realizing photographing and photo selection in webView of the present invention comprises the following steps:
step 1: rewriting a webView component of read-native through an android native code;
step 2: the read-native acquires the webView component rewritten in the step 1;
and step 3: photos or photographs were selected in the H5 page by the rewritten webView component.
Specifically, in this embodiment, in step 1, a method for selecting an observed object by adding a file to a kernel client in a rewritten webView component is used to provide an entry for a file selection operation, and determine an entry event location, specifically including setting a command to take a picture to open a camera, and opening an album to the command to select a photo.
Specifically, in the embodiment, in step 3, click to take a picture in a page H5, and call a method of selecting an observed object from a file of the webView component to open a camera; clicking on the select photo in the H5 page invokes the webView component's file to select the method for the observed object to open the album.
In this embodiment, the supported photo albums include a system photo album and a third party photo album, and the supported cameras include a system camera and a third party camera.
The webView component can realize photographing and photo selection, the method for selecting the observed object by clicking the photographing or selecting the photo on the user interface can trigger the rewritten file can meet the requirements in the mixed development of read-native and H5, the uploaded path for the photo is in the Uri format, the called system photo album is better in compatibility, the default returned Uri is the content beginning, and the third party photo album is the file beginning.
Referring to fig. 2, in an embodiment of the present invention, there is further provided a system for implementing photographing and photo selection in webView, including:
the rewriting module 1 is used for rewriting a read-native webView component through an android native code;
the acquisition module 2 is used for enabling the read-native to acquire the webView component rewritten by the rewriting module 1;
calling module 3 for selecting a picture or taking a picture in page H5 via the rewritten webView component.
Specifically, the rewriting module 1 adds a file to a kernel client in the rewritten webView component to select an observed object, and is configured to provide an entry for a file selection operation, determine an entry event location, and specifically set an instruction to take a picture to open a camera, and open an album to the instruction to select a picture.
Specifically, the calling module 3 clicks in an H5 page to take a picture, and calls a method of selecting an observed object by a file of the webView component to open the camera; clicking on the select photo in the H5 page invokes the webView component's file to select the method for the observed object to open the album.
Specifically, the photo albums supported by the calling module include a system photo album and a third party photo album, and the supported cameras include a system camera and a third party camera.
In an embodiment of the present invention, there is also provided an apparatus for implementing photographing and photo selection in webView, including: comprising a processor, a memory, and a program;
a program is stored in the memory, and the processor calls the program stored in the memory to execute the above-mentioned method for realizing photographing and photo selection in webView.
The apparatus may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that the present embodiment is merely an example of an apparatus, and does not constitute a limitation of the apparatus, and may include more or less components than the present embodiment, or combine some components, or different components, for example, may further include an input/output device, a network access device, and the like.
The Memory may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory is used for storing programs, and the processor executes the programs after receiving the execution instructions.
The processor may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like. The Processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
A data processing program for carrying out operations of the present invention may be written in any combination of one or more programming languages, including AN object oriented programming language such as Java, C + +, or the like, as well as conventional procedural programming languages, such as the "C" language or similar programming languages.
A computer readable storage medium configured to store a program configured to perform the above-described method of taking a photograph and selecting a photograph in webView.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a system, method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the invention. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart and/or flowchart block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart.
The method for realizing photographing and photo selection in webView, the system for realizing photographing and photo selection in webView, the device for realizing photographing and photo selection in webView and the application of a computer-readable storage medium provided by the invention are described in detail above, a specific embodiment is applied in the description to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. The method for realizing photographing and photo selection in webView is characterized by comprising the following steps of:
step 1: rewriting a webView component of read-native through an android native code;
step 2: the read-native acquires the webView component rewritten in the step 1;
and step 3: photos or photographs were selected in the H5 page by the rewritten webView component.
2. The method of claim 1, wherein the method further comprises: in step 1, a method for selecting an observed object by adding a file in a kernel client in a rewritten webView component is used for providing an entry for file selection operation and determining an entry event position, and specifically includes setting a command for taking a picture to open a camera and setting a command for selecting a picture to open an album.
3. The method of claim 2, wherein the steps of: in step 3, clicking in a page H5 to take a picture, calling a file of the webView component to select a method of an observed object to open a camera; clicking on the select photo in the H5 page invokes the webView component's file to select the method for the observed object to open the album.
4. The method of claim 3, wherein the method further comprises: the supported photo albums include a system photo album and a third party photo album, and the supported cameras include a system camera and a third party camera.
5. A system for enabling photography and photo selection in webView, comprising:
the rewriting module is used for rewriting the read-native webView component through the android native code;
the acquisition module is used for enabling the read-native to acquire the webView component rewritten by the rewriting module;
and a calling module for selecting a picture or taking a picture in the H5 page through the rewritten webView component.
6. The system of claim 5, wherein the camera and photo selection system is further configured to: the rewriting module is used for providing an entry of file selection operation and determining the entry event position, and specifically comprises the steps of setting a photo taking instruction to open a camera and opening an album for the photo selecting instruction.
7. The system of claim 6, wherein the camera and photo selection system is further configured to: the calling module clicks in a page H5 for photographing, and a method for selecting an observed object by calling a file of the webView component is used for opening the camera; clicking on the select photo in the H5 page invokes the webView component's file to select the method for the observed object to open the album.
8. The system of claim 7, wherein the camera and photo selection system is further configured to: the photo albums supported by the calling module comprise a system photo album and a third party photo album, and the supported cameras comprise a system camera and a third party camera.
9. Device that realizes shooing and photo selection in webView, its characterized in that, it includes: comprising a processor, a memory, and a program;
the program is stored in the memory, and the processor calls the program stored in the memory to execute the method for realizing photographing and photo selection in webView as claimed in claim 1.
10. A computer-readable storage medium characterized by: the computer readable storage medium is configured to store a program configured to perform the method of claim 1 for enabling taking a photograph and photo selection in a webView.
CN202010166861.2A 2020-03-11 2020-03-11 Method and system for realizing photographing and photo selection in webView Pending CN111399939A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010166861.2A CN111399939A (en) 2020-03-11 2020-03-11 Method and system for realizing photographing and photo selection in webView

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010166861.2A CN111399939A (en) 2020-03-11 2020-03-11 Method and system for realizing photographing and photo selection in webView

Publications (1)

Publication Number Publication Date
CN111399939A true CN111399939A (en) 2020-07-10

Family

ID=71434178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010166861.2A Pending CN111399939A (en) 2020-03-11 2020-03-11 Method and system for realizing photographing and photo selection in webView

Country Status (1)

Country Link
CN (1) CN111399939A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924430A (en) * 2018-08-27 2018-11-30 Oppo广东移动通信有限公司 photo storage method, device, terminal and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924430A (en) * 2018-08-27 2018-11-30 Oppo广东移动通信有限公司 photo storage method, device, terminal and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN110874217B (en) Interface display method and device for quick application and storage medium
KR20170040244A (en) Apparatus and method for supplying content aware photo filters
CN110705532B (en) Method, device and equipment for identifying copied image
CN111860011A (en) Target graphic code identification method and device
CN106095278A (en) A kind of photographic method and mobile terminal
CN106228063A (en) Auxiliary function permission control method and device and terminal equipment
TW201923703A (en) Image hardware encoding processing method and device
EP3547136A1 (en) Method and apparatus for communication between webpage and operating system
CN110865864B (en) Interface display method, device and equipment for quick application and storage medium
CN111259441B (en) Device control method, device, storage medium and electronic device
CN113992854B (en) Image preview method, device, electronic equipment and computer readable storage medium
CN107368293B (en) Page structure generation method, page screenshot reporting method, device and system
CN111444453A (en) Page return data processing method and device
CN109063085B (en) Thumbnail generation method and device
CN111008050B (en) Page task execution method, device, terminal and storage medium
CN111399939A (en) Method and system for realizing photographing and photo selection in webView
CN109857478B (en) Target application program running method and device and readable storage medium
CN109862295B (en) GIF generation method, device, computer equipment and storage medium
CN110989978A (en) Page packaging method and device, electronic equipment and storage medium
WO2023050418A1 (en) Data processing method, data processing system, electronic device, and storage medium
CN110968513A (en) Recording method and device of test script
US20140193083A1 (en) Method and apparatus for determining the relationship of an image to a set of images
CN115514894A (en) Processing method and electronic equipment
CN113794846A (en) Video cloud clipping method and device and cloud clipping server
CN114528037A (en) Application starting method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200710