Dry goods tutorial | APICloud novice learning experience sharing

Recently, many developers who love to learn have left a message to Youzi Jun in the background to ask: How to create an app on the APICloud platform? How to add modules? After the custom loader is compiled, how to synchronize in the studio and other issues.



You Zijun will take this opportunity to share with you the learning experience of a novice developer who has a little understanding of js and front-end (don't underestimate the novice, the dry goods you share will definitely be pleasantly surprised), mainly explaining an example of a login page and encounters in debugging. The problem. The project structure in charge of the sharer is roughly ApiCloud+Asp.Net MVC, and the sharing is as follows:



1. To create a demo for the first time, first



follow the official website tutorial, log in to https://www.apicloud.com/, create an application after registration, and perform the terminal Settings, certificate settings (note that the name has been generated by the system here), module settings (several official modules and existing custom modules can be added), and finally cloud compilation.



After that, go to the official website to download the local compilation tool APICloud Studio (under "Development Tools" on the official website). After installation, you can find the project you started to create from the SVN of "Cloud Repository". After checking it out, go to "My app project" can be seen in. Afterwards, you can independently create or modify the startup page in the appropriate project directory (assumed to be index.html), and then set it in config.xml (note that it is in the "source" instead of the "editor" tab), the widget's The id attribute can be obtained in the system overview of the cloud platform, and the src attribute of content is used to specify the startup page.



After that, the modified compilation can be used to connect the computer with an Android tablet (the driver is required, in fact, some mobile assistant software can be installed, such as Jinshan Assistant, 360 Mobile Assistant or Pea Pod). The experience of the sharers here is: in addition to the modifications that must be compiled in the cloud (such as adding official modules, custom modules, terminal configuration, etc. [which modifications require cloud compilation, there are instructions in the official documents], after the modification, cloud compilation is required, and then In studio "resource synchronization", "compile custom Loader" [this step is required for custom modules], and finally "real machine synchronization") other than modification (such as modifying the startup page html file), if you want it to take effect, After modification, it can be directly synchronized with the real machine (Ctrl+R).



2. Use an emulator (when there is no Android test device such as a tablet or mobile phone)



that is compatible with APICloud. It is said on the Internet that there are Haima, Ye Shen, etc., you need to find the location of APICloud's adb.exe first, and then run it under cmd [ adb connect to server address] command; but in fact, for example, after installing Hippocampus v0.10.5, you can directly synchronize the USB real machine in APICloud without any setting operation. [But although the resolution of the simulator can be adjusted, it can't be displayed completely, so I gave up; I heard that the night god simulator seems to be able to do it, but I didn't try it.]



Third, the Android device (APICloud Studio) joint debugging server (vs2015, IIS) once If you encounter problems



❶ Before debugging, you can use the ping tool on the Android machine to ping the ip of the server, which is a prerequisite for successful joint debugging. The firewall of the sharer win10 seems to block ping every time it restarts, and it has been pitted.



❷ If you want to debug the webpage on the Android device in Chrome, you can open chrome://inspect/#devices in Chrome under the premise of FQ (you can search and download XX-Net if you want to save trouble), you can display the current connection The relevant page Url in the app of the Android machine, click "inspect" to view and debug in Chrome.



2.png





❸ On the index page, after logging in successfully, set the page Url of the server-related business to be accessed by reading the parameters.



The official fs module is used here (for storing files that record some parameters, the related methods of this module can refer to the official



documentation), the main functions are as follows:



Xiaobai, sometimes looking at other people's code but finds that the relevant function definitions in question cannot be found in the official website documentation... Later, if you look closely, you need to first find out what the current method is for (for example, for API objects [ The format is similar to api.xxx], related equipment, module methods [commonly used modules should be db, zip and fs], APICloud front-end framework [format similar to $api.xxx]), and then it is easy to enter the corresponding page from the entrance of the official website document directory , and search again. (The sharer has collected these categories into his own documents. With the help of tools such as Evernote, it will be more convenient to retrieve.)



The above is the sharing of the APICloud moderators. An encouragement! If you have your own learning experience, please share!



APICloud novice teaching video can go to APICloud official website for free learning.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326118116&siteId=291194637