28 Kasım 2013 Perşembe

Top PhoneGap (Cordova) Plugins

In this list, I present most important phonegap plugins and how to install them to your project. Before going through this list, you should first have a look at How to Develop Phonegap Hello World Application
  1. Splash Screen. Run following command to add splash screen plugin into your existing project.

    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
  2. Device API. Run following command to add device plugin into your existing project.

    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

Solve&Fix "Package name must look like" error in Phonegap 3

You may get "Package name must look like..." error if you create a phonegap 3 project as below:

cordova create ./hello-world HelloWorld
cordova platform add android

When you run above code, you get below error:

Checking Android requirements...
Creating android project...
[Error: An error occured during creation of android sub-project. 
Package name must look like: com.company.Name
]

You get error because you are missing --id and --name options. The correct way to add Android support into your Phonegap application would be as follows:

phonegap create ./hello-world --id com.example.hello --name HelloWorld
cd hello-world
cordova platform add android

24 Kasım 2013 Pazar

How to Create&Develop a Phonegap HelloWorld Project


  1. Install PhoneGap. You need NodeJs package manager installed.

    npm install -g cordova
  2. Create  a project named "HelloWorld" inside "phonegap-example" directory. Use "com.example.hello" root package.

    phonegap create phonegap-example --id com.example.hello --name HelloWorld
  3. Add android support

    
    cd phonegap-example
    
    cordova platform add android

  4. Build the project

    cordova build

  5. Run the project. You need Android Development SDK installed.

    cd ./platform/android/cordova
    
    ./run
    In case, you don't have an android emulator defined in your development environment, you may get following error:

    ERROR : No emulator images (avds) found, if you would like to create an  avd follow the instructions provided here:
     http://developer.android.com/tools/devices/index.html
     Or run 'android create avd --name <name> --target <targetID>' in on the command line.

16 Kasım 2013 Cumartesi

10 Kasım 2013 Pazar