Vs2015-cordova Development of Android application environment construction

Source: Internet
Author: User

Before I saw the use of HTML5+CSS+JS can develop cross-platform applications, and then found that there is a Cordova project in vs2015 so want to try, but not so smooth. Just started on the Android environment do not know, Baidu search everywhere. Finally succeeded.

First of all

1, Cordova must be selected.

(When selected, many other options will be selected automatically, such as Git at the bottom of the generic tool will be selected automatically, and can be canceled if not.) Also, Windows PHONESDK and Windows Universal apps are also automatically selected)

2, vs Emulator for Android also to be selected.

3. The options under common tools and software development kits are selected in addition to the first one.

Then there is the long installation .....

After the installation is successful,

Look at the VS Emulator first.

The default looks like there are 3 download good, you can run directly, and then download the following do not have their own choice of the appropriate simulator to download it good,

It is best to install a 1G simulator within 4G of computer memory.

(To run this software with administrator privileges, or download the emulator, you will be prompted with insufficient permissions similar to the prompt.) )

And then open the Android SDK

After opening to set up, or the network will not get to the Android version list, error.

1. Open here

2, fill in the value and the same: mirrors.neusoft.edu.cn

(This software should also be run with Administrator privileges)

Once set up, you can normally get the following:

(then select an Android version and click on the Install button in the lower right corner ...) )

Then the VS debug will appear in the vsemulator you have installed the simulator

Then simply say Cordova project.

I'm doing a web app with a set of browser shells.

Open index.html

Do not know how, the following paragraph in index is not commented out, write the JS code does not work, so I commented out.

<!--<meta http-equiv= "Content-security-policy" content= "default-src ' self ' data:gap:https://ssl.gstatic.com ' Unsafe-eval '; Style-src ' self ' unsafe-inline '; MEDIA-SRC * ">-->

Then also install the corresponding plug-in as follows:

If you do not install this plugin, the open link will jump to the system's own browser.

Then add the following JS code to the index.html:

I also first contact this, I opened this will first enter the Index.html page (can be a welcome interface), and then do the JS open internal browser method.

Pressing the Back button to launch an internal browser will eventually fall back to index.html, so the way I find out is to exit the app directly when exiting the internal browser.

    <script>    Document.addeventlistener ("Deviceready", Ondeviceready, false);    function Iabclose (event) {          navigator.app.exitApp ();//exit the app directly or push it to the index page.         Iabref.removeeventlistener (' exit ', iabclose);    }    function Ondeviceready () {         iabref = window.open (' http://www.baidu.com ', ' _blank ', ' location=no,toolbar=no ');// Toolbar value of No to hide the browser navigation bar       }    </script>  

  

It seems so much, there is no wrong to tell me.

Vs2015-cordova Development of Android application environment construction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.