In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to encapsulate HTML into APP", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how to encapsulate HTML into APP" this article.
1. Android is used for testing here to ensure that the Java and Android environments are OK.
2. Start the platform. My platform is implemented by Django+python. So start the service first.
Note: to start the service here, you are required to use an IP address other than 127.0.0.1. I found that if I used it, the link could not be opened on the phone (on the same LAN). I used ifconfig to check the local IP address, using python manage.py runserver * (* represents your IP address, as well as a non-collision port number).
3. Fill in the address in the Android project you built.
4. Create an Android project and use webview to display the web page.
Newly built
Fill in the name yourself.
Version
If you choose the version of SDK, you can also check the coverage of the version, which does not require a direct default.
Blank activity
Select the blank activity here.
Fill in the name
The name is customized here.
5. Open the MainActivity.java program file and add the following to the onCreate () method:
Import android.support.v7.app.AppCompatActivity
Import android.os.Bundle
Import android.webkit.WebView;?
Public class MainActivity extends AppCompatActivity {??
@ Override
Protected void onCreate (Bundle savedInstanceState) {?
Super.onCreate (savedInstanceState);?
SetContentView (R.layout.activity_main);?
WebView wv = (WebView) findViewById (R.id.wv)
Wv.loadUrl ("*")
}
}
If you report an error here, you need to modify the version in gradle, * for your address.
6. Open AndroidManifest.xml and set to allow programs to access the Internet:
Xml version= "1.0"? encoding=" utf-8 "? >
7. Connect a real machine or a virtual machine to run the test.
Desktop display
Virtual display
There is no adaptation here, so the presentation is a little out of shape.
8. Export Android to apk
Using Android Studio with its own build, just choose build apk.
The above is all the contents of the article "how to encapsulate HTML into APP". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.