Show progress for ongoing download phone-gap application

Here the example for showing progress of ongoing download file. You need below line in your .html file: <div id=”status”></div> You need to write below code in your javascript file: var fileTransfer = new FileTransfer(); fileTransfer.onprogress = function(progressEvent) { if (progressEvent.lengthComputable) { var perc = …

Download & Store files in documents directory iOS phone-gap application

Hello, Here is the code for download and store files in document directory ios phone-gap app. var fileTransfer = new FileTransfer(); fileTransfer.download( uri, filePath, function(entry) { alert(“download complete: ” + entry.toURL()); } }, function(error) { alert(“download error source ” + error.source); alert(“download error target ” …

DFP Banner & Interstitial Ads in iOS

//DFPBannerView //ViewController.h 1. @import GoogleMobileAds 2. @property (nonatomic, weak) IBOutlet DFPBannerView *bannerView; 3. Design UIView which custom class is DFPBannerView //ViewController.m – (void)viewDidLoad { [super viewDidLoad]; NSLog(@”Google Mobile Ads SDK version: %@”, [DFPRequest sdkVersion]); self.bannerView.adUnitID = @”/6499/example/banner”; //To get your own adUnitID refer reference links …

Play All Video without freeze and gap between two videos

1. Implement SHBQueuePlayer third party class you can download from github: https://github.com/jiutianhuanpei/SHBQueuePlayer 2. Implement AVPlayerViewController class 3. The below function is used for set urls for play video. – (void)setUrls:(NSMutableArray *)urls index:(NSInteger)index { [_playedUrls removeAllObjects]; [_nextUrls removeAllObjects]; if (urls.count == 0 || urls == nil) …

How to check internet is access or not when device connected with WIFI?

You can check internet is accessible or not when your device connected with WIFI with following code. You need to import Reachability.h & Reachability .m in Appdelegate class and do following code in didFinishLaunchingWithOptions: function. self.reachability = [Reachability reachabilityWithHostName:@”www.google.com”]; //self.reachability = [Reachability reachabilityForInternetConnection]; // Start Monitoring …

Change the titleLabel of UIButton which title type is Attributed in Storyboard / Xib file

Issue : I have use below code to change Title and set underline of UIButton at run time. [btnTemp setTitle:@”Test” forState:UIControlStateNormal]; I have got below issues: 1. Underline is not showing 2. Title not change 3. Title color is display default black. To overcome this …