Wednesday, 26 December 2018

Could not open cp_settings remapped class cache

.gradle Error

kony project could not able to generating build. If you get below like that error pls follow the steps

Could not open cp_settings remapped class cache for 58m3icgml5mvwq3x44rfzqryy (C:\\Users\\user\\.gradle\\caches\\4.4\\scripts-remapped\\settings_ezedqcymecp5smsvknnr2xi4i\\58m3icgml5mvwq3x44rfzqryy\\cp_settings638c4bcc3be846fd35262b91d5a74869).


Solution:
  • Go to the C:\Users\YOUR_USERNAME\.gradle\caches and locate the subfolder that is being complained about in your error message (e.g., 4.4).
  • Rename that folder (e.g., to 4.4_OLD).
  • Back in Android Studio, do Clean Project then Rebuild Project.
This will then generate a new subfolder (e.g., 4.4) in your caches directory and the build should complete successfully.

Note : if you can't change the folder name pls End-Task 
 " Java(TM) Platform SE binary


Friday, 7 December 2018

Read Raw file data using Kony visualizer


function fileReadOptions(){
  try{
    var destFilePath = kony.io.FileSystem.getDataDirectoryPath()+"/getdetails.json";
    var myFile = new kony.io.File(destFilePath).createFile();
    alert("Path is "+destFilePath);
    var fileObj = null;
    try{
      var file = new kony.io.File(destFilePath);
      //copyBundledRawFileTo API overrides the destination file with new one.
      //Hence check before copying
      if(!file.exists()){
        fileObj = kony.io.FileSystem.copyBundledRawFileTo ("getdetails.json", destFilePath);
      }else{
        // fileObj = file;
        fileObj = kony.io.FileSystem.copyBundledRawFileTo ("getdetails.json", destFilePath);
        var reading = new kony.io.File(destFilePath).read();
        alert(JSON.stringify(reading));
        alert("readAsText()  "+reading.readAsText());
      }
    }catch(e) {
      kony.print("Exception "+e);
    }
  }catch(err){
    alert("Error  : "+JSON.stringify(err));
  }
}

Friday, 30 November 2018

Switch onslide event based data change in segment example

define({

  onNavigate : function(){
    kony.print("onNavigate");
    var segList = [{
      imgOS: "msdosimag.png",
      template: "flxSegTemplate",
      lblOSName: "MS-DOS",
      switchData : {onSlide:this.onSlideCallback}
    }, {
      imgOS: "linuximag.png",
      template: "flxSegTemplate",
      lblOSName: "Linux",
      switchData : {onSlide:this.onSlideCallback}
    },{
      imgOS: "callicon.png",
      template: "flxSegTemplate",
      lblOSName: "Call Icon",
      switchData : {onSlide:this.onSlideCallback}
    }];

    this.view.segExciseExample.widgetDataMap = { imgOS: "imgOS",
                                                lblOSName: "lblOSName",
                                                switchData :"switchData" };
    this.view.segExciseExample.setData(segList);

  },

  onSlideCallback : function(eventObject){
    try{
   
      var segSelectedIndex = this.view.segExciseExample.selectedIndex[1];
      var selectedIndexVal = eventObject.selectedIndex;
      alert("Selected Index "+selectedIndexVal);
      if(selectedIndexVal === 0){
        alert("ON =====================================>");
        var updateVal ={
          imgOS: "callicon.png",
          template: "flxSegTemplate",
          lblOSName: "Call Icon22344",
          switchData : {onSlide:this.onSlideCallback,selectedIndex:0}
        };
        this.view.segExciseExample.setDataAt(updateVal, segSelectedIndex);
      }else{

        alert("OF =====================================>");
         var updateVal ={
          imgOS: "callicon.png",
          template: "flxSegTemplate",
          lblOSName: "Call IconOFFF",
          switchData : {onSlide:this.onSlideCallback,selectedIndex:1}
        };
        this.view.segExciseExample.setDataAt(updateVal, segSelectedIndex);
      }
    }catch(err){
      alert("Error : "+err);
    }
  }

Wednesday, 28 November 2018

Segment Excise example for Kony MVC architecture?

define({

  onNavigate : function(){

    var segList = [{

      imgOSKey: "msdosimag.png",

      template: "flxSegTemplate",

      lblOSNameKey: "MS-DOS"

    }, {

      imgOSKey: "linuximag.png",

      template: "flxSegTemplate",

      lblOSNameKey: "Linux"

    }];

    this.view.segExciseExample.widgetDataMap = {imgOS:"imgOSKey",lblOSName:"lblOSNameKey"};

    this.view.segExciseExample.setData(segList);

  }
});

Monday, 12 November 2018

Adding Link and underline in Rich text kony segment Dynamic example




function dynamicSegmentData(){
  try{
    var listData = ["Android","Java","Dotnet","FrameWrok","Next"];
    var arrayList = [];
    for(var i=0;i      var templa = {"rechTextVal":{text:""+listData[i]+""}};
      arrayList.push(templa);
    }
    frmRichText.segmentRichText.setData(arrayList);
  }catch(err){
    alert("Error"+err);
  }
}




Thursday, 8 November 2018

Kony Dynamic TextBox widget?


Dynamic TextBox widget adding into the flex container

var countID = 0;
function addDynamicTextBoxEvent(){

  try{
    var txtBasic = {id:"textBox"+countID,placeholder:"enter text",maxTextLength:100,left:"10dp",top:"10dp",skin:"skintxtBoxroundGray120",focusskin:"skinTextBoxFocusGray120",isVisible:true};
    var txtLayout = {padding:[5,0,0,0], margin:[5,5,5,5], containerWeight:100, hExpand:true, widgetAlignment:constants.WIDGET_ALIGN_TOP_LEFT};
    var txtPSP ={placeholderSkin:"skintxtPlaceholderGray120"};
    var textBox1 = new kony.ui.TextBox2(txtBasic,txtLayout,txtPSP);
    frmDynamicTxtBox.flexHari.add(textBox1);
    countID++;
    alert(countID);
  }catch(err){
    alert("Exception while occuring..."+err);
  }
}
























                                                                                                                                               Reference 

Monday, 5 November 2018

Kony Log Location

Logging Appender
Kony Fabric supports below-mentioned logging appenders:
1. File Logging: This is used to log the information in a file (.log format) stored in the user’s system. This is supported in both Windows and Linux environments.
Log Location
  • For Tomcat and JBoss single node, logs are created in < Kony Fabric Install Dir>/logs folder.
  • For JBoss cluster/multinode and WebLogic, logs are created in /konymflogs folder.
  • For WebSphere, logsare created in /AppServer/logs/konymflogs folder.
We create separate log file for each service as mentioned below:


2. Sys logging: This is used to log the information in system log using UDP protocol. This is supported only for the Linux environment. This is the best way to store all the information in a single place.
3. Database logging: This is used to store the log in the database of each service. This is mainly useful in a clustered/multinode environment when services are running in more than one box and logs need to store at a centralized location. Kony Fabric supports MySQL, MS SQL Server, Oracle and DB2 database server for database logging in both Windows and Linux environment.



Kony middleware Logging


For logging, use log4j statements instead of System.out.println() statements


Logging Detailed Location : KonyFabricInstaller folder\logs\admin.log




Wrap the debug statements with the log.isDebugEnabled() method. For example.

Java Syntax :

if (logger.isDebugEnabled())
{
...logger.debug("printing debug info")
}



Java Example :

import java.util.HashMap;

import org.apache.log4j.Logger;

import com.konylabs.middleware.cloud.LoggerBean;
import com.konylabs.middleware.common.DataPreProcessor;
import com.konylabs.middleware.controller.DataControllerRequest;
import com.konylabs.middleware.dataobject.Result;

public class ExampledebugLogging implements DataPreProcessor {

public static final Logger LOG = Logger.getLogger(ExampledebugLogging.class);

@Override
public boolean execute(HashMap arg0, DataControllerRequest arg1, Result arg2) throws Exception {

LOG.debug("======Testing Pre processor debug printing=====start====");

if(LOG.isDebugEnabled()) {

LOG.debug("================Log Priting==============");
LOG.debug("======Testing Pre processor debug printing=====");
}
LOG.debug("======Testing Pre processor debug printing======end=======");

return true;
}
}




JavaScript Example :


function fun1() {
    logger.debug('Tesing put method of HashMap');
    serviceInputParams.put('place', 'London');
    return true;
}
fun1();






Thursday, 11 October 2018

Kony Date Picker Example


Kony Visualizer 8.2.0

Date Picker ;

function datePickerEvent(){
  try{
    var dateVal = frmExampleCalendarwidgets.calFirstBtn.dateComponents;
    alert("Resonse : "+JSON.stringify(dateVal));
    alert("Day : "+dateVal[0]);
    alert("Month : "+dateVal[1]);
    alert("Year : "+dateVal[2]);
  }catch(err){
    kony.print("Error"+JSON.stringify(err) );
  }
}

Wednesday, 10 October 2018

Kony Switch Button ON and OFF

var gblSwitchbtnOnOff = true;

function eventAnimationSwitch(){
  try{
    if(gblSwitchbtnOnOff ){
      frmSwitchExp.Button0dccd5815ed3e49.animate(
        kony.ui.createAnimation({
          "100": {
            "left": "36dp",
            "stepConfig": {
              "timingFunction": kony.anim.EASE
            }
          }
        }), {
          "delay": 0,
          "iterationCount": 1,
          "fillMode": kony.anim.FILL_MODE_FORWARDS,
          "duration": 0.25
        }, {
          "animationEnd": afterEnd
        });

    }else{
      frmSwitchExp.Button0dccd5815ed3e49.animate(
        kony.ui.createAnimation({
          "100": {
            "left": "1dp",
            "stepConfig": {
              "timingFunction": kony.anim.EASE
            }
          }
        }), {
          "delay": 0,
          "iterationCount": 1,
          "fillMode": kony.anim.FILL_MODE_FORWARDS,
          "duration": 0.25
        }, {
          "animationEnd": afterEnd
        });
    }

  }catch(err){
    alert("Error "+JSON.stringify(err));
    kony.print("Error "+JSON.stringify(err));
  }
}


//After complete Animation change the status
function afterEnd(){
  if(gblSwitchbtnOnOff){
    gblSwitchbtnOnOff = false;
    frmSwitchExp.Button0dccd5815ed3e49.skin = "btnSkinGreen";
  }else{
    gblSwitchbtnOnOff = true;
    frmSwitchExp.Button0dccd5815ed3e49.skin = "btnSkinGray";
  }
}

Kony Android Native FFI

library might be using APIs not available in 14

as the library might be using APIs not available in 14
[exec-shell] \tSuggestion: use a compatible library with a minSdk of at most 14,
[exec-shell] \t\tor increase this project\'s minSdk version to at least 15,
[exec-shell] \t\tor use tools:overrideLibrary=\"your packagename\" to force usage (may lead to runtime failures)
[exec-shell] 10 actionable tasks: 10 executed



Example code for Custom Widgets in kony FFI


Android Custom Widget Code


LinearLayout linLayout = new LinearLayout(context.getApplicationContext());
// specifying vertical orientationlinLayout.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams leftMarginParams = new LinearLayout.LayoutParams(
        LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
leftMarginParams.leftMargin = 50;

Button btn1 = new Button(context.getApplicationContext());
btn1.setText("Button1");
btn1.setOnClickListener(new View.OnClickListener() {
    @Override    public void onClick(View view) {

        Toast.makeText(context, "Event Click", Toast.LENGTH_SHORT).show();
    }
});
linLayout.addView(btn1, leftMarginParams);













Tuesday, 9 October 2018

app:transformResourcesWithMergeJavaResForRelease



Execution failed for task ':app:transformResourcesWithMergeJavaResForRelease'.


I found a solution which works in my case.
I deleted the .gradle and .idle folder from the studio and then re-run the app.
it works fine for me

Monday, 1 October 2018

Kony Preprocessor using JavaScript


function exaplePre(){

  var username = serviceInputParams.get("Request Parameter Key Name");
  if(username == "1"){
    serviceInputParams.put("Request Parameter Key Name","Request Parameter Key Value");
  }else if("your condition){
     serviceInputParams.put("Request Parameter Key Name","Request Parameter Key Value");
  }
 
 return true;
}

exaplePre();



Kony PreProcessor using JAVA




package com.konylabs.chandrupreprocessor;

import java.util.HashMap;

import com.konylabs.middleware.common.DataPreProcessor;
import com.konylabs.middleware.controller.DataControllerRequest;
import com.konylabs.middleware.dataobject.Result;

public class ExamplePreProcessor implements DataPreProcessor{

@Override
public boolean execute(HashMap arg0, DataControllerRequest arg1, Result arg2) throws Exception {


String username = new String("" + arg0.get("usernames"));
if (your condition) {


//Modify Parameter Value in request time

      arg0.put("paramer key name", "Parameter Key Value");


}else{

//your respnse result like
}
return true;
}

}











Friday, 28 September 2018

"errmsg":"Invalid JSON Response: response is not starting with { or [

"errmsg":"Invalid JSON Response: response is not starting with { or [


Calling Create createAlert -  { message : Exception while occuring : {"errmsg":"Invalid JSON Response: response is not starting with { or [ for operation Name","opstatus":5001,"httpStatusCode":200,"httpresponse":{"headers":{"X-Android-Received-Millis":"1538126431428","Cache-Control":"no-store, no-cache, must-revalidate","Access-Control-Allow-Methods":"GET, HEAD, POST, TRACE, OPTIONS, PUT, DELETE, PATCH","X-Kony-Service-Message":"Invalid JSON Response: response is not starting with { or [ for GET_COUNTRY_LIST","X-Android-Selected-Protocol":"http/1.1","Server":"Kony","X-Android-Sent-Millis":"1538126430220","X-Kony-RequestId":"6f897b62-d172-4ebe-b31a-f7136ce79b73","Date":"Fri, 28 Sep 2018 09:20:32 GMT","Access-Control-Allow-Origin":"*","X-Kony-Service-Opstatus":"5001","Content-Type":"text/plain;charset=UTF-8","X-Android-Response-Source":"NETWORK 200","Pragma":"no-cache","Content-Length":"130"},"url":"http://192.168.0.108:8080/services/GetCountryCode/GET_COUNTRY_LIST","responsecode":200}}, alertType : 0.0,  }



Kony-Service-Opstatus":"5001 :

solutions : Header is missing

var headers= {"Content-Type":"application/json"};

or other header


Monday, 17 September 2018

how to Check Internet Availability in Kony?




 isNetworkStatus : function() {

      var request = new kony.net.HttpRequest();
      var url = "https://google.com";
      request.open(constants.HTTP_METHOD_GET, url);
      request.onReadyStateChange = this.callbackHandler;
      request.timeout=0;
      request.send();

    },
    callbackHandler : function (request) {

    kony.print("----------------------chandru-----------------check Internet Availabilitiy---------");

      if(request.readyState == 4){
        var requeststatus = request.status;
        if(requeststatus == 200 || requeststatus == "200"){
          alert("online");
        }else{
          alert("offline");
        }
      }
   kony.print("----------------------chandru-----------------check Internet Availabilitiy-------");

    }

how to check Internet Connectivity in Android Native


public static boolean isInetConnectivityStatus() {
    boolean success = false;
    try {
        URL url = new URL("https://google.com");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setConnectTimeout(10000);
        connection.connect();
        success = connection.getResponseCode() == 200;
    } catch (IOException e) {
        e.printStackTrace();
    }
    return success;
}

//purpose for to avoid android.os.NetworkOnMainThreadException
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
 StrictMode.setThreadPolicy(policy);

//isInternetWorking function calling
boolean resultOnlineStatus = isInetConnectivityStatus();
Toast.makeText(getApplicationContext(), "Status : "+resultOnlineStatus, Toast.LENGTH_SHORT).show();






Tuesday, 11 September 2018

To Find Device Type in kony


Kony Reference Architecture.

var types = kony.os.deviceInfo().name;
var deviceType = this.getDeviceType ;
if(types ==="android" && deviceType  === " Mobile"){

    kony.print("Android Mobile");

}else if(types ==="android" && deviceType  === " Tablet"){

   kony.print("Android Tablet");

}


getDeviceType : function(){

      try{
        var KonyMain = java.import("com.konylabs.android.KonyMain");
        var displayMetrics = java.import("android.util.DisplayMetrics");
        var Math = java.import("java.lang.Math");
        displayMetrics = KonyMain.getAppContext().getResources().getDisplayMetrics();
        var screenWidth  = displayMetrics.widthPixels / displayMetrics.xdpi;
        var screenHeight = displayMetrics.heightPixels / displayMetrics.ydpi;
        var size = Math.sqrt(Math.pow(screenWidth, 2) +
                             Math.pow(screenHeight, 2));
        if(size>=6)
          return "Tablet";
        else
          return "Mobile";
      }catch(err){
        kony.print("Error Exception is : "+JSON.stringify(err));
      }
    }

Monday, 10 September 2018

How to call Another Controller function




firstControllerfrom.js

define(function(){
  return {
    onNavigate : function(context){
      alert("Entering");
    },
    passDataAnother : function(){
      return "chandru";
    }
  };
});



secondControllerfrom.js

define(function(){

  return {

    onNavigate : function(context){
      kony.print("Entering");
    },
    callAnotherContr : function(){

      var controllerRef = require("firstControllerfrom");
      var result = controllerRef.passDataAnother ();

      alert("welcome "+result);
    }
  };
});

Friday, 7 September 2018

Get the file extention from file path




JAVA Example : 

public String getExt(String filePath){
        int strLength = filePath.lastIndexOf(".");
        if(strLength > 0)
            return filePath.substring(strLength + 1).toLowerCase();
        return null;
    }

JAVASCRIPT Example
function file_get_ext(filePathORname){
 return typeof filePathORname != "undefined" ? filePathORname.substring(filePathORname.lastIndexOf(".")+1, filePathORname.length).toLowerCase() : false;
}

How to get the Application Version Code using Kony NFI







 function getVersionControl (){
      try{
        var KonyMain = java.import("com.konylabs.android.KonyMain");
        var packageManager = java.import("android.content.pm.PackageManager");
        packageManager = KonyMain.getAppContext().getPackageManager();
        if (packageManager !== null) {
          try {
            packageInfo = packageManager.getPackageInfo(KonyMain.getAppContext().getPackageName(), 0);
            var  versionName = packageInfo.versionName;
            kony.print("Result print is : "+versionName);
            var  versionCode = packageInfo.versionCode;

            kony.print("Result print is : "+versionCode);
          } catch (eee) {
            kony.print("Exception is : "+JSON.stringify(eee));
          }
        }
      }catch(err){
        kony.print("Error Exception is : "+JSON.stringify(err));
      }
    }

Thursday, 6 September 2018

How to open PDF using Intent in KONY visualizer?


var pdfFilePath = "storage/emulated/0/filename.pdf";
function openPDFFile(pdfFilePath){

try{
        var KonyMain = java.import("com.konylabs.android.KonyMain");
        var File = java.import("java.io.File");
        var Intent = java.import("android.content.Intent");
        var Uri = java.import("android.net.Uri");
        var file = new File(pdfFilePath);
        var intentObject = new Intent(Intent.ACTION_VIEW);   
        intentObject.setDataAndType(Uri.fromFile(file), "application/pdf");
        intentObject.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
        var contextObject = KonyMain.getActContext();
        contextObject.startActivity(intentObject);
      }catch(err){
        kony.print("Error in "+JSON.stringify(err));
      }
    }

Friday, 31 August 2018

Kony Objects Service Example Code?


OnlineObjectService  programmatic access to backend data with online


function createDatabObject(){

  var objSvc = kony.sdk.getCurrentInstance().getObjectService("DevDBaccess", {"access":"online"});
  var dataObject = new kony.sdk.dto.DataObject("tbl_register");
  dataObject.addField("name","your name");
  dataObject.addField("username","your username");
  dataObject.addField("password","your password");
  dataObject.addField("phoneno","your phone no here");
  dataObject.addField("address","your address here");
  var options = {"dataObject":dataObject};

  objSvc.create(options,
                function(res){alert("Record created");},
                function(err){alert("Error in record creation");}
               );
}


Kony Integration service call example?



Example : 1

function gblServiceCall(){
  try{

  var inputParams = {};

or 
  var inputParams = {"userid":"111111"};
    mfintegrationsecureinvokerasync(inputParams, serviceName , operationName,successcallbackFunction,errorcallbackFunction);
  }catch(err){
    kony.print("Error Response"+JSON.stringify(err));
  }
}

function successcallbackFunction(code,res){
  
  try{
    kony.print("Response Code : "+code);
    alert("Response Code : "+JSON.stringify(res));
  }catch(err){
    kony.print(err);
  }
}


function errorcallbackFunction(errResponse){
  try{
    kony.print("Response Code : "+JSON.stringify(errResponse));
  }catch(err){
    kony.print(err);
  }
}



Example : 2



function integrationServiceCall(){
  try{
    
    showloadingScreen(); //loading screen
    var operationName =  "your operation name";
    var  data= {"accessToken": "","deviceId": ""};
    var headers= {};
    var serviceName = "Your Service Name";
    var integrationObj =  KNYMobileFabric.getIntegrationService(serviceName);
    integrationObj.invokeOperation(operationName, headers, data, operationSuccess, operationFailurecb);


  }catch(err){
    konyConsole("Exception while occuring : "+printJSONSTRING(err));
  }
}



function operationSuccess(res){
  
  dismissLoading();
  kony.print("Get Country List Service Calling");
  kony.print("operationSuccess Country is "+JSON.stringify(res));
  

  
}
function operationFailurecb(errRes){
  
  dismissLoading();
  kony.print("operationFailurecb Error is"+printJSONSTRING(errRes));
  
  if(errRes.errcode === 1011){
    alert("Device has no WIFI or mobile connectivity. Please try the operation after establishing connectivity.");
  }
}


function showloadingScreen(){
  try{
     kony.application.showLoadingScreen("","Loading...", constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true, null);
  }catch(errLoadScrn){
    kony.print(printJSONSTRING(errLoadScrn));
  }
}

function dismissLoading(){
  kony.application.dismissLoadingScreen();

}







Wednesday, 29 August 2018

How to make auto paging segment using timer?


Auto paging segment using timer in Kony Reference Architecture.

define(function(){

  var count = 0;
  var setDataList = [{
    imgPageViewer : "imgone.png"
  },{
    imgPageViewer : "imgtwo.png"
  },{
    imgPageViewer : "imgthree.png"
  }];

  return {
    onNavigate : function(context){
      this.onbindWidgets();

    },
    onbindWidgets : function(){

      this.view.segPageViewer.setData(setDataList);
      this.onPagerViewrStart();
    },
    onPagerViewrStart : function(){
      try{
        kony.timer.schedule("mytimer12",this.timerFuncsses,8,true);
      }catch(err){
        kony.print("timeStarter : "+JSON.stringify(err));
      }
    },
    timerFuncsses : function(){

      count = Number(count+1);
      if(count>2){
        count = 0;
        this.view.segPageViewer.selectedRowIndex = [0,count];
      }else{
        this.view.segPageViewer.selectedRowIndex = [0,count];
      }
    }
  };

});





Monday, 27 August 2018

Form Controller Structure Example?


Form Controller Structure like: 


Example Step One :- ( Controller Class)

define(function() {

  var _controller;
  var _countryData;
  function _updateUI() {

    /*====
    method to load the data into the Widgets UI
    ====*/
   
    _controller.view.segCountryList.widgetDataMap = {
      "id" : "id",
      "lblCountryName" : "name"
    };

    _controller.view.segCountryList.setData(_countryData);
  }

  function _loadData() {

    var CountryModel = require("countrymodel");
    _countryData = CountryModel.getAll(); 
    konyConsole("Data : "+JSON.stringify(_countryData));
    _updateUI();
  }

  function _bind() {
    alert("binding");
  }

  function onDestroy() {
    kony.print("onDestroy()");    //Cleanup
  }

  function onNavigate(params) { 
    kony.print("onNavigate()");
    _controller=this; //capture reference to controller
    _bind();
    _loadData();
    //retrieve data from model, setup the ui
  }

  return { 
    onNavigate : onNavigate,
    onDestroy: onDestroy
  };
});


//require : controller is :(in require modules) ==> model Class


define(function () {
  /* jshint esnext: true */ 

  var staticData = [   
    { id: 1, name: "India" },   
    { id: 2, name: "France" },   
    { id: 3, name: "Germany" },   
    { id: 4, name: "UK" },   
    { id: 5, name: "Italy" },   
    { id: 6, name: "Chile" },   
    { id: 7, name: "Brazil" },   
    { id: 8, name: "USA" }, 
    { id: 9, name: "Canada" } 
  ];   

  function getAll() {   
    return staticData; 
  }   
  function getById(id) {   
    return staticData.find(country => country.id===id); 
  }   

  return {     
    getAll : getAll,     
    getById : getById 
  };
});





Tuesday, 21 August 2018

Kony Interview Question's and Answer's



1.  What is Kony app lifecycle Events?                                                                           
         An application an activity from is launched and enters into a device's memory to when it is exited and released from memory is referred to as the app's lifecycle.
Set action sequences for the app's lifecycle is :

  • Pre Appinit. Pre-initialization.
    • This event consists of any logic that needs to be executed before the initialization of forms.
  • Init
    •      Is generated by the code and consists of the form and skin initialization data
  • Post Appinit. Post-initialization
    •      This function to define logic that needs to be executed before the first form is shown and after the application is initialized
  • App Service
    •       This function also returns the form handle and launching of background services(launching another form)
  •  Deeplink
    •       Refers to creating services links in your app that enable third-party native and browser applications to connect to your app.  More...
2. Why using Gesture in Kony?
       A gesture is an action associated with movement of a mouse or a touch screen action

        Currently, Kony Platform supports only Tap, Swipe, Longpress, Pan, Rotation, Pinch, and 3D Touch gesture types. 3D Touch is supported only in iOS 9.0 and later

       The gesture methods is : 

              1. addGestureRecognizer
              2. removeGestureRecognizer

3. Widgets types in kony?
 
       Basic Widgets :   
            exp : Alert,App Menu,Button,Calendar,ComboBox and etc...

       Container Widgets :
            exp : FlexForm,FlexScrollContainer,NativeContainer,TabPane and etc..

       Advanced Widgets :
            exp : Browser,Camera,HorizontalImageStrip,Map,ObjectSelector3D,Phone and etc...
    
4. Types of Alerts in Kony?

information - an informative message is displayed on the screen. This message can be in turn a warning or a success message.

confirmation - a confirmation message with Yes and No options is displayed on the screen.

error - an error message is displayed on the screen.

5. what is use of makeAffineTransform function?

           Creates a transformation object that can be used in an animation definition.

  Ex : kony.ui.makeAffineTransform();


6.  Form LifeCycle Event?


6.  Form LifeCycle Event?

1) init 
a) Initializations required for the form. 
b) Init initializes the form and any widgets.
2) preShow 
a) called just before a form is visible on the screen.
3) postShow
a) called immediately after the form is visible on the screen.
4) onHide 
a) called when the form goes out of the screen. A form can go out of the screen when another form is to be shown.
5) onDestroy 

a) called when a form is destroyed.

a) called when a form is destroyed.






A failure occurred while executing com.android.build.gradle.tasks

Error in Kony visualizer V9 service pack 6 and FX11  [2023-01-09 22:23:32.695] [DEBUG] ~~~~ - INFO [exec-shell] Execution failed for task ...