Tips, Tutorials, Resources for Web Design and Online Marketing

Main Menu

  • Mobile App Development
    • App Tutorials
    • App Reviews
  • Website Guides
  • Small Businesses & Startups
  • News
  • Guest Posts
  • About
    • Mobile App Development Company Delhi, India
    • Mobile App Development Company Gurgaon
    • Mobile App Development Company Dallas, Florida
    • Website Design Company Delhi
    • WordPress Website Development Company

Tips, Tutorials, Resources for Web Design and Online Marketing

Header Banner

Tips, Tutorials, Resources for Web Design and Online Marketing

  • Mobile App Development
    • App Tutorials
    • App Reviews
  • Website Guides
  • Small Businesses & Startups
  • News
  • Guest Posts
  • About
    • Mobile App Development Company Delhi, India
    • Mobile App Development Company Gurgaon
    • Mobile App Development Company Dallas, Florida
    • Website Design Company Delhi
    • WordPress Website Development Company
  • 10 Tips To Grow Your Online Business

  • How to Choose the best custom software development companies in India ?

  • 7 Tasks to Complete before Starting Your Website Development Project

  • Online Marketing Tips and Productivity Tools for Small Businesses during Coronavirus

  • Tutorial 2: Which type of website does your business need ?

Mobile App DevelopmentMobile App Tools
Home›Mobile App Development›Creating your First Phonegap application

Creating your First Phonegap application

By Umesh Sethi
March 12, 2018
4480
0

Assumptions: Usage of the command-line interface (CLI) is clear, PhoneGap has already been installed.

Creating a new application

1. Let’s create our first application called HelloWorld with:
phonegap create HelloWorld
A: It should print the following response:
Creating a new cordova project.

2. The next step is to go into the project with:
cd HelloWorld
3. If you list the content of the directory:
ls -l
It should print the following directory structure for your new PhoneGap
project.

We see four different directories and a config.xml file for setting up a
specific configuration for the application in general or for a specific platform.
Let’s run it to see how your first application looks; later, we will explore what
each of the directories means and how to use them.
phonegap run android

Note: Don’t worry if you haven’t added Android platform support before running
it on Android; it does all this automatically. Here is a printout of all the
actions it takes:

4. If you previously carried out the setup procedure, after a short moment you
should see the following screen on the Android emulator

Phonegap rendered  Hello  World

If you Open the root folder of the project in your favorite text editor and open the www/index.html file.
You will HTML code with css and Javascript files called in the html.

One of the javascript file linked to this html controls the changes i.e index.js. There is also the cordova.js file. Every application needs to load the cordova.js file first, if you want to use PhoneGap’s plugin API; as it provides events when it is ready to use them.

Options when creating a new PhoneGap Project

What you saw above is a very simple example of how a phonegap project was created with minimum options. However there are many options and alternatives provided when creating the project in the following format:

phonegap create [options] [id] [name] [config]

Let’s go over the most important parameters, as follows:

• options: There are few available options to fine tune our new project:
°° –name : It specifies the application name.
°° –id : It specifies the package name ID. If this is missing, it defaults to com.phonegap.hello-world. It should follow a similar reverse domain name notation for the package ID.

°° –template : By providing the name of the template, PhoneGap will create a new project from that template.
°° –copy-from : It will create a new project by copying the whole file structure of an existing PhoneGap application that can be modified and edited without changing the original project. This is useful if you have a boilerplate project prepared for your favorite stack of tools that you are using in the project.
°° –src : It does the same thing as the copy-from parameter.
°° –link_to : The link_to parameter links the new project to another project that already has a working code. This is useful if you want to try out new configurations or change the settings in any of the platforms without the worry that you might break something and need to rebuild it from the beginning for a specific platform.
• id: It is just shorthand writing for the options ID setting.

• name: It is just shorthand writing for the options name setting.
• config: It provides you with the ability to pass a JSON string with additional
settings that will be injected into ./.cordova/config.json file.

Here are some examples of how to use the Phonegap project creation command with Options

Task: To create an application with the PhoneGap Essentials name in the essentials directory and the com.phonegap-essentials package ID

phonegap create essentials --name "PhoneGap Essentials" --id "com.phonegap-essentials"

Task: To make a copy of the existing application with a new package ID named com.phonegap-advanced, you can copy the existing application in it.
phonegap create advanced —id "com.phonegap-advanced" —copy-from ./essentials

Managing Platforms when Creating a Project

Creating a new project is pretty much empty and it does not do a lot until you specify which platforms you would like your application to support; thus, we need to add each platform separately. (iOS, Android, Blackberry, Symbian OS etc.)

All the commands to manage the platform have in common the start of the command:
phonegap platform

NOTE: All commands should be run in the root folder of the PhoneGap project to be able to work, except the command to create a new PhoneGap project, which can be run anywhere.
Let’s see a couple of examples:
phonegap platform add ios android – This adds two platforms
phonegap platform list – Lists the platforms

That’s it for now , for creating a new Simple Phonegap application. We’ll talk about this further in our next tutorial which is continuation and about BUILDING and RUNNING THE Application.

You can check out our PhoneGap App development Services from India and find out more if you’re looking to get a Cross Platform app built.

Tagsphonegaptutorial
Previous Article

Amazon’s new surprise move in Augmented Reality ...

Next Article

Phonegap Tutorial 2: Building , Running & ...

Umesh Sethi

Our company helps convert ideas into mobile apps. We work with international clients and clients in Delhi NCR. As the Project Manager i like sharing tips, tricks and suggestions with clients and partners

Related articles More from author

  • Optimising your Play Store Listing, ASO
    Android Tutorials & TipsMobile App DevelopmentMobile App ToolsSmall Businesses & Startups

    How to Optimise your App on Google Play Store, ASO for Play Store Listing ?

    October 30, 2017
    By Saurabh Kumar
  • What features should your On-Demand App have ?
    Mobile App DevelopmentSmall Businesses & Startups

    What Features to add in your On Demand App Like Swiggy, Food Delivery etc., Uber of X etc.

    February 27, 2019
    By Abhay Anand
  • Ionic in Hybrid applications
    Mobile App Development

    Why and When to use Ionic for building your Hybrid mobile app ?

    March 16, 2018
    By Abhay Anand
  • Top 10 Bitcoin Apps for 2018
    Mobile App DevelopmentNew App ReviewsNews

    The Best Bitcoin mobile apps to watch out for in 2018

    December 23, 2017
    By Saurabh Kumar
  • How to Create a Requirements document for Mobile App - step wise article
    Mobile App DevelopmentSmall Businesses & Startups

    How to create a requirements document for your Mobile App ? (Steps and Tips)

    November 25, 2018
    By Umesh Sethi
  • mobile app development, mobiile app programming, Java vs. Kotlin
    Mobile App Development

    Kotlin vs. Java for Android App Development – And the winner is….

    September 9, 2017
    By Umesh Sethi

Recommended Articles

  • How to select the right design theme for your website
    Web

    Tutorial 4: How to choose the best theme for your business website ?

  • featured image web design checklist
    Small Businesses & StartupsWeb

    7 Tasks to Complete before Starting Your Website Development Project

  • Lead Generation Plugins for WP websites
    Web

    7 Best Lead Generation Plugins for WordPress in 2020 & beyond

  • Top Android Libraries for 2018
    Android Tutorials & TipsMobile App DevelopmentMobile App Tools

    Top 10 Android Development Libraries | Best Android Libraries for Developers

Web Design & App Tutorials

  • November 7, 2020

    10 Tips To Grow Your Online Business

  • October 3, 2020

    10 Reasons to use Woocommerce for your E-commerce Development

  • September 4, 2020

    21 steps to Create a successful e-commerce store ! (Ultimate Guide)

  • August 28, 2020

    How to Choose the best custom software development companies in India ?

  • July 31, 2020

    7 Best Lead Generation Plugins for WordPress in 2020 & beyond

  • July 24, 2020

    7 Tasks to Complete before Starting Your Website Development Project

  • June 24, 2020

    5 practical tips to make your Ecommerce Store a Success

  • May 11, 2020

    Tutorial 4: How to choose the best theme for your business website ?

  • April 17, 2020

    Online Marketing Tips and Productivity Tools for Small Businesses during Coronavirus

  • March 31, 2020

    Tutorial 3 – How to Create a Project Plan / To Do List for your Website Design Project

  • March 11, 2020

    Tutorial 2: Which type of website does your business need ?

  • February 26, 2020

    Websites for Business Owners – Tutorial 1 – Market Research for your website

Check our Earlier Posts

  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • September 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • Recent

  • Popular

  • Comments

  • online marketing dashboard opened

    10 Tips To Grow Your Online Business

    By Editorial Staff
    November 7, 2020
  • 10 Reasons to use Woocommerce for your E-commerce Development

    By Saurabh Kumar
    October 3, 2020
  • 21 steps to creating your ecommerce store

    21 steps to Create a successful e-commerce store ! (Ultimate Guide)

    By Umesh Sethi
    September 4, 2020
  • how to find the best custom software development company in India

    How to Choose the best custom software development companies in India ?

    By Abhay Anand
    August 28, 2020
  • Lead Generation Plugins for WP websites

    7 Best Lead Generation Plugins for WordPress in 2020 & beyond

    By Umesh Sethi
    July 31, 2020
  • Top 10 Bitcoin Apps for 2018

    The Best Bitcoin mobile apps to watch out for in 2018

    By Saurabh Kumar
    December 23, 2017
  • iPhone 8 specifications, iPhone 8 Actual features

    Does the iPhone 10 or iPhone X meet users expectations? Features, Specifications, Details

    By Saurabh Kumar
    September 12, 2017
  • Google Tez App launch in India

    Google Tez App launched – Tez App Review and How to use it.

    By Umesh Sethi
    September 18, 2017
  • mobile app development, mobiile app programming, Java vs. Kotlin

    Kotlin vs. Java for Android App Development – And the winner is….

    By Umesh Sethi
    September 9, 2017
  • Creating a Requirements Document for Mobile App Development

    What should a Requirements Document (or a RFP) for your Mobile App Contain ?

    By Umesh Sethi
    October 17, 2017
  • Shailesh Manjrekar
    on
    September 12, 2020

    21 steps to Create a successful e-commerce store ! (Ultimate Guide)

    Thank you so much, ...
  • Maulik Shah
    on
    September 12, 2020

    How to Choose the best custom software development companies in India ?

    Such an informative post.Thanks ...
  • mayank
    on
    September 4, 2020

    How to Choose the best custom software development companies in India ?

    It's very wonderful information ...
  • Upendra
    on
    August 6, 2020

    7 Tasks to Complete before Starting Your Website Development Project

    Thanks for this blog ...
  • Bharat
    on
    July 7, 2020

    5 practical tips to make your Ecommerce Store a Success

    A very nice content ...

Our Terms of Use | Partners

Visit blogadda.com to discover Indian blogs
Featured on Blog Directory
Creative Spark Solutions is a web & app development company based in Delhi, India. With this blog we continue to connect with developers, clients and anyone interested in mobile & tech news, happenings & articles.
2017, Creative Spark Solutions helping clients in Web, Mobile & Software