Write a fun app in ten minutes

nonsense

For app development, it is no longer only Android and ios that can be developed. A front-end programmer can easily get an app. Of course, there are many methods,
such as the react native (react native) used a few years ago. Grammar), uniapp (vue, small program grammar), flutter (dart language), which has been popular in the past two years, and various apps with embedded H5, etc.

text

This article uses uniapp to implement a Truth or Dare app, and manually define the content by yourself, ps: Then in the interview, I can brag about the development of hybrid apps, haha

ready

1. Download the HBuilder development tool, go to download
Insert picture description here
2. Open HBuilder X, select file -> new -> project -> uniapp -> default template, click to run, browser, built-in browser, mobile phone (there are tutorials, link to mobile phone, package App, it will be automatically installed on the phone), small programs are fine, personally choose the external chrome browser
Insert picture description here
3. Create a new success, start development, there are probably three buttons below, truth, big adventure, settings, create a few first File, just find a few icons to recommend iconfont and do the following tabBar icon
Insert picture description here

page.json add tabBar (that is, common applet development configuration) api

Insert picture description here
Result
Insert picture description here
4. The plug-in market finds suitable plug-ins to write code (keywords, lotteries, turntables, etc.).
Insert picture description here
Because they don’t see the right ones, they can’t display them because they have too much content. So change it yourself. The turntable only displays the name. Corresponding details in the description

5. Add a setting and customize content.
Insert picture description here
Since there is no server and no interface, the data can only be cached locally.

6. Package (installed as an example, ios is a bit more troublesome)
Click Release —> Native App Cloud Package, enter the package name, use the public test certificate,
Insert picture description here
and then you may be prompted that manifest.json is not configured, just click in and
Insert picture description here
get the appid Fill in the package name, of course, you can also set the app logo, you can also insert advertisements, push messages, etc., research on your own, and then click again, release —> native app cloud packaging —> package, wait, open the location, install it
Insert picture description here

notes

1. If you want an app plug-in, you must support the app, you can see in the plug-in details
2. This article supports apps or can be packaged into small programs, etc.
3. The local localstore cache must follow the uniapp syntax (small program writing), Cannot use h5 writing, otherwise it will not take effect after packaging

The apk package has been placed in personal resources and is free to download

github

uniapp official website
uniapp

Guess you like

Origin blog.csdn.net/weixin_44314258/article/details/115083568