Thursday, August 25, 2016

Angular JS Stop Dynamic Validation on Change Option of Select Dropdown

Angular JS Stop Dynamic Validation on Change Option of Select Dropdown

Code to stop the validation on dynamic update to the textbox or nay other elements.

< form name="$parent.balanceTransferForm" >
< select options="accounts" on-change="changeSourceAccount(value, $parent.balanceTransferForm)" ></ select  >
< /form >

$scope.changeSourceAccount = function(account, form){
$scope.balanceTransferPreValidateReqObj.transferAmount.value = "";
if(form!=null){
                form.$setPristine();
                form.$setUntouched();
        }
};

Wednesday, May 11, 2016

how to create or make a loading screen in html javascript

Here is the simple way to create or make a loading screen in html and javascript
Write two functions like below:
// This is to show the loading page / progress bar


function showProgress() {
    var scrollPos = (window.pageYOffset > $('html').scrollTop())?(window.pageYOffset):($('html').scrollTop()),
    imgYPos = scrollPos + (($(window).height() / 2 ) -30 ) ,
    overlayObj = $('
').height($(document).height())
                     .css('background-position', 'center '+imgYPos+'px');            
    $('body').append(overlayObj);
}
// This is to hide the loading page / progress bar
function hideProgress() {
    $('.pageLoadingOverlay').remove();
}

And the CSS for this code snippet is
.pageLoadingOverlay {
    height: 100%;
    width: 100%;
    display: block;
    z-index: 100;
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.5) url("../images/325.gif") no-repeat center center; 

}

Now you can call showProgress() when processing the screen and hide progress while closing the screen

Freecharge Coupon Code New User - Freecharge Coupon

Use below Freecharge Promo Code to recharge through Freecharge and get Rupees 50.

RMCJ7C5

Use this Freecharge Promo Code to recharge with minimum amount of Rs. 50 and get 50 to your Freecharge account.

Freecharge Promo Code: RMCJ7C5

To Get Rs. 50 as Freecharge Cash Back follow the process

Download Freecharge App or Login/Register with your Freecharge account

Click on Mobile Recharge

Recharge with Rs. 50

Use Promo Code RMCJ7C5

Proceed to pay with freecharge

Get Rs. 50 to your freecharge account.

You are Done...

Wednesday, April 6, 2016

How to set Android Home environment variables to your MAC OSx

How to set Android Home environment variables to your MAC OSx

When you try to create project using terminal from your MAC BOOK (MAC OSx), you end up getting an error saying:

Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.

To resolve this error, you need to set the ANDROID HOME environment variable. 
  • Make sure you install the android SDK installed in your MAC.
  • Navigate to the installed location of android SDK and copy the path.
    • EX: /Users/Madhavan/Library/Android/sdk
  • Open the terminal and export ANDROID HOME variable.
    • export ANDROID_HOME=/Users/Madhavan/Library/Android/sdk
  • Set the path variable to ANDROID_HOME.
    • export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Open terminal and write your command like below:

Madhavan-Subramanian-MacBook-Pro: Madhavan$
export ANDROID_HOME=/Users/Madhavan/Library/Android/sdk

Madhavan-Subramanian-MacBook-Pro: Madhavan$

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools


Tuesday, July 7, 2015

Objective C Concepts Learning

Objective C Blocks

What is Block;

Block is an anonymous function in Objective C.

Blocks can be used as below:

As a local variable:
returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...};

As a property:
@property (nonatomic, copy) returnType (^blockName)(parameterTypes);

As a method parameter:
- (void)someMethodThatTakesABlock:(returnType (^)(parameterTypes))blockName;

As an argument to a method call:
[someObject someMethodThatTakesABlock:^returnType (parameters) {...}];

As a typedef:
typedef returnType (^TypeName)(parameterTypes);
TypeName blockName = ^returnType(parameters) {...};


Important Concepts of Blocks

-          Blocks will freeze the variables which are accessed from outside the block. It will make the variable as constant with the value assigned to it.

 NSString *variable = @"Madhavan";

-          To allow blocks to make the variable as mutable we need to declare as below

__block NSString *variable = @"Madhavan";

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Use of @ in Objective C

@ is a keyword used to differentiate Objective C keywords from C or C++ keywords.


@ symbol tell the compiler it is as Objective C construct and not the C or C++ construct.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Autoreleasepool in Objective C

autoreleasepool is used to retain or release the object created by the developer. Whenever the loop increaments the autorelease pool make the reference count +1 and -1 when the loop finish the task.

Saturday, April 12, 2014

Create Phonegap Project in Blackberry

How to create PhoneGap project in Blackberry

Prerequisites:

Download and install java from below location


Download and install Blackberry SDK from below location


Download and extract Phonegap from below location


Get and Install signing keys

Request signing keys from the below location. 

https://www.blackberry.com/SignedKeys/

Providing official mail ID in the request form is mandatory. You will get three .CSI signature keys from blackberry. You must remember the PIN defined yourself in the request form; it is needed to install the singing key. 

How to set up Blackberry Signature Key

To install the signature key follow below steps

1) Go to command prompt and locate your Blackberry Webworks Packager Installed location.
        EX: C:\BBWP\bin\>

2) Type blow command 
        java   -jar    SignatureTool.jar    <.csi file path>

3) A prompt will open and will ask PIN (you entered when you requested signing key) and “Password” to                 compile the Smartphone App.

4) Remember this password; it is needed to compile the app every time.

Blackberry IDEs

We can use any editor for Blackberry Webworks development.

1) Dreamweaver

2) Ripple emulator

3) Eclipse

4) Notepad ++

API’s available for Blackberry Webworks development is

1) Phonegap API

2) Blackberry Webworks API

Development process
Create Project

1) Create index.html file under your project folder.

2) Create config.xml file under your project folder.

Compile Project

1) Go to you project directory and create a zip file of your files (index.html, config.xml, etc).
        EX: ProjectName.zip

2) Go to command prompt and locate your Blackberry Webworks Packager Installed location.
        EX: C:\BBWP\

3) To compile the file type the following command and enter
        C:\BBWP\>BBWP      D:\Locate\Your\Project\Directory\ ProjectName.zip    /g   SignKeyPassword

Now two folders “OTA Install” “Standard Install” will be available in your project directory

4) To load into simulator, click on load option from simulator file menu, locate to .COD file of your “Standard Install” Folder.

5) To load into your mobile type below command and enter.
        C:\BBWP\>bin\JavaLoader    –u   load     D:\Locate\Your\Project\Directory\bin\StandardInstall\               ProjectName.cod

Friday, February 28, 2014

PhoneGap 3.4 Environment Setup and Create Cordova Project

PhoneGap 3.4 Environment Setup and Create Cordova Project

It’s been a long time to identify the working functionality of Cordova or PhoneGap versions 2.7 to 3.4 (2.7.0, 2.8.0, 2.8.1, 2.9.0, 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0) for Windows.  I went through many blogs and forums to setup my Cordova or PhoneGap environment at office. As you know most of our organizations does uses the proxy network and it will block your process in the middle of your setup. Because, now PhoneGap is dependent on Node JS, Apache Ant, Java JDK and Android SDK, so you have to be complete on setting up those requirements.

Now here I am going to tell you the complete PhoneGap setup up in few steps with Eclipse IDE.

Requirements:
1)      Java JDK
Note: Make sure you download 32 bit JDK and version above 6, most cases Android SDK does not find Java and you will face the issue like “JDK Not Founderror.
2)      Node JS
Note: Windows Installer (.msi) 32 bit version
3)      Apache Ant
Note: zip archive binary version
4)      Android SDK ADT Bundle for Windows
5)      Cordova Archive File
Note: Source zip

Download all the required files from above locations.
Installation steps:
1)      Java
Install Java in your system and setup the environment variables for JDK as below.
1)       
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.7.0_45;
2)       
Variable Name: PATH
Variable Value: %JAVA_HOME%\bin;

Now check your Java environment is set
Open Command Prompt and type command java –version like below and check your java version is displayed.



2)      Node JS
Install Node JS, Node JS will set his environment variable himself
Now check your Java environment is set
Open Command Prompt and type command java –version like below and check your java version is displayed.



If Node JS version is not displayed then follow bellow steps to set environment variable for Node JS else skip it.
1)       
Variable Name: PATH
Variable Value: C:\Documents and Settings\Your Name\Application Data\npm;
2)       
Variable Name: PATH
Variable Value: C:\Your Installation Path\To Node JS\

3)      Apache Ant
Install Apache Ant in your system and setup the environment variables for Apache Ant as below.
1)       
Variable Name: ANT_HOME
Variable Value: C:\Your Path\To Ant\apache-ant-1.9.3;
2)       
Variable Name: PATH
Variable Value: %ANT_HOME%\bin;

Now check your Apache Ant environment is set
Open Command Prompt and type command ant –version like below and check your Apache Ant version is displayed.
           
            


4)      Android SDK ADT Bundle for Windows
Download and extract your bundle in your development environment. Make sure do not change the extracted folder structure of eclipse, sdk and SDK Manager.exe.
Setup the environment variables for JDK as below.
1)       
Variable Name: ANDROID_SDK_HOME
Variable Value: C:\Location To\Your Work\Environment\adt-bundle-windows-x86-20131030\sdk;
2)       
Variable Name: PATH
Variable Value: C:\Location To\Your Work\Environment\adt-bundle-windows-x86-20131030\sdk\platform-tools;
3)       
Variable Name: PATH
Variable Value: C:\Location To\Your Work\Environment\adt-bundle-windows-x86-20131030\sdk\tools;

Now check your Android SDK environment is set
Open Command Prompt and type command android list target like below and check your android target is displayed.




5)      Finally Cordova Archive File
Download and extract Cordova cordova-3.4.0-src.zip to your working location then extract android folder cordova-android.zip.
Now your path looks like C:\ Location To\Your Cordova\cordova-3.4.0\cordova-android



Now we are done with our environment setup for Cordova version 3.4.0.
Let us start with creating Cordova PhoneGap project.

To create Cordova PhoneGap project,
Open command prompt
Navigate to your Cordova android location

C:\>cd C:\Location To\Your Cordova\cordova-3.4.0\cordova-android\bin

C:\Location To\Your Cordova\cordova-3.4.0\cordova-android\bin>

Now Use Create command to create Codova or PhoneGap project
The general format of create command will be like below
Create ProjectLocation PackageName ProjectName
Ex: create   c:\MyFirstCordova3.4App\   com.mycompany.MyFirstApp  MyFirstApp

C:\Location To\Your Cordova\cordova-3.4.0\cordova-android\bin>create c:\MyFirstCordova3.4App\ com.mycompany.MyFirstApp MyFirstApp



Now we have successfully created our Cordova PhoneGap project

Next step will be to import our project into eclipse.

Open eclipse from your work environment.
From the left project explorer pane right click and choose import -> Android -> Existing Android Code into Workspace








Click next and browse your project location to Root Directory then click Finish
Note: Do not click on Copy projects into workspace, because this will produce some path error to your workspace.

Now you will find two folders MyFirstApp and MyFirstApp-CordovaLib in your project pane.
Once imported you may get few error on import statement of Java Class file, to resolve this, add cordovalib.jar file to your Android Dependency folder from MyFirstApp-CordovaLib.
Now right click your project click run as -> Android Application. It will launch an emulator with Virtual Device you setup and will open your Cordova Home page.

That is itJ. Now we are ready to start.