Upload Failed : You uploaded a debuggable APK

It was quite late in theĀ evening and I was about to wrap up my work. Suddenly I got a call form my client in Skype and he shared his concerns of uploading the build to production. Although it was late, I thought to help him before I close the day, since that guy is in the middle of his day time (in US). Now mind set is to spend time on the issue. I started looking into the issue.

The issue is, while he (my client) started uploading the APK file into the Android store, he is receiving the below rejection message from the store.

Upload Failed

Continue reading

CRUD operation in PhoneGap application using SQLite Database

Introduction:
Few days ago I received a comment from one of the reader of my blog to show an example on CRUD (Create, Read, Update and Delete) with the database. So in this post we will explore the use of CRUD operation using SQLite database in PhoneGap application.

Description:
CRUD can be described as a process, which helps the user to add, view, search and modify the information inside the database.

Here are the basic steps which demonstrates CRUD operation.

  • Create or add new entries
  • Read, retrieve, search or view existing entries
  • Update, modify or edit existing entries
  • Delete, deactivate or destroy existing entries

Before doing any operation on database let’s initialize the database first, either using HTML5 local database concept or using SQLite plugin.
Continue reading

Fix the Web View shrink issue in iOS7 using PhoneGap

Problem:
I received a bug ticket from my client about the unusual behavior of my application UI. It was a problem which was occurring only in iOS7 only.
When the keyboard pops up in iPad devices running on iOS7 the web view of our app gets shrink (app development using Phonegap).

Solution that works for me :
This problem can be solved in few steps.

  1. We need to go to Config.xml and inside the preference tag just need to set the value of KeyboardShrinksView to false.
  2. Continue reading

Adding events to native calendar in PhoneGap iOS application

Introduction:
While developing a PhoneGap application, I got a new requirement to add an event to native calendar from the application. So that user can get aware of the details of the event from native calendar.

Description:
To implement the same, I goggled for while and found a nice and interesting plugin which is very easy to integrate and works with PhoneGap smoothly. It allows the user to add the event to calendar of that device. Here are the steps bellow which will guide to integrate the calendar plugin in PhoneGap iOS application.

1. Download the calendar plugin from github by using this URL.
https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin/tree/pre-3.0
Continue reading

Control asynchronous processes by multiple callbacks using Deferred

Introduction:
To control the synchronous or asynchronous flow, there may be more methods but we will do this by multiple callback mechanism using deferred and promise object.

Description:
In order to use this mechanism first we need to have an understanding of deferred and promise object.
Here we will use a promise with a deferred object.
A promise is a placeholder for a result, which is initially unknown. While a deferred represents the computation that results in the value. Every deferred has a promise, which functions as a proxy for the future result.
A promise is a value returned by an asynchronous function, but a deferred can be resolved or rejected by its caller which separates the promise from the resolver. Continue reading

Copy existing sqlite database into PhoneGap iOS application

Introduction:
Usually PhoneGap supports SQLite database to interact locally. There might be a scenario where we need to create the database freshly or sometimes need to use the existing database. The idea of writing this blog came to my mind while encountered a question in stackoverflow site. Ā In this blog we will focus on importing existing database into our PhoneGap application and use the same to interact with our application.

Description:
Lets have a pre-populated database having tables with data which needs to be imported to our application. It will help us to minimize our effort in creating the database freshly to the application on its startup. For this we need to follow the bellow steps.

Step 1 : Remove the .sqlite extension from the sqlite database. Ex. If we have the database called DummyDB.sqlite make it only DummyDB.
Continue reading

Integrate SQLite plugin in PhoneGap iOS application

Introduction:
For offline storage in PhoneGap application, we can use local storage or storage API. But there are some limitations of this storage mechanism. So here we will discuss on creating local database with larger storage limits with the help of SQLite plugin.

Description:
To overcome the limitations, we can use the SQLite plugin which is very easy to integrate. Here are the steps below which will guide to integrate the SQLite plugin in PhoneGap iOS application.

1. Download the SQLite plugin from github by using this url.

https://github.com/lite4cordova/Cordova-SQLitePlugin

2. The plugins are inside Cordova-SQLitePlugin / src / ios /. Let’s drag the SQLitePlugin.h and SQLitePlugin.m files into the Plugins directory in Xcode and choose the “Create folder references for any added folders” option while adding reference.
Continue reading

Urban Airship integration to receive Push Notification in iOS using PhoneGap

Introduction:
Push Notification is a mechanism, which allows an application to notify the user about any new events without opening the application, same as a SMS pops up on our mobile screen. Push Notification can work both in background and foreground, so this is a nice way to interact with the application in the background.

Description:
Urban Airship provides easy and effective solution to push the notification to user. It can act as as a middle layer which will help us to send the notification from our server routing it through the Apple Notification Server.
So in this blog we will discuss the use of Urban Airship to send push notification to our application. Here are the steps bellow, which will guide us in the process of integrating the Urban Airship plugin in iOS application using PhoneGap version 2.6.0.

Step #1:
Download the plugin for Urban Airship from github with this URL.

https://github.com/urbanairship/phonegap-ua-push/tree/1.0.8
Continue reading

Integrating iAd in a PhoneGap Project

Introduction:
As the name suggests iAd is a mobile advertising platform provided by Apple to embed advertisements into the app. The new feature of iAd makes the content of the app more lively and dynamic, since clicking on an advertisement unlike the previous one it does not navigate away to Safari but opens a new Pop-up Window for the Ad inside the app.

Description:
To integrate an Ad using the iAd framework we need to mainly modify the MainViewController.h and MainViewController.m files by adding some additional code to it.

Below is the integration guide as follows.

We need to open project navigator, then click on the Build Phases tab.

Here we will find the row Link Binary With Libraries. We need to add iAd.framework to the project by clicking on the Add(+) button( at lower left end). Continue reading

Ways to include different video formats in different browsers and mobile devices

Introduction:

First of all my hearty thanks to Corinne Ducusin, one of the reader of my Tip How to play multiple videos in a loop using HTML5 and JavaScript. She is the person, who anyway encouraged me to write this post.

Yesterday I received an email from her, which includes a query, “how can we include the different formats of same video file to play it in different browsers”.

We all know that all browsers do not support same media formats of videos. So it’s a best practice to include different formats of videos to play it in different kind of browsers and devices. The browser will detect the supported format automatically and play that video file.

Description:

As per that post, videos were declared in an array to play them in a loop using HTML5.
var videoSource = new Array();
videoSource[0]=’video/video.m4v’;
videoSource[1]=’video/BigBuck.m4v’;

So now the question is, how can we include the other formats for the same video? If we declare the array like below, will it work? Continue reading