Monday, 15 September 2014

AngularJS project with YeoMan windows 7 step by step


  1. Download Node.js 
    1. install it
  2. Download Git
    1. install it
      1. Run Git form the Windows Command Prompt
      2. Configuring the line ending conversions“, choose “Checkout Windows-style, commit Unix-style line endings”
  3. Download Ruby
    1. Install it
  4. Open Command prompt
    1. Check Git command 
    2. Check Node.js
    3. if all work proper than fire few command as
      1. npm install -g yo
      2. npm install -g grunt-cli bower
      3. npm install -g generator-webapp
      4. npm install -g generator-angular
      5. note : now installation has been done these all steps are mendetory only once for your system
    4. create project directory
      1. mkdir yoeman-angular-project
      2. cd yoeman-angular-project
      3. yo angular yoeman-angular-project : for creating project and select all dependency as you required for project
      4. grunt serve --force : to start server it will open index.htm page in browser to indicate your app is running

Wednesday, 10 September 2014

JQuery AJAX call for web services / jsp / asp.net page

with out data 
       $.ajax({
            type: "POST",
            url: " web services / jsp / asp.net page",
            dataType: "text",
            async:false,
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                Success = true;//doesnt goes here
            },
            error: function (textStatus, errorThrown) {
                Success = false;//doesnt goes here
            }

        });
with passing data on server
        $.ajax({
            type: "POST",
            url: " web services / jsp / asp.net page",
            dataType: "text",
            async:false,
            data: JSON.stringify({ json object }),

            contentType: "application/json; charset=utf-8",
            success: function (data) {
                Success = true;//doesnt goes here
            },
            error: function (textStatus, errorThrown) {
                Success = false;//doesnt goes here
            }

        });

            

Working with checkbox with JQuery

Vereion 1.6 +
$('#myCheckbox').prop('checked', true);
Vestion 1.5
$('#myCheckbox').attr('checked', true);

Conver JSON object to String in JQuery

JSON.stringify(jsonObject);

Jquery Input button enable / disable

version 1.6 + 

$("input").prop('disabled', true);
version 1.5 
$("input").attr('disabled','disabled');

Friday, 5 September 2014

Android : SOAP services call form remote server with ServiceCaller class

package com.mastermoin.java;


import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;

import com.mastermoin.java.bean.UserBean;

public class ServiceCallTest {

       private static String METHOD_NAME = "Authenticate";
       public static String URL = SERVER + "nService.asmx";
       public static String SOAP_ACTION = "http://tempuri.org/";
       public static String NAMESPACE = "http://tempuri.org/";

       public UserBean UserTest(UserBean aBean) {

              final String svalue = "aBean";

              SoapObject requestObject = new SoapObject(NAMESPACE,
                           METHOD_NAME);

              requestObject.addProperty(svalue, aBean);

              final SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                           SoapEnvelope.VER11);
              envelope.dotNet = true;

              envelope.setOutputSoapObject(requestObject);

              envelope.addMapping(NAMESPACE,
                           UserBean.UserBean_CLASS.getSimpleName(),
                           UserBean.UserBean_CLASS);

              final Object response = new ServiceCaller().call(SOAP_ACTION
                           + METHOD_NAME, envelope, URL);
              UserBean userBean = null;
              if (response != null) {
                     try {
                           if (response != null) {
                                  userBean = new UserBean((SoapObject) response);
                           }
                     } catch (Exception e) {
                           e.printStackTrace();
                     }
              }

              return userBean;
       }


}