Tuesday, September 8, 2015

Adding splash screen in an android app built on PhoneGap

After struggling alot to add splash screen, finally I have managed to work. Followed the following steps -

  1. Make sure you have all images for splash screen in your www/res/screen/android folder
  2. Find/add the following tag to your config.xml file under www folder;
    (value is in ms, so please add accordingly)
  3. Make sure you have the Splash screen plugin installed (org.apache.cordova.splashscreen). You can check by going to your folder and executing the following command on terminal:
    phonegap plugin list
  4. If you don't have the plugin, add it by using the following command:
    phonegap add plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
  5. In your JavaScript code you can add the following code to close the splash screen:
    //checks for splashscreen and hides it
    if (navigator && navigator.splashscreen) { navigator.splashscreen.hide(); }

Thursday, September 3, 2015

PhoneGap and Android Studio

PhoneGap uses purely html, css and js ; so a good framework for those who have been worked on these technologies mostly. Just started building mobile application. After some research found that phoneGap to be the best framework to start with.

Required applications to install -

  1. PhoneGap
  2. Android Studio

PhoneGap Desktop application was not working well so I preferred to work on phonegap command line.

Followed the following links, it has explained very easy steps to start with phonegap apps - https://www.ringroost.com/blog/android-studio-phonegap-mac-hello-world-android-app-html-css-javascript/

Came across some issues and following links helped me to get through it -

  1. Error - how-to-fix-hax-is-not-working-and-emulator-runs-in-emulation-mode
  2. Error - “No Content-Security-Policy meta tag found.”
  3. config.xml is present under applications root directory
  4. https://developer.ibm.com/answers/questions/18840/not-able-to-connect-to-mobile-app-from-emulator-getting-exception-in-logcat.html