Universal App with Visual Studio 2015 tools for Apache Cordova – Android Distribution

Practical steps to create universal app with VS2015. Based on the oryginal post by Authored by Norm Estabrook with contributions from Raghav Katyal, Mikejo5001, rido-min,Linda Z with comments.

Before starting the process, make sure that VS has the latest updates.

Create new app

Use VS2015 wizard to create blank application

Note! Make sure there are no blank spaces in the project’s location!

Package the Android version of your app

In this section:

  • Modify the settings of your app.
  • Generate a private key.
  • Refer to that key in a configuration file.
  • Create the package.

Step 1: Modify the settings of your app

The general settings of your app appear in the Common page of the configuration designer.

  • The Display Name is the name that appears in the app store.
  • The Package Name is a string that uniquely identifies your app.

    Choose a naming scheme that reduces the chance of a name conflict.

  • The Domain Access collection lists the domains that your app needs to access.

    For example, the WeatherApp that appears in the previous image, obtains weather data from a service endpoint that has the domain https://query.yahooapis.com.

The purpose of most other settings clear from the title, but you can find more information about them here: The config.xml File.

Android-specific settings appear in the Android tab of the configuration designer.

You can read about each option in the preference section of the config.xml reference topic.

Step 2: Generate a private key

To sign your app, create a keystore. A keystore is a binary file that contains a set of private keys. Here’s how you create one.

  1. Open a Command Prompt in administrator mode.
  2. In the Command Prompt, change directories to the %JAVA_HOME%\bin folder.

    (For example: C:\Program Files (x86)\Java\jdk1.7.0_55\bin).

  3. In the Command Prompt, run the following command.
  4. keytool -genkey -v -keystore c:\my-release-key.keystore -alias johnS


  5. Plain Text>Plain Text>-keyalg RSA -keysize 2048 -validity 10000

    Replace my-release-key.keystore and johnS with names that make sense to you.[/code][/code]

  6. Plain Text>Plain Text>Plain Text>You'll be asked to provide a password and the Distinguished Name fields for your key.
    This series of responses gives you an idea of the kinds of information you'll provide for each prompt. Like in the previous command, respond to each prompt with information that makes sense for your app.
    Plain Text>Enter keystore password: pwd123

    Plain Text>Re-enter new password: pwd123
    [/code]PHP>What is your first and last name?
    [/code]PHP>[Unknown]= John Smith
    [/code]PHP>What is the name of your organizational unit?
    [/code]PHP>[Unknown]= ABC
    [/code]PHP>What is the name of your organization?
    [/code]PHP>[Unknown]= XYZ

    Plain Text>PHP>What is the name of your of your City or Locality?
    PHP>[Unknown]= Redmond
  7. Plain Text>Plain Text>key.alias=johnS


  8. Plain Text>[/code]
  9. Plain Text>Plain Text> "android": {


  10. Plain Text>Plain Text>Plain Text>Plain Text>     "release": {


  11. Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>         "keystore":"c:\\my-release-key.keystore",


  12. Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>Plain Text>         "storePassword":"pwd123",
  13. Plain Text>Plain Text>Plain Text>         "alias":"johnS",
  14. Plain Text> "password":"pwd123",
  15. "keystoreType":""
  16. }
  17. }
  18. }

Step 4: Create the package

  1. On the Standard toolbar, choose the Android platform.
  2. Choose the Release build configuration.
  3. Choose one of the Android emulators.


    Important: Don't choose any of the Ripple simulators. Choose only an Android emulator or the Device.

  4. On the Build menu, choose Build Solution.

    This builds a file with an .apk file extension. That is the file that you'll upload to the store.

    You can find that file in the bin/Android/Release/ folder of your project.

    It's the file that does not contain the word unaligned in the file name.

Submit your app to the store

You can publish your app to Google Play.

To prepare for the big day, review Essentials for a Successful App.

Then, see Upload an app to make your app avaialable to the world.