Wednesday, January 16, 2019

Taking iOS build in kony

How to Take i-os build:-

KAR file that means Karoke File.
from KAR file to generate the IPA file.
(Note:-
In Our Visualizer Plugins Doesn't Deleted.it is kept on same place.)

Steps to Take a i-os Build:-

1.Right Click that application shortcut
2.File location
3.in search box type - plugins ios
4.Copy Plug in & KAR file

  Here after we use mac System

5.Paste that KAR file into MAC Explorer.
6.An MAC Explorer Produce once JAR file from KAR file.
7.Double click that JAR file that produce another one ZIP file.
8.Extract that ZIP file.
9.On Version wise some files are in same name.so based on that you have
to Extarct that.
10.on Right side .gen file has there.
11.Open Terminal
12.Go that gen file directory Drag and drop the gen file into Terminal
click Enter it will produce Address.

13.Type the Command "perl extract -pl" then Drag & Drop that build file
Click Enter.it will produce json file.

14.After DONE "VMAWithKonyLib" double click that it will open the another
prompt
15.It run's only on MAC in-build simulator
16.If you want to take IPA file for iphones you have to give "UDID" number
to that BUILD
17.For Taking i-os build or .IPA file you have to give Authorized Certificate
through ONLINE.



Sunday, December 9, 2018

Performing a search in a segment using with textbox

//call this function in ontextchange event of textbox
function search(){
  try{

    if(frmCountryCodeList.txtSearch.text !== ""){

      var searchArr = [];

      for(var i = 0; i<gbl_country_code.length; i++){
        if(gbl_country_code[i].lblCountry.toLowerCase().includes(frmCountryCodeList.txtSearch.text.toLowerCase())){
          searchArr.push(gbl_country_code[i]);
        }
      }
      frmCountryCodeList.segCountryCode.setData(searchArr);

    }else{
      frmCountryCodeList.segCountryCode.setData(gbl_country_code);
    }


  }catch(err){
    dialogue("Err "+err);
  }
}

Disabling kony default loader

//call this function in postappinit
function avoidDefaultLoader(){
  try{
    kony.application.setApplicationBehaviors({ "hideDefaultLoadingIndicator":true});
  }catch(err){
    dialogue("Error "+err);
  }
}

Opening gallery and select and set image to an image widget

function gallerImages(){
  var querycontext = {mimetype:"image/*"};
  var Status = kony.phone.openMediaGallery(onselectioncallback, querycontext);

  function onselectioncallback(rawbytes)
  {
    frmProfile.flxCameraGallery.setVisibility(false);
    if(rawbytes !== null){
      base64Str = kony.convertToBase64(rawbytes);
      frmProfile.imgProfile.base64=base64Str;
      frmDashBoard.imgMenuProfile.base64 = base64Str;
    }else{
             alert("Please select image");
    }
  }
}

Getting card number format in textbox

var str, strc;

//call this function in ontextchange
function cardNumberFormat(){
  try{
    if(str !== null && str !== undefined){
      if(frmPaymentMode.txtCardNumber.text.length > str.length){
        if(frmPaymentMode.txtCardNumber.text.length ===4){
          frmPaymentMode.txtCardNumber.text = frmPaymentMode.txtCardNumber.text+" ";
        }else if(frmPaymentMode.txtCardNumber.text.length ===9){
          frmPaymentMode.txtCardNumber.text = frmPaymentMode.txtCardNumber.text+" ";
        }else if(frmPaymentMode.txtCardNumber.text.length ===14){
          frmPaymentMode.txtCardNumber.text = frmPaymentMode.txtCardNumber.text+" ";
        }
      }else{

      }
    }
    str = frmPaymentMode.txtCardNumber.text;

  }catch(err){
    dialogue("Error "+err);
  }
}

Getting current position and displaying in map

function getPosition(){
    var positionoptions = {timeout: 15000};
    frmLocation.mapLocation.zoomLevel=15;
    kony.location.getCurrentPosition(successcallback, errorcallback, positionoptions);
}


function successcallback(position){
  var lat = position.coords.latitude;
  var long = position.coords.longitude; 
  var locationData = [{
           lat: lat,
       lon : long,
       image : "dest.png",
           desc: "your location",
           name: "location"
        }];
//setting current position in map
  frmLocation.mapLocation.locationData = locationData;
  frmLocation.show();
}

function errorcallback(positionerror){
    var errorMesg = "Error code: " + positionerror.code;
    errorMesg = errorMesg  + " message: " + positionerror.message;
    alert(errorMesg);
  frmLocation.show();
}

Internationalization in kony

// for changing default locale
function changeLanguage(){
  try{
    var lang = frmLanguages.sgmLanguages.selectedRowItems[0].lblLanguage;
    alert(lang);
    if(lang === "English"){
      kony.i18n.setDefaultLocaleAsync("en_US", onsuccesscallback, onfailurecallback);
    }else if(lang === "Hindi"){
      kony.i18n.setDefaultLocaleAsync("hi_IN", onsuccesscallback, onfailurecallback);
    }else{
      kony.i18n.setDefaultLocaleAsync("te_IN", onsuccesscallback, onfailurecallback);
    }
  }catch(err){
    dialogue("Error "+err);
  }
}




function onsuccesscallback(oldlocalename, newlocalename){

  alert("success "+oldlocalename +" "+newlocalename);
}

function onfailurecallback(errCode, errMsg){
  alert("failure "+errCode +" "+errMsg);
}

//for dynamically changing text
frmRecharge.headers[0].lblHeader.text = kony.i18n.getLocalizedString("recharge");