Sunday, December 30, 2018

Tuesday, December 18, 2018

NFI and FFI Difference

NFI(Native Function Integration) programming code for application has been created in native(android application).we can access through the native package to  Kony. (like predefined Program). AAR if a full package with UI all widget created in Kony as like JSON obj. FFI (Foreign Function Integration) jar contains functionality.we have to insert it in kony third-party ...

Thursday, December 13, 2018

Calender widget Validation

//Type your code here function SdateLoad(){   var today = new Date();   var dd = today.getDate();   var mm = today.getMonth()+1; //January is 0!   var yyyy = today.getFullYear();   if(dd<10) {     dd = '0'+dd;   }   if(mm<10) {     mm...

Sunday, December 9, 2018

component: add it programmatically?

refer:https://basecamp.kony.com/s/feed/0D56A00000Rb7MCSAZ Sample Code using Tabs component: var tabs = new com.konymp.tabstextline( { "clipBounds":true, "id": "tabstextline", "isVisible": true, "zIndex": 1 }, {}, {}); Form1.flx.add(tabs); ...

Wednesday, December 5, 2018

Without contract / with contract in components

1) Masters 1.0 (Now deprecated) No controllers 2) Components without contract Always has controller Instances always show complete widget hierarchy as in source No custom events All properties can be overwritten in instance 3) Components with contract Always has controller Instance doesn't show any hierarchy (unless explicitly exposed) Custom events Control over what properties can be overwritten...

Tuesday, December 4, 2018

How to take IOS build in kony

 How to take ios build in Xcode (Kony) ? 1.Take IOS build (KAR file is generated). 2.Add latest plugins from visualizer (path:  visualizer ->open file location -> plugins -> search(ios plugin and copy)). 3.Transfer plugins(we get plugins as JAR file [Rename as .Zip])...

Monday, December 3, 2018

Segment expandable view single row only open at the time sample

var gblHfd =""; function onrowclickofseg(){   var cisshow;   var selectedIndex= frmQA.Seg.selectedRowIndex[1];   if(frmQA.Seg.selectedRowItems[0].flxQA2.isVisible === true){     cisshow = false;     //gblHfd = "";   }else{     cisshow = true;     //gblHfd = selectedIndex;   }   if(gblHfd !== ""){     var obj1 = {"flxQA1":{isVisible:true},"lblQ":{isVisible:true,text:"Explain...

Saturday, December 1, 2018

How to create SQLite Database & access with in Kony

Before refer below code check: SQLite_App its easy to understand /***************************************************************** Name    : createDB Purpose : To create the database with employee_details table  ******************************************************************/ function...

Friday, November 30, 2018

Expandable row with section header in segment

Create  segment: function Dynseg2(){   var objsec1 = {"flxSection":{skin:"sknlblhdr"},"lblshirtbrand":{isVisible:true,text:"Fruits"},"imgplus":{isVisible:true,src:"vision.png"},"btnplus":{isVisible:true}};    var objsec2 = {"flxSection":{skin:"sknlblhdr"},"lblshirtbrand":{isVisible:true,text:"Chocolates"},"imgplus":{isVisible:true,src:"vision.png"},"btnplus":{isVisible:true}};  ...

Thursday, November 29, 2018

Question & answer like segment row expandable view

function onrowclickofseg(){   var cisshow;   var selectedIndex= frmQA.Seg.selectedRowIndex[1];   if(frmQA.Seg.selectedRowItems[0].flxQA2.isVisible === true){     cisshow = false;   }else{     cisshow = true;   }      var obj = {"flxQA1":{isVisible:true},"lblQ":{isVisible:true,text:"Explain...

Tuesday, November 27, 2018

Add list data in dynamically

var Receiverdetail = {}; function addMngrlist(){   var SessionId =  kony.store.getItem("usersessionid");   var serviceName = "Listoutbyusertype";   var serviceType = "online";   var objSvc = kony.sdk.getCurrentInstance().getObjectService(serviceName, {"access": serviceType});   var objectName = "";   var dataObject = "";   if(kony.store.getItem("sessionuserLogin").usertype...

basic coding standard

Widget Prefix HBox hbx VBox vbx TabPane tbp Tab tab Label lbl Button btn Browser brws TextBox txt TextArea txa Calendar cal ComboBox cmb ListBox lst CheckBoxGroup chk RadioButtonGroup rbt Link lnk Line lin Image img MenuItem mnu Segment seg ImageGallery igl HorizontalImageStrip his Phone phn Camera cam Switch swt PickerView p...

Using finger touch with this function

function isAuthUsingTouchSupported() { var status = kony.localAuthentication.getStatusForAuthenticationMode(constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID); if(status == 5000) {             alert("Touch ID for FingerPrint Sample "); authUsingTouchID(); }   else { var msg = "Touch ID is not configured on this device.Authentication returned a status ::"+status; ...

Monday, November 26, 2018

common alert syntax with sample

function validated(){ if(frmTest.text1.text === null || frmTest.text1.text === "" || frmTest.text1.text === undefined || frmTest.text1.text === " "){ CommonAlrt("Please Enter text"); } } function CommonAlrt(response) { var basicConf = {message: response,alertType: constants.ALERT_TYPE_CONFIRMATION,alertTitle: "Sample Alert",yesLabel:"yes", noLabel: "no", alertHandler: alertres}; var pspConf = {}; var...

Over basic widget from get value and doreset it

var arrlist =[]; var OnSelecteddate = false; function validte(rsponse){   if(rsponse === null || rsponse === "" || rsponse ===" "|| rsponse === undefined){     return true;   }else{     return false;   } } function OnValidateDetail(){   if(kony.store.getItem("AUDetails") !== null){     arrlist = kony.store.getItem("AUDetails");   }   if(validte(frmRegistor.txtName.text)){  ...

Gesture swipe using method and functions

function myTap(myWidget,gestureInfo) {         alert(" single finger double tap Gesture detected"); } function myTapp(myWidget,gestureInfo) {   alert("double finger single Tap Gesture detected"); } function mySwip(myWidget,gestureInfo) {    if(gestureInfo.swipeDirection === 1){     alert("Swiped left");   }   else if(gestureInfo.swipeDirection...

App basic API with function sample

//Type your code here function getcurfrm(){   alert(kony.application.getCurrentForm().id);   return false; } function getprefrm(){    alert(kony.application.getPreviousForm().id);   return false; } function getshowload(){   kony.application.showLoadingScreen("sknloading","Loading...",constants. LOADING_SCREEN_POSITION_ONLY_CENTER, false,true,{enableMenuKey:true, ...

NFI deep link sample

function NFIfunctiondeep() {   try{     var intent = java.import("android.content.Intent");     var KonyMain = java.import("com.konylabs.android.KonyMain");     intent = KonyMain.getAppContext().getPackageManager().getLaunchIntentForPackage("com.orgname.NadikaKart");     KonyMain.getAppContext().startActivity(intent);   }catch(error)   {  ...

Search by WIDGET in segment

function getSearchResult(mData, searchValue) {   if(ArrayofRequestlistseg !== null){     var arr3 =[];     arr3 = ArrayofRequestlistseg;     var length = arr3.length;     var sData = [];     for ( i = 0; i < length; i++) {       if (arr3[i].lblToMangerEmpId !== null || arr3[i].lblToMangerEmpId !== undefined) {    ...

Map function

function getPosition(){   try{     var positionoptions = {timeout: 15000};     frmMap.mapaddress.zoomLevel=15;     kony.location.getCurrentPosition(successcallback, errorcallback, positionoptions);   }catch(error)     {       alert("error"+error);     } } function successcallback(position){   try{   var lat = position.coords.latitude;  ...

Kony call function

function call() {   try{ var Intent = java.import("android.content.Intent"); var KonyMain = java.import("com.konylabs.android.KonyMain"); var uri = java.import("android.net.Uri"); // var launchIntent = getPackageManager().getLaunchIntentForPackage("com.orgname.firstLogin"); var intent = new Intent(Intent.ACTION_CALL); intent.setData(uri.parse("tel:" + ___________));//change the number KonyMain.getAppContext().startActivity(intent); }catch(err){  ...

show in pic Image tag

function img(){   var rawbytes = frmRegistor.cameraid.rawBytes;   var base64Str = kony.convertToBase64(rawbytes);   frmRegistor.imageshow.base64 = base64Str;   frmDetailofRegistor.imageofuser.base64 = base64Str;...

Kony Store using for array store

Set value in kony store setitem: var obj ={ "Uimg":frmRegistor.imageshow.base64,"Uname":frmRegistor.txtName.text,"Upw":frmRegistor.txtPW.text,             "Ucpw":frmRegistor.txtCPW.text,"Ugender":frmRegistor.rbtGender.selectedKeyValue[1],"Udob":frmDetailofRegistor.lblADOB.text,             "Uaddress":frmRegistor.txABOX.text,"Uskills":a,"Urichtext":frmRegistor.rchtxtBox.text,  ...

Kony loader Operation

Show: function getshowload(){   kony.application.showLoadingScreen("sknloading","Loading...",constants. LOADING_SCREEN_POSITION_ONLY_CENTER, false,true,{enableMenuKey:true, enableBackKey:true, progressIndicatorColor : "ffffff77"}); } Dismiss: function gethideload(){   kony.application.dismissLoadingScreen();...

Kony Popup Operation for device show

Show Popup: function OSDinfo() {    var deviceInfo = kony.os.deviceInfo(); for (var key in deviceInfo) {               if(key === "version"){                  DeviceinfoPopup.LlblVersion.text =deviceInfo[key];                  }          ...

Kony Timer

Set Function: //nested function function setcall1(){   i = 0;   frmtimer.lbltimer.text = i+" secs"; } Call back Function: function timerFuncCallBack() {   alert("innovike"); kony.timer.setCallBack("mytimer12",setcall1); } Callback Cancel Function: function timercallbackcancel() { try { kony.timer.cancel("mytimer12"); } catch(err) { alert("error in second button onclick...

Fetch data from basic widget and show it on Segment

Call it while Submit form button: function OnValidateDetail(){   if(kony.store.getItem("AUDetails") !== null){     arrlist = kony.store.getItem("AUDetails");   }   if(validte(frmRegistor.txtName.text)){     alert("Please enter username");     frmRegistor.txtName.setFocus(true);     return false;   }   if(validte(frmRegistor.txtPW.text)){  ...

How to specific row add in segment for section

var Arr =[]; var OBJarr =[]; var i = 0; var Dumarr =[]; function subdat(){   if(validate(frmAdmin.txtPname.text)){     alert("Please enter product");     frmAdmin.txtPname.setFocus(true);     return false;   }   if(validate(frmAdmin.txttype1.text)){     alert("Please enter size option");     frmAdmin.txttype1.setFocus(true);  ...

function for Arithmedic calculator

function ArithCalc(){   var CtxtArea = frmCalc.txtOutput.text;   var arrplus = CtxtArea.split('+');     var arrminus = CtxtArea.split('-');     var arrDivide = CtxtArea.split('/');    var arrPercent = CtxtArea.split('%');      var arrMul = CtxtArea.split('*');  //alert(parseInt(arrminus[0]) - parseInt(arrminus[1]));   if(arrplus.length...

Call Multiple button in Button click

var index = 0; function onClickCallBack() {     //Write your logic here.   //Defining the button with onClick:onClickCallBck. index +=1; var btnBasic ={id:"Onbutton", isVisible:true, skin:"sknbtn1", focusSkin:"btnCancel", text:"New Button" + index}; var btnLayout ={containerWeight:100, padding:[5,5,5,5], margin:[10,5,5,5], hExpand:true, vExpand:false, displayText:true}; var btnPSP...

Chart create by Code

function chartview() {   var chartObj = kdv_createColumnChartJSObject();   var chartWidget = new kony.ui.Chart2D3D({     "id": "chartid",     "isVisible": true   }, {     "widgetAlignment": constants.WIDGET_ALIGN_CENTER,     "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,     "containerWeight": 100   },    ...

Create Timer on button click

function timerFunc(){   var da = new Date();   frmProfile.lblDatetimeshow.text = da.toLocaleTimeString(); } var INtrue = false; function itimerStart() //nested function {   var d = new Date();   if(INtrue === false){     frmProfile.LblDateIn.text ="";     frmProfile.LblDateIn.text = d.toDateString();     frmProfile.lblStatusshow.text ="IN";  ...

Flex Menu Creation form App

var Ibool = true; function showsidebaritem(eventobject) {   function SCALE_ACTION____e241c9bdb7514fbea4bcbd4a7b0e59a6_Callback() {}   if(Ibool === true){     kony.application.getCurrentForm().FlxMainMenu.animate(       kony.ui.createAnimation({         "100": {           "stepConfig": {          ...

Validation using regular expression in Javascript

Validation is an essential process in any mobile or web applications where we use forms. So I am sharing some ideas on how to do some basic validations ion Javascript using regular expressions. As this is for Javascript, there won't be much changes in other languages also. Some regular expressions for basic validations. "/\d/g"             : For matching any...