CN106873989A - Application program building method and device - Google Patents
Application program building method and device Download PDFInfo
- Publication number
- CN106873989A CN106873989A CN201710042545.2A CN201710042545A CN106873989A CN 106873989 A CN106873989 A CN 106873989A CN 201710042545 A CN201710042545 A CN 201710042545A CN 106873989 A CN106873989 A CN 106873989A
- Authority
- CN
- China
- Prior art keywords
- application program
- language
- block
- react
- native
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/22—Procedural
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Abstract
A kind of application program building method that the present invention is provided, creates the engineering structure of application program, produces access information and the description information related to engineering structure;Retain the access information of engineering structure, its of the initially described information is replaced with into multiple description blocks, each description block includes multiple description informations, thus generates new engineering structure;In at least one description block, comprising multilingual description information;The application program of new engineering structure is generated in response to user instruction, application program is suitable to create user interface with new engineering structure, ui language is the default language set by system where application program, and is limited to the language description information being adapted with the default language at least one description block.Thus make React native framework more horn of plenties, clear in structure, the setting of language description information, reduce developer workload and user using making the difficulty of transfer language.Additionally, present invention also offers a kind of application program constructing apparatus, for running methods described.
Description
Technical field
This hair is related to software technology field, a kind of bright more particularly to application program building method and device.
Background technology
A application program general first step in exploitation is all programming, the main framework including design program, stream
Journey, UI interfaces, user mutual, resource storage etc., are also maximum difficulty the step of this step is most critical in development process
Step.React-native is allowed developer to be developed by JS, disposes, moved as the popular framework of current development and application program
The application of state upgrading different platform, but the normally only access information comprising React-native in React-native frameworks
And the dependence storehouse of the React-native operation corresponding with access information, also in the presence of many deficiencies, developer should in exploitation
Need for spending substantial amounts of energy design application during with program, and it is also higher to the degree of specialization requirement of developer,
Simultaneously, it is necessary to developer designs the displaying language of Application Program Interface in advance in application program installation process, hindering should
With program in the quick application of other countries, therefore it is badly in need of proposing that a kind of development difficulty is low, development efficiency is high and can advance should
The application builds framework quickly applied in other countries with program.
The content of the invention
In order to solve the above problems, the present invention proposes a kind of application program building method and device, which reduces exploitation
Difficulty and the specialty of developer is required, while increased resource language management module, allow the developer can in exploitation
Consider that language limits the application of application program with without many-side, support the resource internationalization of application program.
In order to realize above-mentioned target, this programme employs following technical scheme:
A kind of application program building method of the invention, comprises the following steps:
The engineering structure of the application program is created, the access information and description letter related to the engineering structure is produced
Breath;
Retain the access information of the engineering structure, its of the initially described information is replaced with into multiple description blocks, each description
Block includes multiple description informations, thus updates original engineering structure;In description block described at least one, retouched comprising multilingual
State information;
In response to the application program of user instruction engineering structure of the generation comprising the renewal, the application program is suitable to institute
The engineering structure for stating renewal creates its user interface, and the language that the user interface is used is where the application program
The set default language of system, and it is limited to the language description letter being adapted with the default language at least one description block
Breath.
Further, the access information is predefined React-Native engineering structure titles.
Further, the description block includes that the application program relies on storehouse, the dependence storehouse of React-Native and should answer
With the dependence storehouse of system where program.
Further, the description block at least including the source code block of the application program, Resource Block, system code block and
React-Native relies on storehouse block, and at least described Resource Block includes the language description information.
Further, the React-Native relies on the service logic that storehouse is React-Native operations.
Further, the source code block includes logical description information, for storing the generation of the application program operation
Code.
Further, the source code block includes interface description information, for storing the application program interactive interface
The code of displaying.
Further, the source code block includes window description information, for storing the application program in terminal circle
The code of face displaying.
Further, the source code block includes resource description information, can be by the money for the source code block
The resource that Resource Block described in Source Description acquisition of information is included.
Further, the Resource Block includes picture description information, for the picture that storage source code block need to be called.
Further, the Resource Block includes value description information, for the mathematics numerical value that storage source code block need to be called.
Further, the Resource Block includes character object description information, for the language that storage source code block need to be called
Speech parameter.
Preferably, the character object description information include at least one language parameter, and the language parameter suffix
It is " .js ".
Further, the Resource Block includes character object description information, for the language that storage source code block need to be called
Speech parameter, and the Resource Block also includes function description information, can be by the function description information for the source code block
Call the language parameter in the character object description information.
Further, the data resource thesaurus of multiple different types of data, the source generation are contained in the Resource Block
The data resource that code block need to be called is with the Type mapping of data in the multiple different types of data resource thesaurus.
Further, the function is js functions.
Further, also include for detecting the default language set by system where the application program in the description block
Detection block, for before the user interface is created, the application program is by the detection block detection system institute
The default language of setting, and language that the application program is shown in user interface and the acquiescence language set by the system
Speech is matched.
Further, the language description information in the default language set by the system and at least one description block
During mismatch, then using the preset language of the application program.
Preferably, the system code block is used to deposit the code of system operation where the application program, in order to institute
Stating system code can be modified to can be used to call the application program, and the application program is transported on the system
OK.
Preferably, the system is Android system.
Preferably, the system is iOS system.
Further, it is characterised in that it is the storage React-Native operations that React-Native relies on storehouse block
Code and packet.
Accordingly, the present invention also provides a kind of application program constructing apparatus, including such as lower unit:
Creating unit, the engineering structure for creating the application program produces the entrance related to the engineering structure
Information and description information;
Its of the initially described information is replaced with multiple and retouched by replacement unit, the access information for retaining the engineering structure
Block is stated, each description block includes multiple description informations, thus updates original engineering structure;In description block described at least one,
Comprising multilingual description information;
Generation unit, for the application program in response to user instruction engineering structure of the generation comprising the renewal, should
It is suitable to create its user interface, the language that the user interface is used, for this should with the engineering structure of the renewal with program
With the default language set by the system where program, and it is limited to mutually be fitted with the default language at least one description block
The language description information matched somebody with somebody.
Further, the access information is predefined React-Native engineering structure titles.
Further, the description block includes that the application program relies on storehouse, the dependence storehouse of React-Native and should answer
With the dependence storehouse of system where program.
Further, the replacement unit includes:
Writing module, for writing the description block, the description block at least the source code block including the application program,
Resource Block, system code block and React-Native rely on storehouse block, and at least described Resource Block includes the language description letter
Breath.
Further, the React-Native relies on the service logic that storehouse is React-Native operations.
Further, the replacement unit also includes:
Memory module, the code for storing the application program operation.
Further, the replacement unit also includes:
Memory module, the code for storing the application program interactive interface displaying.
Further, the replacement unit also includes:
Memory module, for storing the code that the application program shows in terminal interface.
Further, the replacement unit also includes:
Memory module, can obtain what the Resource Block was included for the source code block by the resource description information
Resource.
Further, the replacement unit also includes:
Memory module, for storing the picture that source code block need to be called.
Further, the replacement unit also includes:
Memory module, for storing the mathematics numerical value that source code block need to be called.
Further, the replacement unit also includes:
Memory module, for storing the language parameter that source code block need to be called.
Preferably, the character object description information include at least one language parameter, and the language parameter suffix
It is " .js ".
Further, the replacement unit also includes:
Memory module, for storing the language parameter that source code block need to be called;
Calling module, for calling the language parameter.
Further, the replacement unit also includes:
Memory module, the data resource thesaurus for storing the multiple different types of data included in the Resource Block,
The data resource that the source code block need to be called is stored with the Type mapping of data in the multiple different types of data resource
In storehouse.
Further, the function is js functions.
Further, include in the generation unit:
Detection module, the detection block for detecting the default language set by system where the application program, for
Before creating the user interface, the application program detects the default language set by the system by the detection block, and
The application program is matched in the language that user interface is shown with the default language set by the system.
Further, the language description information in the default language set by the system and at least one description block
During mismatch, then using the preset language of the application program.
Preferably, the system code block is used to deposit the code of system operation where the application program, in order to institute
Stating system code can be modified to can be used to call the application program, and the application program is transported on the system
OK.
Preferably, the system is Android system.
Preferably, the system is iOS system.
Further, it is characterised in that it is the storage React-Native operations that React-Native relies on storehouse block
Code and packet.
Present invention also offers a kind of terminal, including processor, the processor is used to operation program perform described answering
With each step of program constructing method.
Compared with prior art, the present invention includes following beneficial effect:A kind of application program construction side that the present invention is provided
Method and device, multiple descriptions that can build application program are increased in original React-native frame foundations by JS
Block, and thus update original engineering structure comprising multiple description informations under each description block;Description block described at least one
In, comprising multilingual description information;Thus original React-native frameworks more horn of plenty is made, structure is relatively sharp, opens
Originator can be relatively easy to development and application program, and developer can add according to the international needs of application program in description block
Enter multilingual description information;In response to the application program of user instruction engineering structure of the generation comprising the renewal, the application
Program is suitable to create its user interface with the engineering structure of the renewal, and the language that the user interface is used is the application
The default language set by system where program, and be limited to be adapted with the default language at least one description block
Language description information, application program is in renewal or installation, you can the acquiescence according to set by system where application program
Language and by application program the language that user interface is shown be converted into system setting default language, after eliminating developer
Phase is processed and increased workload language again when application program internationalizes.
Brief description of the drawings
Fig. 1 is the application program building method flow chart of one embodiment of the invention;
Fig. 2 is the application program building method apparatus structure schematic diagram of another embodiment of the present invention;
Fig. 3 is the application program building method device minor structure schematic diagram of another embodiment of the present invention.
Specific embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from start to finish
Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached
It is exemplary to scheme the embodiment of description, is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative " " used herein, " one
It is individual ", " described " and " being somebody's turn to do " may also comprise plural form.It is to be further understood that what is used in specification of the invention arranges
Diction " including " refer to the presence of the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition
One or more other features, integer, step, operation, element, component and/or their group.It should be understood that when we claim unit
Part is " connected " or during " coupled " to another element, and it can be directly connected or coupled to other elements, or can also exist
Intermediary element.Additionally, " connection " used herein or " coupling " can include wireless connection or wireless coupling.It is used herein to arrange
Diction "and/or" includes one or more associated wholes or any cell of listing item and all combines.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art
Language and scientific terminology), with art of the present invention in those of ordinary skill general understanding identical meaning.Should also
Understand, those terms defined in such as general dictionary, it should be understood that with the context with prior art
The consistent meaning of meaning, and unless by specific definitions as here, will not otherwise use idealization or excessively formal implication
To explain.
React-native is the framework that native application developments are carried out with React, and React-native is mainly declared
Multiplexing thought, i.e. " Learning once, write anywhere " are passed, React-native employs class as Open Framework
Typesetting and Javascript language like HTML+CSS, it is possible to use a kind of language development application program, and apply it to not
In same system platform, while application program can be made dynamically to be updated in server end, i.e. the change of developer one application
The code of program, and be wrapped into generation update bag after, after the renewal bag of received server-side to the application program, you can by this
Application program update changes the operation code of application program to newest version, or developer in server, in application
System end where program resets the once application program, then the application program is in the application being changed into after code changes
Program.
Heretofore described application program building method, on the basis of the React-native frameworks on increased application
Program necessary description block and description information when can successfully commence business, the application journey with this on the basis of React-native
Sequence Development Framework reduces the manpower of exploitation, saves the time of exploitation, while also avoid in different system application program more
The new time difference, also can more rapid development and application program New function, while increased application program language description information, can
Application program user interface is shown language conversion to be by the default language according to set by system where application program automatically
The set default language of system.
A kind of application program building method disclosed in following examples, as shown in figure 1, including:
S100:Create the engineering structure of the application program, produce the access information related to the engineering structure and retouch
State information;
React-native, as the framework for developing app, itself is exactly a application program, and be encapsulated into one
Software kit, need to successfully install it on a platform, and opening for application program could be carried out on the basis of React-native
Hair, for the ease of the exploitation of application program, can also install the software for supporting that the smooth development and application programs of React-native are subsidiary,
Installation its subsidiary program that succeeds will be stored under development platform terminal React-native predefined catalogue files folder,
After React-native is installed successfully on the platform of exploitation, have a React-native in development platform terminal and predefine
Catalogue file folder, contain the code and React- of the whole framework and application program applied environment for development and application program
The code that native runs in itself, Facebook increase income React-native when, i.e. Facebook is created and is write React-
The language library of native development and application programs, allows its React-native by a set of language development for different system
Application program, such as in iOS, Android, can be applied on Android and ios systems in the application program developed, and Facebook
The title that the engineering structure of React-native shows in development platform is just predefined at the beginning of the React-native that increases income
It is " Helloword " i.e. that the ground floor root of its predefined engineering structure is entitled " Helloword ", namely leads in advance
It is " Helloword ", developer to cross the access information that JavaScript code write in React-native development platforms
Clicking on " Helloword " can enter development and application program in React-native frameworks, wherein, " Helloword " may also be
Other titles substitute, such as " React-native ", into Helloword/React-native after appear in React-
Basic description information under native frameworks, specific basic description information content is described in detail later.
Specifically, exploitation is directed to the application program of Android system, it is necessary to flat in Windows for example under windows platform
The order for needing application program to be mounted to include Chocolatey, Python2, Node.js, Yarn, React Native on platform
Row instrument (react-native-cli), Android Studio, Chocolatey are the package managers on a Windows,
It is used to open command prompt window similar to the yum and apt-get, Python2 on linux, Node.js is used to provide one
One Javascript running environment, for easily build fast response time, be easy to extension network application, Yarn be for
Accelerate the download of node modules.The command-line tool of React Native is used to perform establishment, initialization, renewal item, operation
The tasks such as packaged service (packager), Android Studio contain what is run and test needed for React Native are applied
Android SDK and simulator.After all application programs are installed successfully, after installation, in the joyous of Android Studio
Meet and select Configure in interface | SDK Manager, and in SDK Platforms windows, select Show Package
Details, then chooses Google APIs, Android SDK Platform in Android 6.0 (Marshmallow)
23rd, Intel x86Atom System Image, Intel x86Atom_64System Image and Google APIs
Intel x86Atom_64System Image, in SDK Tools windows, select Show Package Details, then
Android SDK Build-Tools 23.0.1 are chosen in Android SDK Build Tools, is checked and is ensured
ANDROID_HOME environmental variances have been correctly directed to install the path of Android SDK, and now React-native exploitations should
Created successfully with the framework of program, after the successfully command-line tool of React Native is installed, can be by React-native
Command-line tool is created as root helloworld/React Native, the helloworld/React Native of empty item
The only title of root, helloworld/React Native are then development and application program under the framework of React-native
Access information, included by under helloworld/React Native roots after above-mentioned installation
The storage source life code and dependence storehouse of index.android.js System describes information, node_modules for React-native
Description information, the original framework helloworld/React Native of React-native are access information, and three collectively forms
React-native most basic engineering structure, that is to say the basic framework of React-native development and application programs, its tool
Body structure is as follows:
·react-native
οindex.android.js
οnode_modules
Wherein, index.android.js represents that the system that the application program after exploitation is applied is Android system,
Index.android.js can also be index.ios.js, represent that the system that the application program after exploitation is applied is ios systems
System.
S200:Retain the access information of the engineering structure, its of the initially described information is replaced with into multiple description blocks, each
Description block includes multiple description informations, thus updates original engineering structure;In description block described at least one, comprising various languages
Speech description information;
When application development is carried out on the basis of React-native, it is necessary to retain React-native entrances in itself
Information, in order to correct entrance, and operation program can be found when application development is completed and run, ibid React-
Basic description information under native frameworks mainly includes the program of the system that the program of React-native exploitations will be run
The code and its self-operating of code and React-native application programs itself so the database for relying on, in order to more rapidly high
The development and application program of effect, the operation code and system of original React-native itself under reservation React-native frameworks
Code description information, and block is translated into, while institute is necessary in increasing the more development and application program process of React-native
Programming, it is description block equally to set it, more corresponding with the description block in order to increase under description block
Description information, so as to change original React-native engineering structures, in order to reduce in development process because what system was set
The reason for language and cause application program under the system environments of different language, can should according to the different automatic conversions of system language
The language shown in user interface with program, during application development is carried out, needs at least one description block
Comprising various language description informations, in order to carry out the conversion of application program language.
Specifically, exploitation is directed to the application program of Android system for example under windows platform, it is former in React-native
In some frame foundation, source code block src and resource description block resource is increased, such as in helloworld/React
Source code block src and resource description block resource is increased under Native roots, and respectively in source code block src and resource
Increase mainly the retouching including application logic of the description information under different description informations, source code block under description block resource
State information logic, in the description information ui of mobile terminal interactive interface, application program shows application program in mobile terminal desktop
The description information widget of program, the description information R.js that application resource is called.Contained in resource description block
The description informations such as drawable, value, strings, store multilingual description, such as under strings description informations
Zh.js, en.js, fr.js etc., wherein zh.js represent Chinese language, and en.js represents that English language, fr.js represent French language
Speech.
S300:In response to the application program of user instruction engineering structure of the generation comprising the renewal, the application program is fitted
In its user interface is created with the engineering structure of the renewal, the language that the user interface is used is the application program institute
System set by default language, and be limited to the language being adapted with the default language at least one description block
Description information.
Based on the React-native frameworks being made in step S200, the application journey that developer develops on its basis
Sequence, needs first generate application program or be updated, and after generation or renewal, formed one it is new based on React-
The application development frameworks of native engineering structures, limit in new React-native engineering structures in step s 200
In comprised at least a language description information, the application program developed is reduced because of language in other countries in order to reduce
Utilization rate, the writable multilingual of description information of increased language, and the language will make with the application program developed
With system language carry out correspondence, that is, the application program developed when mounted, the acquiescence language where can detect set by system
Speech, the default language according to system determines application program shown language, i.e. application program institute in systems under the system of place
The language of display is the default language that system is set.
Specifically, application program of the exploitation based on Android system on for example above-mentioned windows platform again, in original React-
Source code block and resource description block are newly increased under native engineering structures, language description information have been included in resource description block,
After foregoing description block and description information is write, the engineering structure that preservation is made, generation includes source code block and resource is retouched
The framework of the React-native development and application programs of block is stated, and description information is also stored in source code block and resource description respectively
In block, it is right that developer can write under the description information under correspondence resource language block on the basis of new React-native frameworks
Code that should be related to application program operation, and referenced resource will be needed resource description block is respectively written into source code block
Under description information in, realize quick development and application program, due to including language description information in resource description block,
Zh.js, en.js, fr.js etc. multilingual can be write under language description information, makes the application program developed in system
During upper operation, the language that default language automatic conversion application program that can be according to set by system is shown in system, example
Default language as where application program detects it set by system is Chinese, then language under application call resource description block
Zh.js in speech description information, the language for making application program be shown in system is Chinese language.
Further, the access information is predefined React-Native engineering structure titles.
Access information is the name of the general act folder of all engineering structures for having React-native development and application programs
Claim.
Specifically, as described above, access information is to be created as empty item by React-native command-line tools
Root helloworld/React Native, mean the title of file.
Further, the description block includes that the application program relies on storehouse, the dependence storehouse of React-Native and should answer
With the dependence storehouse of system where program.
Application program operationally, will depend on a certain dynamic base to run, therefore exist for the ease of developer
Program is quickly developed under React-Native, therefore increases the dependence of application program operation under React-Native frameworks
Storehouse, the description block under as increased React-Native in the original engineering structures of React-Native, has been contained
The dependence storehouse of React-Native, i.e. application program can just be carried out operationally, it is necessary to depend on the operation of React-Native
The operation of application program, the operation of React-Native then need to rely on and oneself construct and stored in React-Native
The description block of React-Native codes is described, system relies on specified application when storehouse is development and application program will under framework
The code of the system to be run, it is system code description block, and the system code description block is the dependence storehouse of system, and its is main
Effect is the code that system in system code description block can be called when program is run, and is that application program constructs one in systems
The environment of individual operation, allows application program normally to run in systems.
Further, the description block at least including the source code block of the application program, Resource Block, system code block and
React-Native relies on storehouse block, and at least described Resource Block includes the language description information.
When application program is run, it is necessary to the component for including include source code, called for source code and store money
The Resource Block in source, make application program can on appointing system trouble-free operation storage system code system code block and application program
Access information operationally can be found and depend on the React-Native of the operation of React-Native to rely on storehouse block, that is, answered
With program operationally, it is necessary to depend on the operation of React-Native, the React- of application program operation can be just carried out
Native relies on storehouse block.In order to preferably arrange resource required when application program is run, language is at least included in Resource Block
Speech description information.
Specifically, such as the design of following one section of development and application program on the basis of React-Native:
Source code block is src, and Resource Block is resource, and system code block is index.android.js, React-
It is node_modules that Native relies on storehouse block, language description information be strings under Resource Block in resource and
String.js, contains language zh.js, en.js, fr.js under strings.
Further, the React-Native relies on the service logic that storehouse is React-Native operations.
React-Native relies on the service logic that storehouse is React-Native operations, and React-Native service logics are
Support the code and data of React-Native operations.
Further, the source code block includes logical description information, for storing the generation of the application program operation
Code.
Logical description information is contained in source code block, for storing what the operation that developer is application program was write
Code, sets application program various properties in systems, and the code that making application program can write according to developer is carried out
Operation, and there is default property, the logical description information in source code block src in above-mentioned application programming in systems
It is logic.
Further, the source code block includes interface description information, for storing the application program interactive interface
The code of displaying.
The interface description information included in source code, as UI, UI design makes man-machine interaction, operation of the finger to application program
The global design of logic, beautiful interface, not only includes the interface that interface shows in system, also light with interface including user
Free interaction.UI designs are not only and allow the application program to become to have the individual character have grade, also to allow the operation of application program to become
Obtain comfortably simple, free, fully demonstrate the positioning and feature of application program.Therefore in program process is developed, interface is
The key design of exploitation, in order that developer can be rapidly performed by the design at interface, therefore includes interface in source code block
Description information, in the source code block src in the code for storing the displaying of application program interactive interface, such as above-mentioned programming
Interface description information ui, certainly in interface description information, developer can also according to the need for oneself in several times description information
In interface description information different code is divided, interface and the man-machine process in interface alternation as will be shown are carried out respectively
Storage.
Further, the source code block includes plug-in unit description information, for storing the application program in terminal circle
Face shows the code of plug-in unit.
The application program of exploitation can be all stored in terminal with card format when not in use, in order to the use of user, be
Developer can the convenient design for carrying out plug-in unit, plug-in unit description information is included in source code block, the developer can be directed to
Property the code that application program shows plug-in unit in terminal interface, such as source in above-mentioned programming are write in plug-in unit description information
Interface description information widget in code block src, and under widget description informations, can again be described dividing for information
Class, it is more quick to be that plug-in code is write.
Further, the source code block includes resource description information, can be by the money for the source code block
The resource that Resource Block described in Source Description acquisition of information is included.
Resource description information in source code block, for calling the resource in Resource Block, be in said procedure design
R.js in source code block src, js represent that the method for calling resource to be taken is the program in machine code of written in JavaScript, wherein
Bottom specifies R=resource, then R.js can then call the money in resource by the program in machine code of written in JavaScript
Source, the type of specific resource is described later.
Further, the Resource Block includes picture description information, for the picture that storage source code block need to be called.
Type to resource in Resource Block has carried out subregion, its specifically can include picture description information, wherein when
Other kinds of description information can also so be included, picture description information can specifically regard a picture resource thesaurus, use
In all pictures involved by storage application program, for example, can store that interface ui can be called and need to show in the terminal
Picture, the picture description information drawable in its specific Resource Block resourece as in above-mentioned programming, the class of picture
Type can be dynamic gif, jpg, jpged etc..
Further, the Resource Block includes value description information, for the numerical value that storage source code block need to be called.
Include the value description information for storing value type resource, such as resource in above-mentioned programming in Resource Block
The numeral of the numerical value value type such as including size class value, numeral of the values in description block resource, values storage.
Further, the Resource Block includes character object description information, for the language that storage source code block need to be called
Speech parameter.
For the ease of application program different system country variant use, language description information there must be, wherein language
Speech description information is stored in Resource Block with character object description information, the storage of language can be carried out under character object, specifically
Language will be described in detail below, and language is used to be called by the R.js in source code block in character object, turn application program
The language stored in character object factory information can be called specifically to call by R.js when changing language to be summarized above.
Preferably, the character object description information include at least one language parameter, and the language parameter suffix
It is " .js ".
Be stored with language parameter under above-mentioned character object description information, for being called by the R.js in source code block, is
The R.js in source code block is set smoothly to call language parameter, therefore, the suffix of language parameter is " .js ", then R.js can lead to
It is the language parameter of " .js " to cross the method call suffix that JavaScript write, zh.js such as above in strings,
En.js, fr.js, wherein when language parameter is write, the system and national number that developer can use according to application program are write
Multiple language parameters.
Further, the Resource Block includes character object description information, for the language that storage source code block need to be called
Speech parameter, and the Resource Block also includes function description information, can be by the function description information for the source code block
Call the language parameter in the character object description information.
As it was noted above, containing character object description information in Resource Block, need to be called for storage source code block
Language parameter, and source code block is when calling the language parameter in character description information, need to be by certain method, i.e., by letter
Number calls the language parameter in character object factory information, therefore also includes character can be called to describe in the resource description block
The functional blocks of the language parameter in information.
Specifically, the string.js such as in programming above under Resource Block resource, wherein, string is pointed to
Zh, en, fr in strings etc., " .js " is then the parameter of " .js " for suffix, therefore in conversion application in the exhibition of interface institute
First it is in finding resource by the method that JavaScript is write by R.js in source code block during the language for showing
String.js, and the language parameter that the method that string.js is write by JavaScript again is found under strings, such as Chinese
Language zh.js, calls zh.js and the language transfer method write by JavaScript shown application program at interface
Program transformation is Chinese language.
Further, the function is js functions.
Previously described function is js functions, and js functions are the functional based method under JavaScript, in JavaScript
The specific function for carrying includes concat, indexOf, charAt, replace, search, wherein, concat is by two or many
The text combination of individual character gets up, and returns to a new character string;Occur at a substring first in indexOf return strings
Index (from left to right search for), if without occurrence, returning to -1;CharAt returns to the character of specified location.Replace is used
To search one character string of regular expression of matching, the character string of matching is then replaced using new character strings;Search is performed
One matching regular expressions is searched, if searched successfully, the index value matched in return string otherwise returns to -1.
Further, the data resource thesaurus of multiple different types of data, the source generation are contained in the Resource Block
The data resource that code block need to be called is with the Type mapping of data in the multiple different types of data resource thesaurus.
Quickly development and application program is easily arranged and deletion data with follow-up for convenience, in the resource of application program
In block, the data resource thesaurus of multiple different types of data is distinguished, for storing different types of data, such as
Undefined, Null, Boolean, Number and String etc., are respectively stored in Resource Block, facilitate subsequent applications
When program is run, the method call database that the code described in source code block under information can be write by JavaScript language
In data, a such as database name is referred to as Undefined for storing the data of Undefined types, therefore in source code
When data described in block under information need to call the data of Undefined types, the data of entitled Undefined are first found
Storehouse, then the data of Undefined types are called out from database.
Further, also include for detecting the default language set by system where the application program in the description block
Detection block, for before the user interface is created, the application program is by the detection block detection system institute
The default language of setting, and language that the application program is shown in user interface and the acquiescence language set by the system
Speech is matched.
Application program also needs to include in the default language set by the correct display systems of interface energy under React-Native
One detection block, the effect of detection block is to be where application program is detected before application program creates user interface in system
The set default language of system, and the language that application program will be called is made with the default language set by system by detection block
Matched so that application program can show consistent for the default language set by system when user interface is created.
Specifically, under React-Native frameworks, application program default language according to set by system changes itself language
The code of speech is as follows:
It specifically writes language for JavaScript, after detection block detects the default language that system is set, passes through
Switch is matched the language of application program with system language, and wherein language values are to represent language, such as system language
During language=ZH (Chinese language), then in case ZH, language is the zh.js being equal under strings, now, should
The zh.js in strings is then called by string.js with program, the language by application program in user interface presentation is set
It is Chinese language, require () represents the language for needing to call, and the value in require suffix brackets is represented, passed through
String.js calls the zh.js under strings.
Further, the language description information in the default language set by the system and at least one description block
During mismatch, then using the preset language of the application program.
For the language parameter write in application program can be with the language of system during upper transfer language described previously
With success, preset value application program is provided in language with showing interface in system language and application program in the application
When language parameter matching under language description information in source block is unsuccessful, then the language that application program is shown on a user interface
Speech is the default language set by application program.
Specifically, such as predefined language of application program institute is Chinese language, i.e. zh.js, in system language and application
When language parameter matching under language description information in program resource block is unsuccessful, code, i.e. language as mentioned before
When value is not equal to any language of resource description block lower three kinds of language, then by the default in previously described code
Sentence, exports the Chinese language that application program is pre-seted in application program.
Preferably, the system code block is used to deposit the code of system operation where the application program, in order to institute
Stating system code can be modified to can be used to call the application program, and the application program is transported on the system
OK.
Because the system of the development platform of application program and its operation is inconsistent, therefore needed under React-Native
System code block, houses the code of the system that application program will be run in system code block, and its Main Function is can
System code is efficiently changed, changes the environmental variance of system, application program is designated system and call, and make application program
Can normally be run under appointing system.
Specifically, the application program for pointing to Android system is developed on windows platform as mentioned before, in order that
The application program developed on windows platform can normally be run on Android system, then need modification to refer in development platform
It is that the normal operation of application program constructs a ring for being available for operation to system code is changed on the system code block of Android system
The operation in border, as application program necessarily store empty on Android system by Android system code block for application program is provided
Between, and application program is started by code and end code by system code block can be merged with system code, application program is existed
Normally run on Android system.
Preferably, the system is Android system.
Android system occupies most mobile terminal market at present, therefore the common application program operation developed
Environmental system is Android system.
Preferably, the system is iOS system.
IOS system receives the ardent of consumer and pursues after developing, therefore ios is also application program fortune
One of capable goal systems.
Further, React-Native relies on the code and data that storehouse block is the storage React-Native operations
Bag.
As it was noted above, React-Native rely on storehouse block storage be React-Native operation code and data
Bag, its Main Function be application program operationally, it is necessary to depend on the operation of React-Native, can just carry out applying journey
The operation of sequence.Its own is the software of development and application program to React-Native, therefore possesses one in React-Native bottoms
Section code can normally run for its own in development and application program and later stage application program.React-Native as software,
In self-operating, in development and application program process and the normal operation of later stage application program can all produce certain data, directly
The data related to React-Native operations are stored in the packet that React-Native is relied under the block of storehouse, for the later stage
React-Native is run and/or other programs are called.
Specifically, such as React-Native relies on storehouse block itself occupies certain memory space, in React-Native
Run by code and produce more data, these data will be stored in the packet, so that React-Native operations make
With, data it is excessive when, can be empty to discharge storage by invalid data in other programs and/or the deletion packet of itself
Between continue store valid data, certainly, the deletion of data can also be the manual deletion of user.
Present invention also offers a kind of application program constructing apparatus, as shown in Fig. 2 including such as lower unit:
S10:Creating unit, the engineering structure for creating the application program is produced related to the engineering structure
Access information and description information;
React-native, as the framework for developing app, itself is exactly a application program, and be encapsulated into one
Software kit, need to successfully install it on a platform, and opening for application program could be carried out on the basis of React-native
Hair, for the ease of the exploitation of application program, can also install the software for supporting that the smooth development and application programs of React-native are subsidiary,
Installation its subsidiary program that succeeds will be stored under development platform terminal React-native predefined catalogue files folder,
After React-native is installed successfully on the platform of exploitation, creating unit S10 can create one in development platform terminal
The predefined catalogue file folders of React-native, contain the whole framework for development and application program and application program application
The code that the code and React-native of environment run in itself, Facebook increase income React-native when, i.e. Facebook
The language library for writing React-native development and application programs is created, allows its React-native by a set of language development
For the application program of different system, such as in iOS, Android, the application program developed can be applied to Android and ios systems it
On, and Facebook that the engineering structure of React-native is just predefined at the beginning of the React-native that increases income is flat in exploitation
Entitled " Helloword " shown on platform, the i.e. ground floor root of its predefined engineering structure is entitled
" Helloword ", namely the access information in React-native development platforms write by JavaScript code in advance
It is " Helloword " that developer clicks on " Helloword " can enter development and application program in React-native frameworks,
Wherein, " Helloword " may also be other titles replacement, such as " React-native ", into Helloword/React-
The basic description information under React-native frameworks is appeared in after native, specific basic description information content is entered later
Row is described in detail.
Specifically, exploitation is directed to the application program of Android system, it is necessary to flat in Windows for example under windows platform
The order for needing application program to be mounted to include Chocolatey, Python2, Node.js, Yarn, React Native on platform
Row instrument (react-native-cli), Android Studio, Chocolatey are the package managers on a Windows,
It is used to open command prompt window similar to the yum and apt-get, Python2 on linux, Node.js is used to provide one
One Javascript running environment, for easily build fast response time, be easy to extension network application, Yarn be for
Accelerate the download of node modules.The command-line tool of React Native is used to perform establishment, initialization, renewal item, operation
The tasks such as packaged service (packager), Android Studio contain what is run and test needed for React Native are applied
Android SDK and simulator.After all application programs are installed successfully, after installation, in the joyous of Android Studio
Meet and select Configure in interface | SDK Manager, and in SDK Platforms windows, select Show Package
Details, then chooses Google APIs, Android SDK Platform in Android 6.0 (Marshmal low)
23rd, Intel x86Atom System Image, Intel x86Atom_64System Image and Google APIs
Intel x86Atom_64System Image, in SDK Tools windows, select Show Package Details, then
Android SDK Build-Tools 23.0.1 are chosen in Android SDK Build Tools, is checked and is ensured
ANDROID_HOME environmental variances have been correctly directed to install the path of Android SDK, and now React-native exploitations should
Created successfully with the framework of program, after the successfully command-line tool of React Native is installed, creating unit S10 can pass through
React-native command-line tools are created as root the helloworld/React Native, helloworld/ of empty item
React Native are only the title of root, and helloworld/React Native are then under the framework of React-native
The access information of development and application program, includes by under helloworld/React Native roots after above-mentioned installation
The storage source life code and dependence storehouse of index.android.js System describes information, node_modules for React-native
Description information, the original framework helloworld/React Native of React-native are access information, and three collectively forms
React-native most basic engineering structure, that is to say the basic framework of React-native development and application programs, its tool
Body structure is as follows:
·react-native
οindex.android.js
οnode_modules
Wherein, index.android.js represents that the system that the application program after exploitation is applied is Android system,
Index.android.js can also be index.ios.js, represent that the system that the application program after exploitation is applied is ios systems
System.
S20:Replacement unit, the access information for retaining the engineering structure replaces with its of the initially described information many
Individual description block, each description block includes multiple description informations, thus updates original engineering structure;Description block described at least one
In, comprising multilingual description information;
When application development is carried out on the basis of React-native, it is necessary to retain React-native entrances in itself
Information, in order to correct entrance, and operation program can be found when application development is completed and run, ibid React-
Basic description information under native frameworks mainly includes the program of the system that the program of React-native exploitations will be run
The code and its self-operating of code and React-native application programs itself so the database for relying on, in order to more rapidly high
The development and application program of effect, replacement unit S20 original React-native itself in the case where React-native frameworks are retained
When operation code and system code description information, the operation code of original React-native itself and system code are described
Information is converted into block, while increase necessary programming in the more development and application program process of React-native, equally
It is description block to set it, in order to increase more description informations corresponding with the description block under description block, so as to change
Become original React-native engineering structures, in order to reduce in development process because system set language the reason for and cause
Application program, can be according to the different automatic conversion application programs of system language in user interface under the system environments of different language
The language for being shown, during application development is carried out, needs to be retouched comprising various language at least one description block
Information is stated, in order to carry out the conversion of application program language.
Specifically, exploitation is directed to the application program of Android system for example under windows platform, it is former in React-native
In some frame foundation, replacement unit S20 remains index.android.js description informations and node_modules description letters
Breath, and index.android.js description informations and node_modules description informations are converted into description block, while increased
Source code block src and resource description block resource, such as increased source generation under helloworld/React Native roots
Code block src and resource description block resource, and respectively under source code block src with resource description block resource increase is different
Description information under description information, source code block mainly includes the description information logic of application logic, and application program is being moved
The description information ui at dynamic terminal interaction interface, application program shows the description information widget of program in mobile terminal desktop, should
The description information R.js called with program resource.The description letter such as drawable, value, strings is contained in resource description block
Breath, stores multilingual description, such as zh.js, en.js, fr.js, wherein zh.js tables under strings description informations
Show Chinese language, en.js represents that English language, fr.js represent French language.
S30:Generation unit, for the application program in response to user instruction engineering structure of the generation comprising the renewal,
The application program is suitable to create its user interface with the engineering structure of the renewal, and the language that the user interface is used is
The default language set by system where the application program, and be limited at least one description block and the default language
The language description information being adapted.
Based on the React-native frameworks being made in above-mentioned replacement unit S20, developer develops on its basis
Application program, generation unit S30 need to be first passed through application program is generated or updated, and after generation or renewal,
The new application development frameworks based on React-native engineering structures are formed, is limited in replacement unit S20
A language description information is comprised at least in new React-native engineering structures, has been reduced because of language to reduce
The application program developed other countries utilization rate, the writable multilingual of description information of increased language, and should
The system language used with the application program developed is carried out correspondence by language, that is, the application program developed when mounted, can
Default language where detection set by system, the default language according to system determines that application program is shown under the system of place
Language, i.e. application program language shown in systems are the default language that system is set.
Specifically, application program of the exploitation based on Android system on for example above-mentioned windows platform again, in original React-
Source code block and resource description block are newly increased under native engineering structures, language description information have been included in resource description block,
After foregoing description block and description information is write, the engineering structure that generation unit S30 generations are made, generation includes source code
The framework of the React-native development and application programs of block and resource description block, and description information is also stored in source code block respectively
In resource description block, the description letter that developer can be under correspondence resource language block on the basis of new React-native frameworks
The lower write-in correspondence of the breath code related to application program operation, and referenced resource will be needed to be respectively written into source code block
In description information under resource description block, quick development and application program is realized, due to including language in resource description block
Speech description information, can write zh.js, en.js, fr.js etc. multilingual under language description information, make the application developed
When program is run in system, default language automatic conversion application program that can be according to set by system is shown in system
Language, such as application program detects that the default language set by system where it is Chinese, then application call resource
Zh.js under description block in language description information, the language for making application program be shown in system is Chinese language.
Further, the access information is predefined React-Native engineering structure titles.
Access information is the name of the general act folder of all engineering structures for having React-native development and application programs
Claim.
Specifically, as described above, access information is to be created as empty item by React-native command-line tools
Root helloworld/React Native, mean the title of file.
Further, the description block includes that the application program relies on storehouse, the dependence storehouse of React-Native and should answer
With the dependence storehouse of system where program.
Application program operationally, will depend on a certain dynamic base to run, therefore exist for the ease of developer
Program is quickly developed under React-Native, therefore increases the dependence of application program operation under React-Native frameworks
Storehouse, the description block under as increased React-Native in the original engineering structures of React-Native, has been contained
The dependence storehouse of React-Native, i.e. application program can just be carried out operationally, it is necessary to depend on the operation of React-Native
The operation of application program, the operation of React-Native then need to rely on and oneself construct and stored in React-Native
The description block of React-Native codes is described, system relies on specified application when storehouse is development and application program will under framework
The code of the system to be run, it is system code description block, and the system code description block is the dependence storehouse of system, and its is main
Effect is the code that system in system code description block can be called when program is run, and is that application program constructs one in systems
The environment of individual operation, allows application program normally to run in systems.
Further, wherein in a kind of implementation method, the replacement unit S20 includes:
S21:Writing module, for writing the description block, the description block at least source generation including the application program
Code block, Resource Block, system code block and React-Native rely on storehouse block, and at least described Resource Block includes the language and retouches
State information.
When application program is run, it is necessary to the component for including include source code, called for source code and store money
The Resource Block in source, make application program can on appointing system trouble-free operation storage system code system code block and application program
Access information operationally can be found and depend on the React-Native of the operation of React-Native to rely on storehouse block, that is, answered
With program operationally, it is necessary to depend on the operation of React-Native, the React- of application program operation can be just carried out
Native relies on storehouse block, in order to preferably arrange resource required when application program is run, language is at least included in Resource Block
Speech description information, therefore write at least including source code block, money by writing module S21 during the basic framework of Structural application program
Source block, system code block and React-Native rely on storehouse block etc., and at least described Resource Block includes the language description letter
Breath, for write-in to supply application program in the case where source code block, Resource Block, system code block and React-Native rely on storehouse block respectively
The code of operation.
Specifically, such as the design of following one section of development and application program on the basis of React-Native:
By writing module S21, source code block src, Resource Block resource are write under react-native frameworks, is
System code block index.android.js, React-Native rely on storehouse block node_modules, wherein, language description information is
Strings and string.js under Resource Block in resource, contained under strings language zh.js, en.js,
fr.js。
Further, the React-Native relies on the service logic that storehouse is React-Native operations.
React-Native relies on the service logic that storehouse is React-Native operations, and React-Native service logics are
Support the code and data of React-Native operations.
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, the code for storing the application program operation.
Logical description information is contained in source code block, it is application program to store developer by memory module S22
The code write of operation, set application program various properties in systems, application program is compiled according to developer
The code write is run, and has default property in systems, in source code block src in above-mentioned application programming
Logical description information is logic.
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, the code for storing the application program interactive interface displaying.
The interface description information included in source code, as UI, UI design makes man-machine interaction, operation of the finger to application program
The global design of logic, beautiful interface, not only includes the interface that interface shows in system, also light with interface including user
Free interaction.UI designs are not only and allow the application program to become to have the individual character have grade, also to allow the operation of application program to become
Obtain comfortably simple, free, fully demonstrate the positioning and feature of application program.Therefore in program process is developed, interface is
The key design of exploitation, in order that developer can be rapidly performed by the design at interface, therefore includes interface in source code block
Description information, and the code that application program interactive interface shows, such as source in above-mentioned programming are stored by memory module S22
Interface description information ui in code block src, certainly in interface description information, developer can also according to the need for oneself
Interface description information different code is divided in several times description information, interface as will be shown and man-machine in interface alternation
Process is stored respectively.
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, the code of plug-in unit is shown for storing the application program in terminal interface.
The application program of exploitation can be all stored in terminal with card format when not in use, in order to the use of user, be
Developer can the convenient design for carrying out plug-in unit, plug-in unit description information is included in source code block, by memory module S22
Make developer that application program can be targetedly write in plug-in unit description information and show the code of plug-in unit in terminal interface, and store
Interface description information widget in memory module S22, such as the source code block src in above-mentioned programming, and in widget
Under description information, the classification of information can be again described, it is more quick to be that plug-in code is write.
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, can obtain the Resource Block and be wrapped for the source code block by the resource description information
The resource for containing.
Memory module S22 can be additionally used in the resource that storage resource block is included, and by the resource description in source code block
Information, for calling the resource in Resource Block, the R.js in being source code block src during said procedure is designed, js is represented and is called money
The method that source is taken is the program in machine code of written in JavaScript, wherein specifying R=resource in bottom, then R.js then may be used
The type for calling the resource in resource, specific resource by the program in machine code of written in JavaScript is retouched later
State.
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, for storing the picture that source code block need to be called.
Type to resource in Resource Block has carried out subregion, its specifically can include picture description information, wherein when
Other kinds of description information can also so be included, picture description information can specifically regard a picture resource thesaurus, lead to
The all pictures involved by memory module S22 storage application programs are crossed, for example, can be stored that interface ui can be called and be needed to open up
Show picture in the terminal, the picture description information in its specific Resource Block resourece as in above-mentioned programming
Drawable, the type of picture can be dynamic gif, jpg, jpged etc..
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, for storing the numerical value that source code block need to be called.
Include the value description information for storing value type resource in Resource Block, being stored by memory module S22 should
With numerical value involved by program, the values in such as resource description block resource in above-mentioned programming, values storages
The numerical value value type such as including size class value, numeral numeral.
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, for storing the language parameter that source code block need to be called.
For the ease of application program different system country variant use, language description information there must be, wherein language
Speech description information is stored in memory module S22 in Resource Block with character object description information, can be carried out under character object
The storage of language, concrete syntax will be described in detail below, and language is used to be called by the R.js in source code block in character object,
Make application program by R.js the language stored in character object factory information can be called specifically to call in transfer language to exist
Summarized above.
Preferably, the character object description information include at least one language parameter, and the language parameter suffix
It is " .js ".
Be stored with language parameter under above-mentioned character object description information, for being called by the R.js in source code block, is
The R.js in source code block is set smoothly to call language parameter, therefore, the suffix of language parameter is " .js ", then R.js can lead to
It is the language parameter of " .js " to cross the method call suffix that JavaScript write, zh.js such as above in strings,
En.js, fr.js, wherein when language parameter is write, the system and national number that developer can use according to application program are write
Multiple language parameters.
Further, wherein in a kind of implementation method, as shown in figure 3, the replacement unit S20 also includes:
S22:Memory module, for storing the language parameter that source code block need to be called;
As it was noted above, containing character object description information in Resource Block, source code is stored by memory module S22
The language parameter that block need to be called, and source code block is when calling the language parameter in character description information, need to by certain method,
I.e. by the language parameter in function call character object description information, therefore also include calling in the resource description block
The functional blocks of the language parameter in character description information.
S23:Calling module, for calling the language parameter.
As it was noted above, calling module S23 is used to call language parameter of the storage in memory module S22, and source code
When block calls the language parameter in character description information by calling module S23, by described previously and hereinafter will describe in detail
Method is called.
Specifically, the string.js such as in programming above under Resource Block resource, wherein, string is pointed to
Zh, en, fr in strings etc., " .js " then for suffix for " .js " parameter, and " .js " language parameter storage storage
In module S22, thus shown at interface in conversion application language when, source code block passes through calling module S23 first
The method that lower JavaScript is write finds the string.js in resource from R.js, and string.js passes through again
The method that JavaScript is write finds the language parameter under strings, such as Chinese language zh.js, and calling module S23 is called
Zh.js and application program is Chinese in the Program transformation that interface is shown by the language transfer method write by JavaScript
Language.
Further, the function is js functions.
Previously described function is js functions, and js functions are the functional based method under JavaScript, in JavaScript
The specific function for carrying includes concat, indexOf, charAt, replace, search, wherein, concat is by two or many
The text combination of individual character gets up, and returns to a new character string;Occur at a substring first in indexOf return strings
Index (from left to right search for), if without occurrence, returning to -1;CharAt returns to the character of specified location.Replace is used
To search one character string of regular expression of matching, the character string of matching is then replaced using new character strings;Search is performed
One matching regular expressions is searched, if searched successfully, the index value matched in return string otherwise returns to -1.
Further, wherein in a kind of implementation method, the replacement unit S20 also includes:
S22:Memory module, the data resource for storing the multiple different types of data included in the Resource Block is stored
Storehouse, the data resource that the source code block need to be called is deposited with the Type mapping of data in the multiple different types of data resource
In bank.
Quickly development and application program is easily arranged and deletion data with follow-up for convenience, in the resource of application program
In block, the data resource thesaurus of multiple different types of data is distinguished, for storing different types of data, such as
Undefined, Null, Boolean, Number and String etc., are respectively stored in Resource Block, facilitate subsequent applications
When program is run, the method call database that the code described in source code block under information can be write by JavaScript language
In data, a such as database name is referred to as Undefined for storing the data of Undefined types, therefore in source code
When data described in block under information need to call the data of Undefined types, the data of entitled Undefined are first found
Storehouse, then the data of Undefined types are called out from database.
Further, wherein in a kind of implementation method, include in the generation unit S30:
S31:Detection module, the detection block for detecting the default language set by system where the application program, with
In before the user interface is created, the application program detects the acquiescence language set by the system by the detection block
Speech, and the application program is matched in the language that user interface is shown with the default language set by the system.
Application program is in the default language set by the correct display systems of interface energy, in addition it is also necessary to a detection module S31, inspection
The effect for surveying module S31 is to be detected set by system where application program before application program creates user interface in system
Default language, and the language that application program will be called is entered with the default language set by system by detection module S31
Row matching so that application program can show consistent for the default language set by system when user interface is created.
Specifically, under React-Native frameworks, application program default language according to set by system changes itself language
The code of speech is as follows:
It specifically writes language for JavaScript, after detection module S31 detects the default language that system is set,
The language of application program is matched with system language by switch, wherein language values are to represent language, such as system
During language language=ZH (Chinese language), then in case ZH, language is the zh.js being equal under strings, this
When, application program then calls the zh.js in strings by string.js, by application program user interface presentation language
Chinese language is set to, require () represents the language for needing to call, and the value in require suffix brackets is represented, passed through
String.js calls the zh.js under strings.
Further, the language description information in the default language set by the system and at least one description block
During mismatch, then using the preset language of the application program.
For the language parameter write in application program can be with the language of system during upper transfer language described previously
With success, preset value application program is provided in language with showing interface in system language and application program in the application
When language parameter matching under language description information in source block is unsuccessful, then the language that application program is shown on a user interface
Speech is the default language set by application program.
Specifically, such as predefined language of application program institute is Chinese language, i.e. zh.js, in system language and application
When language parameter matching under language description information in program resource block is unsuccessful, code, i.e. language as mentioned before
When value is not equal to any language of resource description block lower three kinds of language, then by the default in previously described code
Sentence, exports the Chinese language that application program is pre-seted in application program.
Preferably, the system code block is used to deposit the code of system operation where the application program, in order to institute
Stating system code can be modified to can be used to call the application program, and the application program is transported on the system
OK.
Because the system of the development platform of application program and its operation is inconsistent, therefore needed under React-Native
System code block, houses the code of the system that application program will be run in system code block, and its Main Function is can
System code is efficiently changed, changes the environmental variance of system, application program is designated system and call, and make application program
Can normally be run under appointing system.
Specifically, the application program for pointing to Android system is developed on windows platform as mentioned before, in order that
The application program developed on windows platform can normally be run on Android system, then need modification to refer in development platform
It is that the normal operation of application program constructs a ring for being available for operation to system code is changed on the system code block of Android system
The operation in border, as application program necessarily store empty on Android system by Android system code block for application program is provided
Between, and application program is started by code and end code by system code block can be merged with system code, application program is existed
Normally run on Android system.
Preferably, the system is Android system.
Android system occupies most mobile terminal market at present, therefore the common application program operation developed
Environmental system is Android system.
Preferably, the system is iOS system.
Ios systems receive the ardent of consumer and pursue after developing, therefore ios is also application program fortune
One of capable goal systems.
Further, React-Native relies on the code and data that storehouse block is the storage React-Native operations
Bag.
As it was noted above, React-Native rely on storehouse block storage be React-Native operation code and data
Bag, its Main Function be application program operationally, it is necessary to depend on the operation of React-Native, can just carry out applying journey
The operation of sequence.Its own is the software of development and application program to React-Native, therefore possesses one in React-Native bottoms
Section code can normally run for its own in development and application program and later stage application program.React-Native as software,
In self-operating, in development and application program process and the normal operation of later stage application program can all produce certain data, directly
The data related to React-Native operations are stored in the packet that React-Native is relied under the block of storehouse, for the later stage
React-Native is run and/or other programs are called.
Specifically, such as React-Native relies on storehouse block itself occupies certain memory space, in React-Native
Run by code and produce more data, these data will be stored in the packet, so that React-Native operations make
With, data it is excessive when, can be empty to discharge storage by invalid data in other programs and/or the deletion packet of itself
Between continue store valid data, certainly, the deletion of data can also be the manual deletion of user.
The present invention also provides a kind of terminal, including processor, and the processor is used to operation program perform described application
Each step of program constructing method, for example:Exploitation is directed to the application program of Android system on above-mentioned windows platform, first
First installing React-Native runs softwares and its is used to develop other bundled softwares for Android application program, such as
Command-line tool of Node.js, Android Studio, React Native etc., by the order line of React Native
Instrument is pressed from both sides under (such as Helloword) in predefined catalogue file, increases source code block and resource description block, and each description block
It is lower comprising multiple description informations, in containing the description block described at least one in wherein at least one description block, comprising various
Logic, ui, widget, R.js are included under language description information, such as source code block, support application is contained under each description block
The code of normal program operation, includes drawable, value, strings, string.js under resource description block, retouched in language
Stating the language parameter included under information strings includes zh.js, en.js, fr.js, changes system code block
The environment that code in index.Android.js is created for application program operation, the generation instruction according to user, by above-mentioned knot
Structure generates a software kit for application program, and when using the software, application program detects application program by detection module S31
Default language set by the system of place, and passed through the language ginseng under switch sentences and application program language description information
Number is matched, and is the default language of system by application program language shown on a user interface.
Further, the processor of the present embodiment can also realize other steps of the method for above-described embodiment, processor
Specific effect and implementation can be found in the embodiment of above method part, will not be described here.
Those skilled in the art of the present technique are appreciated that this method creates multiple description block generations one under React-native
The individual new application program tectonic framework based on React-native, can deposit multiple description informations under each description block, retouch
State the code of the confession application program operation for housing corresponding with description information under information, and retouching at least one description block
State and contain language description information in information, multiple language parameters can be deposited under language description information, can for application program
Adapt in the system of different language, and language need not be adjusted again after application program is installed, or developer exists
During development and application program, according to the difference of system language where application program, exploitation is multiple with identical function and property, but
The different application program of the same race of language, the new application framework based on React-native reduces the difficulty of developer
Degree, improves development efficiency, those skilled in the art of the present technique be appreciated that these computer program instructions can be supplied to it is logical
Realized with the processor of computer, special purpose computer or other programmable data processing methods, thus by computer or its
The processor of his programmable data processing method come perform structure chart disclosed by the invention and/or block diagram and/or flow graph frame or
The scheme specified in multiple frames.The processor can perform the operational order of any the present embodiment.
Those skilled in the art of the present technique are appreciated that in various operations, method, the flow discussed in the present invention
Step, measure, scheme can be replaced, changed, combined or deleted.Further, it is each with what is discussed in the present invention
Other steps, measure in kind operation, method, flow, scheme can also be replaced, changed, reset, decomposed, combined or deleted.
Further, it is of the prior art with various operations, method, the flow disclosed in the present invention in step, measure, scheme
Can also be replaced, changed, reset, decomposed, combined or deleted.
The above is only some embodiments of the invention, it is noted that for the ordinary skill people of the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of application program building method, it is characterised in that comprise the following steps:
The engineering structure of the application program is created, access information and the description information related to the engineering structure is produced;
Retain the access information of the engineering structure, its of the initially described information is replaced with into multiple description blocks, each description block bag
Containing multiple description informations, original engineering structure is thus updated;In description block described at least one, describe to believe comprising multilingual
Breath;
In response to user instruction generation comprising the renewal engineering structure application program, the application program be suitable to it is described more
New engineering structure creates its user interface, the language that the user interface is used, the system institute where the application program
The default language of setting, and it is limited to the language description information being adapted with the default language at least one description block.
2. application program building method according to claim 1, it is characterised in that the access information is predefined
React-Native engineering structure titles.
3. application program building method according to claim 1, it is characterised in that the description block includes the application journey
Sequence relies on the dependence storehouse for relying on system where storehouse and the application program of storehouse, React-Native.
4. application program building method according to claim 1, it is characterised in that the description block at least include it is described should
Storehouse block is relied on the source code block of program, Resource Block, system code block and React-Native, and at least described Resource Block is included
Predicate says description information.
5. the application program building method according to claim 3 or 4, it is characterised in that the React-Native is relied on
Storehouse is the service logic of React-Native operations.
6. a kind of application program constructing apparatus, it is characterised in that including such as lower unit:
Creating unit, the engineering structure for creating the application program produces the access information related to the engineering structure
And description information;
Its of the initially described information is replaced with multiple description blocks by replacement unit, the access information for retaining the engineering structure,
Each description block includes multiple description informations, thus updates original engineering structure;In description block described at least one, comprising many
Plant language description information;
Generation unit, for the application program in response to user instruction engineering structure of the generation comprising the renewal, this applies journey
Sequence is suitable to create its user interface, the language that the user interface is used, for this applies journey with the engineering structure of the renewal
The default language set by system where sequence, and it is limited at least one description block what is be adapted with the default language
Language description information.
7. application program constructing apparatus according to claim 6, it is characterised in that the access information is predefined
React-Native engineering structure titles.
8. application program constructing apparatus according to claim 6, it is characterised in that the description block includes the application journey
Sequence relies on the dependence storehouse for relying on system where storehouse and the application program of storehouse, React-Native.
9. application program constructing apparatus according to claim 6, it is characterised in that the replacement unit includes:
Writing module, for writing the description block, the description block at least source code block, resource including the application program
Block, system code block and React-Native rely on storehouse block, and at least described Resource Block includes the language description information.
10. a kind of terminal, it is characterised in that including processor, the processor is used for any one institute in perform claim requirement 1-5
The application program building method stated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710042545.2A CN106873989A (en) | 2017-01-20 | 2017-01-20 | Application program building method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710042545.2A CN106873989A (en) | 2017-01-20 | 2017-01-20 | Application program building method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106873989A true CN106873989A (en) | 2017-06-20 |
Family
ID=59158518
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710042545.2A Pending CN106873989A (en) | 2017-01-20 | 2017-01-20 | Application program building method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106873989A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108132822A (en) * | 2017-12-13 | 2018-06-08 | 明算科技(北京)股份有限公司 | User interface element internationalization processing method and processing device |
CN109445771A (en) * | 2018-10-25 | 2019-03-08 | 北京和普威视科技股份有限公司 | A kind of off line network layers block code Auto-Generation Tool of CS framework and method |
CN110580147A (en) * | 2018-06-07 | 2019-12-17 | 阿里巴巴集团控股有限公司 | application program development method and device |
CN111488140A (en) * | 2019-01-29 | 2020-08-04 | 杭州海康威视数字技术股份有限公司 | Method and device for supporting multiple programming languages and multiple programming libraries and computer equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1928813A (en) * | 2006-09-22 | 2007-03-14 | 华为技术有限公司 | Translation method and system for man/machine interaction interface of application program |
CN101114226A (en) * | 2007-08-28 | 2008-01-30 | 北京中企开源信息技术有限公司 | Code automatically generating device based on model component, system and method |
US20140122061A1 (en) * | 2007-06-29 | 2014-05-01 | Microsoft Corporation | Regular expression word verification |
CN104199662A (en) * | 2014-09-01 | 2014-12-10 | 浪潮电子信息产业股份有限公司 | Multi-language supporting technology suitable for FLEX project |
CN105404508A (en) * | 2015-11-05 | 2016-03-16 | 浪潮(北京)电子信息产业有限公司 | Management interface multi-language supporting method and apparatus and terminal |
-
2017
- 2017-01-20 CN CN201710042545.2A patent/CN106873989A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1928813A (en) * | 2006-09-22 | 2007-03-14 | 华为技术有限公司 | Translation method and system for man/machine interaction interface of application program |
US20140122061A1 (en) * | 2007-06-29 | 2014-05-01 | Microsoft Corporation | Regular expression word verification |
CN101114226A (en) * | 2007-08-28 | 2008-01-30 | 北京中企开源信息技术有限公司 | Code automatically generating device based on model component, system and method |
CN104199662A (en) * | 2014-09-01 | 2014-12-10 | 浪潮电子信息产业股份有限公司 | Multi-language supporting technology suitable for FLEX project |
CN105404508A (en) * | 2015-11-05 | 2016-03-16 | 浪潮(北京)电子信息产业有限公司 | Management interface multi-language supporting method and apparatus and terminal |
Non-Patent Citations (1)
Title |
---|
霍华德: "在React项目中使用React-intl实现多语言支持", 《HTTPS://SEGMENTFAULT.COM/A/1190000005824920》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108132822A (en) * | 2017-12-13 | 2018-06-08 | 明算科技(北京)股份有限公司 | User interface element internationalization processing method and processing device |
CN110580147A (en) * | 2018-06-07 | 2019-12-17 | 阿里巴巴集团控股有限公司 | application program development method and device |
CN109445771A (en) * | 2018-10-25 | 2019-03-08 | 北京和普威视科技股份有限公司 | A kind of off line network layers block code Auto-Generation Tool of CS framework and method |
CN111488140A (en) * | 2019-01-29 | 2020-08-04 | 杭州海康威视数字技术股份有限公司 | Method and device for supporting multiple programming languages and multiple programming libraries and computer equipment |
CN111488140B (en) * | 2019-01-29 | 2023-10-27 | 杭州海康威视数字技术股份有限公司 | Method, device and computer equipment for supporting multiple programming libraries in multiple programming languages |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107491329B (en) | Docker mirror image construction method, device, storage medium and electronic device | |
CN105487864B (en) | The method and apparatus of Code automatic build | |
CN108762743B (en) | Data table operation code generation method and device | |
Moore | Python GUI Programming with Tkinter: Develop responsive and powerful GUI applications with Tkinter | |
CN105354013A (en) | Application interface rendering method and apparatus | |
CN106873989A (en) | Application program building method and device | |
US20200057654A1 (en) | Method and system for mirror image package preparation and application operation | |
Deitel et al. | C# 2012 for Programmers | |
US20190303115A1 (en) | Automated source code sample adaptation | |
CN113064593B (en) | Method and device for dynamic mobile APP, computer equipment and storage medium | |
CN115480801A (en) | Multi-project development, deployment and operation method and system based on Vue framework | |
US10474482B2 (en) | Software application dynamic linguistic translation system and methods | |
CN114036443A (en) | Page generation method and device | |
CN113986257A (en) | Cloud platform front-end management interface deployment method and device and storage medium | |
CN114489647A (en) | Method, device, equipment and medium for building small program in modular mode | |
Uluca | Angular for Enterprise-Ready Web Applications: Build and deliver production-grade and cloud-scale evergreen web apps with Angular 9 and beyond | |
Del Sole | Microsoft computer vision APIs distilled: Getting started with cognitive services | |
Moore | Python GUI Programming with Tkinter: Design and build functional and user-friendly GUI applications | |
CN114217789A (en) | Function component expansion method, device, equipment, storage medium and program product | |
CN115113850A (en) | Cross-platform application construction and operation method, server, terminal and system | |
Del Sole | Microsoft computer vision apis distilled | |
Lewis et al. | Native mobile development: a cross-reference for iOS and Android | |
CN112835568A (en) | Project construction method and device | |
KR20040103497A (en) | Method and apparatus for generating a graphical user interface | |
EP4042272A1 (en) | User interface generation |
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 |
Application publication date: 20170620 |
|
RJ01 | Rejection of invention patent application after publication |