-(NSString *)setDateInFormat:(NSString *)strTxt { NSArray *arr = [strTxt componentsSeparatedByString:@”:”]; NSString *str = [arr objectAtIndex:0]; if ([str length] < 2) { if (![str hasPrefix:@”0″]) { …
Compress image without changing image dimensions
We have to write a single line to compress the image at a time when we are uploading our image to a server. NSData *dataForPNGFile = UIImageJPEGRepresentation(imgPicked, 0.0f); 0.0f is the maximum & 1.0f is the minimum compress ratio we can change based on our …
Preventing Zoom in Phonegap + JQuery Mobile
Use Meta Tag with following property in HTML <meta name=”viewport” content=”width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no” />
Remove text selection from PhoneGap iOS app
html { -webkit-user-select: none; }
Disable Emoji in input
$(‘input’).on(‘keypress’, function (event) { var regex = new RegExp(“[ -~]”); var key = String.fromCharCode(!event.charCode ? event.which : event.charCode); if (!regex.test(key)) { event.preventDefault(); return false; } });
Stop iOS Mobile from giving input buttons rounded corners and shade
we have to add css for this like as under input, textarea { -webkit-appearance: none; -webkit-border-radius: 0; }
Git Server and Client Setup
Server Setup First, you need to update your system and install necessary packages to your system. To update the system and install the SSH server on the server machine, run the following command: sudo apt-get update sudo apt-get install open ssh-server Second, install Git on …
AJAX call issue
Hello, Please check your html file, and if you find below line of code then please remove it. <meta http-equiv=”Content-Security-Policy” content=”default-src ‘self’ data: gap: https://ssl.gstatic.com ‘unsafe-eval’; style-src ‘self’ ‘unsafe-inline’; media-src *; img-src ‘self’ data: content:;”> Your issue was due to “Content-Security-Policy”. Thanks.
Previous screen is not reachable via back button
Hello, The problem is in changepage jquery you have used for changepage. Make sure that if you want to save your history, then you have to write “changeHash : true” in your changepage jquery. so your jquery looks like below code: $.mobile.changePage(page, { transition : …
Validation Functions for cordova application
==================JavaScript function for validating userid================= function userid_validation(uid,mx,my) { var uid_len = uid.value.length; if (uid_len == 0 || uid_len >= my || uid_len < mx) { alert(“User Id should not be empty / length be between “+mx+” to “+my); uid.focus(); return false; } return true; } …