Sunday, 21 January 2018

How to Add Images or raw files in Kony Visualizer?

     
          While designing an application, you will have the need to use images, videos, and other media in a form. To do so, you copy the media to a specific folder in the Workspace and then use the appropriate widget to insert the media in a form. You can see what media are a part of your project on the Assets tab of the Project Explorer. You can also specify media for a specific channel and then use them in your application.
      
 After adding media to an images folder, to see them reflected in Kony Visualizer, refresh the list of media assets by clicking the Refresh Folders icon located on the top left corner of the Assets tab in the Project Explorer.
This topic covers the following subjects:

Naming Conventions for Images

This section explains the naming convention you should follow while naming the images. The allowed characters in the image file names are:
  • Lowercase alphabetical characters
  • Note: The image name must start with a lowercase alphabetical character.
  • Numerical characters
  • Underscore (_)
  • Period (.)
Important: Do not use spaces in your image file names. Also, do not use any reserved words or keywords as the file names for the images.
If an image file has an invalid file name or is not a PNG file, Kony Visualizer does not list it in the Images folder of the Assets tab. You will want to be sure to use the following conventions when naming image files:
Valid File NamesInvalid File NamesRemarks
myicon.pngMyicon.pngContains an uppercase character.
icon2.pngicon_2.pngContains an underscore.
accntsummary.pngaccnt&summary.pngContains a special character.
accountdetails.png2details.pngBegins with a number.
companylogo.pngcompany logo.pngContains a space.
flightstatus123.pngcontinue.pngContains a JavaScript keyword.

Common. The media assets stored here are available across all the channels (mobile and tablet applications) and modes (native and web).



Mobile. The media assets stored here are available for all mobile devices.
Common. The media assets stored here are available for native and web applications.
Native. The media assets stored here are available only for native applications.
Web. The media assets stored here are available only for web applications.



Videos :-



Sunday, 14 January 2018

How to do list Devices and View Logs in Android Device Monitor?


List Devices and View Logs

To List the Android devices connected to the Windows 10 PC, do the following:
  1. Navigate to C:\Users\USERNAME\AppData\Local\Android\platform-tools.
  2. Open a command window.
  3. Run adb devices -l to list the Android devices connected to the Windows 10 PC.
To connect to an Android device on your Windows machine, do the following:
  1. Navigate to C:\Users\USERNAME\AppData\Local\Android\tools
  2. Run monitor.bat and click on the connected device.


Videos : 



How to control the brightness of the Android screen in Kony Application using NFI

define({

  onNavigate : function(objectEvent) {
 
    this.view.btnPermissions.onClick = this.onRuntimePermissions;
    this.view.sliderValum.onSlide = this.onSlideEvent;

  },
  // Give the permission to allow to access the Write settings
  onRuntimePermissions : function(){

    var Intent = java.import("android.content.Intent");
    var Uri = java.import("android.net.Uri");
    var KonyMain =java.import('com.konylabs.android.KonyMain');
    var  Build = java.import("android.os.Build");
    var Settings = java.import("android.provider.Settings");
    var Acontext = java.import("android.content.Context");
    var context = KonyMain.getActivityContext();

    //Call Write Settings Pages to allow permission to change the brightness
    Intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
    Intent.setData(Uri.parse("package:" + context.getPackageName()));
    context.startActivity(Intent);

  },

   //Widget Slider function callback function
  onSlideEvent : function(slider) {
 
    var slidingValue = this.view.sliderValum.selectedValue;
    var intValue = parseInt(slidingValue);
    this.setScreenBrightness(intValue);
  },

  //To control the brightness of the Android screen
  setScreenBrightness : function(brightnessValue) {
 
    var Settings = java.import("android.provider.Settings");
    var KonyMain =java.import('com.konylabs.android.KonyMain');
    var context = KonyMain.getActivityContext();
    // Change the screen brightness change mode to manual.
    Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
    // Apply the screen brightness value to the system, this will change the value in Settings ---> Display ---> Brightness level.
    // It will also change the screen brightness for the device.
    Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, Number(brightnessValue));
  }
});


Videos :



Wednesday, 10 January 2018

How to get the Android IMEI Number for Dual SIM slot

This API returns the unique ID of a device



Kony API ;

1. Sync : 
          kony.os.getDeviceId(int slot)
 
Notes :

  1.        If your application is running on a device with an operating system earlier than API level 23, the API returns "Null.".
  2.        Invalid slot indexes that are not supported by a device are ignored and the API returns "Null."
  3. The API returns "Null" on some devices, such as tablets, where Telephony Manager is not available.


function getMyDeviceIDFunc(){
      var imeiNo1= kony.os.getDeviceId(0); // param is sim 1 slot 
      var imeiNo2= kony.os.getDeviceId(1); // param is sim 2 slot 
   kony.print("The device ID of the first SIM slot is: " + imeiNo1); 
   kony.print("The device ID of the Second SIM slot is: " + imeiNo2); 
 
 }





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 ...