Skip to main content

Posts

Showing posts with the label phonegap

Phonegap plugin for Ads on iPhone

I suppose you know how to create a Phonegap project and also how to add a plugin into the project. First download the required code from here . Add the "Ads" folder to your plugins list. To do this, right-click on the Plugins folder in Xcode and select to “Add Files to…” the folder. Navigate to the Ads folder, and select the folder. Check “Copy items into. . .” and “Create groups for. . .” A ChildBrowser folder is added to the Plugins folder. Copy the content of "js" folder to desired location. Then update the plist to use the plugin In Supporting Files > PhoneGap.plist, add under Plugins (click the down arrow to the left of Plugins, then click on the + symbol to open a new row): Key: SAiOSAdPlugin Type: String (default) Value: SAiOSAdPlugin See the "index.html" for initialization of the code. Now, to display the Ad, call "showTheAd(true)" and whenever you want to hide the Ad call "showTheAd(false)" ...

Integrating AdMob Ads in a PhoneGap Project (iOS)

Open the phonegap project to which AdMob is to be added. Import  GoogleAdMobAdsSDK which can be found here . Add  MessageUI.framework  to the project. To do this " click on project name , go to summary tab, scroll down to the framework section and click +. Then select MessageUI.framework ". In AppDelegate.h import "GADBannerView.h" and add "GADBannerView *bannerView_;" , so that it looks like@interface AppDelegate : PhoneGapDelegate { NSString* invokeString; GADBannerView *bannerView_; }  In AppDelegate.m –  #define MY_BANNER_UNIT_ID @”Your AdMob Publisher ID” Add the following code at the beginning of webViewDidFinishLoad:    bannerView_ = [[GADBannerView alloc]init]; [bannerView_ setDelegate:self]; [bannerView_ setFrame:CGRectMake(0, 45, 320, 95)];//Position of Ad banner bannerView_.adUnitID = MY_BANNER_UNIT_ID; bannerView_.rootViewController = self.viewController; [self.viewController.view addSubview:bannerView_]; [bannerView_...

ChildBrowser Android

First you need to get ready with the phonegap running properly. It's here . First download the source from here Now follow these procedure:  1. To install the plugin, move  www/childbrowser.js  to your project's www folder and include a reference to it in your html file after phonegap<version>.js. <script type="text/javascript" charset="utf-8" src="phonegap<version>.js"></script> <script type="text/javascript" charset="utf-8" src="childbrowser.js"></script> 2. Copy the image files folder www/childbrowser to your project's www folder.Here you can edit the code or add any other files, but keep the folder named "ChildBrowser" as it is. Because, it is being referenced from others locations. 3. Create a directory within your project called " src/com/phonegap/plugins/childBrowser " and copy " src/com/phonegap/plugins/childBrowser/ChildBrowser.java ...

ChildBrowser iOS xCode

Today I tried to simplify the ChildBrowser execution in xCode, which I follwed earlier. To my surprise, I don't need to do anything rather than simply ignoring some steps. Here is the procedure: Download the ChildBrowser plugins here . Start xCode and create a phonegap-based application. In Supporting Files > PhoneGap.plist, add under Plugins (click the down arrow to the left of Plugins, then click on the + symbol to open a new row): Key: ChildBrowserCommand Type: String (default) Value: ChildBrowserCommand  You need to associate your external URLs on this page, too. In Supporting Files > PhoneGap.plist, add them under ExternalHosts, like: Key: Item 0 Type: String (default) Value:  * or whatever URL you are using in the code(* is enough) Right-click on the Plugins folder in Xcode and select to “Add Files to…” the folder. Navigate to the phonegap-plugins > iPhone > Childbrowser folder, and select the ChildBrowser folder. Check “Copy items i...