Game Changing Mobility

knowledge engineering blog

Interactive Data-Driven Visualization Using D3.js

We are always having a massive amount of data to deal with today. A visual representation is more perfect to express the data in a more meaningful way.

D3 is a successor to the earlier Protovis framework by Mike Bostock and team. Rather than any other libraries, D3.js allows great control over the final visual result and hence can be considered as a flexible way for data visualization.

What is D3.js?

Based on the data provided, the JavaScript library D3.js, manipulates documents. D3 stands for Data Driven Document. D3 helps us to bring life to data by using HTML, SVG and CSS.

We can certainly point out that D3 efficiently focuses on interactions, transitions and transformations which are making it more impressive and thus providing some awesome features for interactions and animations.

Why D3.js?

D3 is told to be data driven as it can use static data or can convert and use it from different formats like Arrays, Objects, CSV, JSON, XML etc… so as to produce different types of charts. Document Object Model (DOM) can be manipulated according to our data with D3.

More than 1000 different charts of D3.js are available on this site. You can easily look and use them for the different graphs you required and can also make changes in codes to get desired graphs.

How to work with D3.js?

As D3 is written in JavaScript someone who has experience in basic JavaScript coding can easily understand and learn it.

If you use npm you can install it as, npm install d3

To link directly to the latest release, you can copy this snippet on to your code:

<script src="https://d3js.org/d3.v5.min.js"></script>

D3.js Examples

1. Creating Hello world using D3.js

A simple ‘Hello World’ can be displayed with the below code.

d3.select("body").append("span")

.text("Hello, world!");

2. Creating a pie chart using D3

For creating a pie chart, you can follow the below code referenced from this site .

// Create dummy data

vardata = {a:9, b:20, c:30, d:8, e:12}

// set the color scale

varcolor = d3.scaleOrdinal() .domain(data)

.range(["#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56"])
// Compute the position of each group on the pie:

varpie = d3.pie() .value(function(d) {returnd.value; })

vardata_ready = pie(d3.entries(data))

// Build the pie chart: Basically, each part of the pie is a path that we build using the arc function.

svg .selectAll('whatever')

.data(data_ready)

.enter() .append('path')

.attr('d', d3.arc() .innerRadius(0) .outerRadius(radius) )

.attr('fill', function(d){ return(color(d.data.key)) })
.attr("stroke", "black") .style("stroke-width", "2px") .style("opacity", 0.7)

D3.js creating pie chart

3. Creating a directive for D3 when working with Angular

If you are working with Angular you can create a directive that generates a graph and call that directive whenever you need a graph.

Let’s create an angular directive which can be used to generate both the pie chart and the donut chart.

// Import the libraries required

import { Directive, Input , Output , EventEmitter} from'@angular/core';

import { ElementRef } from'@angular/core';

import*asD3from'd3';

// CSS selector that identifies this directive in a template here let’s use it as ‘appPiechart’

@Directive({

selector:'[appPiechart]'

})

exportclassPiechartDirective {

//Define the input and output properties

@Input () chartOption : {};

@Output() piechartUpdated = newEventEmitter<D3.Selection<any, any, any, any>>();

//Create the parameters required

privatehost: D3.Selection<any, any, any, any>;

privatesvg: D3.Selection<any, any, any, any>;

privatewidth: number;

privateheight: number;

privateradius: number;

privatehtmlElement: HTMLElement;

privatepieData: number[];

privatesum: number;

publiccolors:any;

constructor(privateel: ElementRef) {

this.htmlElement = this.el.nativeElement;

this.host = D3.select(this.htmlElement);

this.pieData = [];

this.sum = 0;

}

ngOnChanges(){

this.pieData=this.chartOption['data'];

this.colors=this.chartOption['colors'];

if(this.pieData.length !== 0){

this.setup();

this.buildSVG();

this.buildPie();

}else{

this.host.html('');

}

}

// setup the radius, width and height, here we can provide the outer radius from the component html so that each pie chart be of the required size

privatesetup(): void {

this.radius = this.chartOption['outer_radius'];

this.width = (this.radius *2);

this.height = (this.radius *2);

}

// create the svg to show the pie chart

privatebuildSVG(): void {

this.host.html('');

this.svg = this.host.append('svg')

.attr('height', this.height+40)

.attr('width', this.width+40)

.attr('viewBox', '0 0 '+(this.width+30)+' '+(this.height+30))

.append('g')

.attr('transform', `translate(${(this.width / 2)+7},${(this.height / 2)+ 20})`);

}

// function to build the pie chart

privatebuildPie(): void {

constpie = D3.pie()

.startAngle(1.1*Math.PI)

.endAngle(3.1*Math.PI);

this.sum = this.pieData.reduce((a, b) =>a + b, 0);

constarcSelection = this.svg.selectAll('.arc')

.data(pie(this.pieData))

.enter()

.append('g')

.attr('class', 'arc');

this.populatePie(arcSelection);

}

// Function to modify the pie chart as required

privatepopulatePie(arcSelection: D3.Selection<any, any, any, any>): void {

// Inner radius is defined for the donut chart, in case of pie chart the inner radius will be zero.

constinnerRadius = this.chartOption['inner_radius'];

constouterRadius = this.radius;

constarc = D3.arc()

.outerRadius(outerRadius)

.innerRadius(innerRadius);

// for each of the arc section drawing we are to give different colours.

arcSelection.append('path')

.attr('d', arc)

.attr('fill', (datum, index) => {

returnthis.colors[index];

})

// transition for each arc is provided so as to get better animations

.transition().delay(function(d,i) {

returni * 10; }).duration(1500)

.attrTween('d', function(d) {

vari = D3.interpolate(d.startAngle+0.1, d.endAngle);

returnfunction(t) {

d.endAngle = i(t);

returnarc(d)

}

});

// percentage of the data is shown with the animation on the pie/donut chart for the better understanding

arcSelection.append('text')

.text((datum, index) => { letper = Math.round(this.pieData[index] * 100 / this.sum);return'' + per + '%'} )

.attr('font-size', 12)

.transition()

.delay(1000)

.attr('transform', (d: any,index) => {

d.innerRadius = innerRadius;

d.outerRadius = outerRadius / 2;

return'translate(' + arc.centroid(d) + ')';

})

.attr('fill', (datum, index) => { return'white'; } )

.attr("dy", ".35em")

.style('text-anchor',(d: any,index) =>{

return"middle";

});

this.piechartUpdated.emit(arcSelection);

}

}

Now, as we have created the directive let’s call the directive on the component HTML template of angular. We can call the directive name ‘appPiechart’ within division where we require the chart.

Within the input properties ‘chartOption’ we are supposed to provide the data, colour and radius.

For a pie chart give inner radius as 0.

<divclass="pie-container"appPiechart [chartOption]="{data:pieData, colors:colors, outer_radius:90, inner_radius:0}"id="c2"></div>

D3.js For a pie chart give inner radius as 0.

For a donut chart give value to inner radius.

<divclass="pie-container"appPiechart [chartOption]="{data:donutData, colors:colors, outer_radius:90, inner_radius:55}"id="c1"></div>

D3.js donut chart

 

Conclusion

Easily we could create a pie and donut chart which is animated. Similarly, we can create many more charts with little effort. The wide availability of the different type of animated graph examples of D3 helps to put much effort into creating and modifying for better visualization.

Anusree P

What Makes Katalon a Fantastic Tool for Test Automation

Katalon: The friendly automation testing tool

Today there are many test automation tools available in the market.

But, why do we need an automation tool for testing at all?

What makes use of automation tool a “must-have” in the Software development industry?

In today’s software world, demand for high-quality apps and products within very tight deadlines gives very less time for testers to perform quality testing. It is just impossible to test the complete application/product manually every time there is a bug fix or new releases.

Also, when it comes to testing scenarios like a large number of users access the website or an application simultaneously, it leaves no choice for an organization than to hire several hundred thousand testers (and test machines too) to do a manual test.

However, these challenges can be overcome by a tester or an organization if they choose an appropriate automation tool that fits their testing requirement. Choosing the right automation tool helps in saving resources, time, effort and cost. It can also help in effective testing delivering a high-quality product meeting the deadline and thereby increasing organization revenue and achieving customer satisfaction.

Katalon Studio is one such test automation tool that provides advanced test generation capabilities, faster execution and excellent reporting features. With the evolving features, leveraging in-built features and templates, Katalon is becoming tester’s favourite automation testing tool.

What is Katalon?

Katalon is a free-license automation solution for testing web and mobile application. It is developed by Katalon LLC. Katalon’s first release to the public was in September 2016.

Katalon Studio is built on the open-source automation framework Selenium and Appium. It is a very user-friendly and simple tool with an intuitive interface. Katalon is becoming the number one testing tool in the software testing field. While with other test automation tools, it takes weeks to automate test scripts, Katalon Studio requires just a few hours to achieve the same.

Why Katalon?

What makes Katalon so powerful and unique in comparison to other test automation tools?

The main advantage of Katalon over other automation tools is that it requires very little coding experience.

While several other test automation tools require testers to have technical skills to design test scripts, Katalon Studio’s specialized IDE and simple interface make it very user-friendly for testers who have no prior coding experience. Testers with some development knowledge can use the advanced features of this tool for the automation purpose. Even a black box tester can use this tool efficiently for the automated testing of web and mobile applications.

The time and efforts required to design test scripts are greatly reduced using this tool. Reusability/ scalability aspects are some other major features of Katalon Studio. Katalon makes use of several of Selenium features, you can still leverage the features in Katalon Studio to build your own scripts.

What Makes Katalon a Fantastic Tool for Test Automation

Highlights/Features of Katalon:

  1. Katalon Studio plays an important role in DevOps toolchain. Tests can be easily integrated with CI tools like Jenkins and TeamCity using Console Mode Execution or non-GUI mode in Katalon studio. One can make avail of command-line mode execution by installing the Katalon Studio plugins using Katalon Store’s API keys. This is a very powerful feature supported by Katalon.
  2. Katalon Studio supports dual scripting interface. The black box testers with limited or no coding experience can use its simple interface to create test scripts. The tool has record and playback and manual mode for non-programmers. Katalon Recorder records the test actions, captures the web elements and plays the recorded steps. Testers can play their recorded scripts as many times as they want for their testing. The learning curve is very less as testers do not essentially need any coding experience in this case.
  3. Testers with an advanced level of coding experience can use the scripting mode for test script creation. Those who have knowledge in Groovy can easily edit the test scripts in scripting mode. Katalon Studio allows reuse of these automated test scripts.
  4. The tests recorded in Katalon Studio in one browser can be executed on multiple browsers (in parallel or sequential) speeding up the test cycle thus improving test coverage.
  5. Using its well-structured framework and leveraging built-in features, Katalon Studio enables to provide high-quality applications. For example, Katalon supports parametrizing test objects dynamically which means users can control object dynamically (sometimes the properties of object might change due to business rules). The Test Objects can be handled in both manual mode and in script mode. Katalon provides systematic and neat UI with menus, tree views and tables so that one can organize well their test cases, objects and data files. This makes Katalon well-structured framework.
  6. Features like Spy web utility is a great add-on in Katalon Studio. Using Spy web utility, object properties and locating method can be defined by the user themselves. This makes Katalon an intelligent tool.
  7. While we must use other third-party libraries to generate reports in other automation tools, Katalon provides reports in graphical format. Also, it generates reports in HTML, CSV or PDF format.
  8. Failures are reported with screenshots and logs.
  9. Script creation time is very less when compared to other test automation tools.
  10. Katalon Studio can be launched on Windows, Linux and Mac OS.

Cons of Katalon Studio:

  1. Katalon Studio supports only Apache Groovy for test script creation. However, it supports Java libraries and Java-compatible languages for test script execution.
  2. Katalon is not open source, it has closed source code leaving no option to the community to customize or use community-built packages.
  3. Katalon Studio does not support distributed testing currently.
  4. Katalon Studio is more focused on functionality testing and does not support any load or performance testing.
  5. Katalon Studio supports only web, mobile and API testing and does not support automating desktop application.
  6. Sometimes the tool just slows down and freezes, mobile automation testing takes even more time to record scripts.

Choosing a test automation tool depends on the testing requirement of an organization. If the organization is looking for a tool to test the functionality of their web/mobile applications, Katalon would be the right decision. Katalon Studio mainly focusses on functionality testing, but with very little focus on testing of design aspects like screen size, orientation etc.

Katalon: The future

As the tool is new and in early stages in the market and the features are still evolving, it sometimes throws some bugs and just gets stuck during test script execution. More updates and bug fix releases are expected in future to make it more stable and smooth-running tool.

Also, support to more scripting languages for test script creation would be a great plus.

However, with all the great benefits provided by the tool and with its simple UI, the tool has already won the hearts of testing engineers. In spite of the drawbacks, Katalon Studio is becoming an emerging tool for test automation and is gaining popularity in the software development industry. Overall Katalon is an amazing tool and has a great future.

Susan B John

How to build your first Android App – Easy steps for beginners

Do you know about the abundant opportunities waiting for an Android developer?

Or, have you got any idea that can be transformed into a mind-blowing Android Application?

Are you a Java programmer curious to become an Android developer?

If yes, this article will surely be going to help you.

How to become an Android developer?

If you are someone who has the basic knowledge of coding, you would already know that coding involves a set of procedures. Similarly, there are a few standard steps you should be followed if you want to start coding for Android.

Build your first Android App

Step 1: Download Android Studio

You can download the Android Studio from google or simply clicking here.

Android Studio is the most common IDE for Android development, developed by Google.

But what is IDE?

To program in most languages, you need a piece of software called an IDE or ‘Integrated Development Environment’. IDE is where you enter your code, debug, compile and run. It saves you time and effort.

Android Studio is specifically designed for Android development (unlike Eclipse). You need to include the Android SDK (a selection of tools including the Android platform itself) and the Android Virtual Device, which is an emulator you can test your apps on. During the installation process make sure to tick all boxes to confirm that you want these additional components. It is possible to add them manually later, but that will make the process more complicated.

There are many other alternatives available for Android Studio. Eclipse is an older IDE that can be used for developing apps also for other platforms like iOS. Basic4Android is also an available option.

Step 2: Setting Up Android Studio

Now you have installed Android Studio. But before you get started, you need to install Java on your machine; specifically, the Java Development Kit (JDK).

Java is the programming language you’re going to use for building your Android apps and you need to install the JDK to interpret and compile your code.

You can find the Java Development Kit here. Just download and follow the instructions to install.

Setting Up Android Studio

Now click and launch Android Studio, there will be a menu where you’ll be able to get started or to configure some options. Everything is there already available for you at this point.

Now that you may want to familiarize yourself with the SDK Manager (Configure > SDK Manager) which is where you’ll update your Android SDK to support newer versions.

Android Studio

Step 3: Starting a New Project

After you have installed Android Studio, click on “Start a new Android Studio Project”. Enter the name of your application and your ‘company domain’. These elements combined will be used as your package name (eg: com.companydomain.appname).

The last area to set is the place where you want your project to be saved.

Click on Next to go to your next page of set up. Here you can find more options where you can set the type of device which you are going to develop. As a start choose phone and tablet option. There are other options like TV, Wear and Glass which you can refer later.

Android studio Starting a New Project step 1

 

Android studio Starting a New Project step 2

The next choice you want to make is the ‘Minimum SDK’ which is the lowest version of Android you want to support. Leave this option with default.

Next Page provides you with the option to pick how your app wants to look at the start. This will be the main page of your application which in other words called as the ‘Activity Module’. This screen will provide you with many templates for creating your first page of the app.

Now let’s start coding…

You are expecting a “HELLO WORLD”, right?

But unfortunately, Android Studio has already done it for you.

MainActivity.java and activity_main.xml

Ok, I think you have noticed that there are two files. MainActivity.java and activity_main.xml

While creating a new project android studio creates a default java class(You can delete it and create a Kotlin class with extension .kt . Kotlin is included as an alternative to java). The program logic and UI updation (Data Binding will update UI when value changes. Don’t look at this now, it will make things complicated. It can be studied later) are done.

So how we design the User Interface?

We have an XML file (activity_main.xml) where we design the UI. Down the left, you can also find an option called ‘widgets’ that you can add to your app. This makes the process of designing UI a simple task. You can drag and drop widgets and views.

Now you can start making your app. You will get a million samples on google. Before that please go through the project structure.

Project Structure

Manifest folder

This folder containsAndroidManifest.xml. This file describes all the components of your Android app like the activities, services, broadcast receivers, and content providers that the application is composed of.

AndroidManifest.xmlJava folder

All your Java language files are organized here. The java folder contains three subfolders:

com.example.android.firstapp (or the domain name you have specified): This folder contains the Java source code files for your app.

res folder

All the resources of your app like images, layout files, strings, icons, and styling are present in this folder.     It includes these subfolders:

  • drawable: This folder is used to store all your app’s images.
  • layout: The layout files for your activities are contained in this folder. In the beginning, our app has only one activity that has a layout called “activity_main.xml”.
  • mipmap: It is the folder which contains applications launcher icons.
  • values: All the strings and colours used in the app are contained in this folder.

Gradle

This is a ‘build automation tool’ which mainly helps Android Studio to turn all those different files into one single APK. You are free to leave Gradle to do its thing by its own most of the time. However, you may need to jump into the build.gradle files at times, when you want to allow additional features for your app, add a new ‘dependency’ at build.gradle file. Sometimes, if things stop working, you can choose Build > Clean Project and this will essentially guarantee where all the files are and what their roles are. Generally, there will be two of these Gradle build files, one for the whole project and one for the ‘module’ (the app).

Build android app Gradle

Run Android App

Now it’s time toRun Your App. You can run your app in an emulator or an Android device.

Step 4: Things to remember

Here are some practices we need to keep in mind.

Always try on new things. Don’t try to make a world-changing app in the beginning. Instead, think of something simple and straightforward, and then build on that. Try changing the layout of the text or try adding in more buttons and more rules to make your app useful.

It’s time to look a bit at the code and write something. Practising along with learning the theory is the best way to learn coding.

Official Android website provides us with options to code while learning. For this, go to official Android Website and navigate to Develop.

There are two most important sections:

  1. Training – you can find there a lot of helpful examples. Before you try out some real programming, go through all these lessons.
  2. API Guides    – I know it will be hard to go through all these texts,    descriptions, and examples. But, trust me, doing so really worth it. And, it is very important.

You are very lucky to have an assistant like Google with you. It offers you solutions for any problems you are having. But Ask correctly! You’ll find a list of complicated answers but eventually, probably on Stack Overflow, you will get the right answer.

What you should do next is, you copy that code and paste it into your app, making changes that are necessary as you go.

Likewise, take Android Studio and try out some of the code samples available. Just see how they work and experiment by changing each component. Things will go wrong and error messages will pop up frequently in the beginning. But for the most part, if you just follow the instructions, it’s easier to handle such error.

And, that’s pretty much how you learn to make apps. Once you have the main program in place, the rest you can pick up as you go.

Step 5: How to Get Better

Stay UpToDate!

Now you may have a doubt. Here I am sharing a few links that will help you in your journey to becoming a better Android developer.

Developing android app the future

  • Android Weekly – Every week lot of interesting Android contents and articles are published here. Don’t miss it, Subscribe it!
  • AndroidDev Digest – Subscribe to get a lot of interesting articles and more.
  • Fragmented Podcast – Talks about becoming a better Android developer with a lot of very interesting people from the world of Android.
  • Android Developers Backstage podcast – If you are an Android developer, this is going to be one of the most interesting shows for you. This show features in-depth discussions and interviews with engineers on the Android team at Google. This show is hosted by developers from the Android Engineering team.
  • Android thread on Reddit – It covers news, codes, information and observations more directly from Android developers all over the world.
  • Android Developers blog – It is a blog that covers some interesting texts written by             Android Engineers from Google.
  • Subscribe official Android Developer’s Youtube Channel – This channel is also created and maintained by Android Developers at Google.

 You Can!

Reading theories, learning new things and practising regularly will make you a good Android programmer, maybe the best one in the industry. So, don’t give up, errors will come, search for a solution, find it, and solve the errors with the help of the solution you have found.

Nithin K M

Machine Learning – Principles and Applications for the beginner

Have you ever wondered what machine learning is?

If yes, you just came to the right place.

Even I had no idea about machine learning a few months ago. My interest in machine learning developed when I saw a documentary on the latest trends in robotics. Ever after, my idea of machine learning keeps on getting simpler.

What is Machine learning?

Wikipedia says

 “Machine learning is the ability of a computer to learn and act accordingly without being explicitly programmed”.

Well, that is just the technical explanation of machine learning.

Let’s look into a much more simpler one.

Humans learn everything from their past experiences whereas computers follow instructions for doing the same task. For a computer to acquire such instructions a human should have knowledge about the same. Think about a situation where computers can also learn from past experiences and act more faster!!! This precisely is called machine learning.

What is machine learning

Machine learning is an application of Artificial Intelligence. Machine learning concentrates on the development of computer programs that can teach themselves to grow and change when exposed to new data. Since we are living in a technically emerged era, there are plenty of examples of machine learning in our daily life.

For example, let’s take the case of Google Maps. Google maps help you to analyse the time required to reach your destination based on current traffic. Also, in case of heavy traffic, Google Maps redirects you through another route which helps you to reach your destination at lesser time. This can be considered as the best example of machine learning. Let’s have look at how machine learning works with google map.

Google maps

 

Google maps use a combination of people currently using the app, historical data of the route collected over time and a few other tricks. Everyone using maps is providing their location, the average speed and the route in which they are travelling which in turn helps Google collect massive data of traffic which helps them predict the upcoming traffic and adjust your route accordingly.

User vs speed in machine learning

Above depicted is a graph which is plotted on the basis of the number of users at a location versus speed of the user. When the number of users using maps are on one specific location and the speed of the user is slow, we can conclude for heavy traffic and redirects another route. Google maps keep on analysing such situations and keeps on improving their data.

Types of Machine learning

Machine learning can be mainly categorized into three different types.

Types of machine learningSupervised Learning

Supervised learning is the simplest form of machine learning.

Supervised learning uses labelled data to train the modal. This type of learning always has an input variable X and an output variable Y. We figure out an algorithm to get a mapping function from the input to output. In simple words, y = f(x)

supervised learning

Whenever you get a new input data x, the machine can easily predict the output y for the data. The result of supervised learning can be continuously predicted by the machine.

For example, let’s take Siri, Alexa or Google Assistant. Each one of these is a voice automated system which collects your voice and starts working based on this collected data.

Biometric attendance is another common example of supervised data from our day to day life. Here, the system first collects data of our fingerprints, retina scan or even face recognition and trains the machine with this data. And hence, it will validate our biometrics.

Unsupervised Learning

Unsupervised learning always has input X but we cannot directly predict the output Y.

They have unlabelled data for output calculation. They are important because they allow the machine to self-analyse and develop an output from the collected bulk data.

Unsupervised learning clusters input data into classes of statistical properties. Clustering and Association are the two most important concepts in unsupervised learning.

For example, consider cases of online shopping sites like Amazon, Myntra or Flipkart. When we add an item like mobile to their cart, they will suggest products people brought together with that mobile and also its similar product recommendations. This is possible by continuous observing of order details of customers and clustering such data.

Unsupervised learning

Another example of unsupervised learning is Google maps which we already discussed earlier. Google maps also form two clusters where one is with high traffic and other normal traffic.

Reinforcement Learning

Reinforcement Learning works on the principle of feedback. This type of learning is all about taking decisions sequentially. There should be an initial state of input which leads to output and the next input depends on the output of the previous input.

Reinforcement Learning

Google Survey in Google Photos is the best example of Reinforcement Learning. Google photos identify a face and groups all photos of that same face together. For this, Google photos first collect all of the images of that face and ask the user if they are all of the same people. Thus, it gets into a conclusion and groups all photos with the same face.

 Summary

 Machine learning is now the hottest trend. This will provide enormous hopes for building Artificial Intelligence. Sophia, the first social humanoid robot developed by Hong Kong is one of the first major achievements of machine learning and artificial intelligence.

Sharoon Shaji

How to Start Your Android Development Journey

The mobile industry is one of the fast-growing industries. Among them, 75% are Android users.

People using smart-phones demand application with better performance and regular updates for apps they are using, which in turn is a huge scope for android mobile application development.

How to Start Your Android Development Journey

Beginners who have some basic programming knowledge can start developing android application even if they don’t have any application development experience. It is not necessary to join any Android application development course. Start by finding and following some good online tutorials on the internet.

There are many reasons to choose Android as a platform for application development. Such as;

  • Android is open source
  • It is easy to Learn
  • Fastest growing technology
  • Size of the market
  • Job prospects

Open-source

Android is an open-source platform. Developers can leverage it to develop applications with different look and feel. Manufacturers can change it according to their needs and add functionalities to their phones to make them different from other phones in the market. Since it is open source, even you can download the source code and make your own android application.

Easy to Learn

It is easy to code on Android. Someone who is having basic programming knowledge can easily develop an android application. There are lots of online websites available from where you can study android app development for free.

Fast growing technology

Nowadays, mobile technology has almost all the features and capabilities to cut down the number of desktops and laptops usage. Modern smartphones and tablets are able to offer real means of computing-on-the-go for almost all types of business and personal requirements.

Size of the market

The number of available apps in the Google Play Store was most recently placed at 2.6 million apps and it is increasing day by day. Google Play is a huge and powerful market for Android apps. one who makes an app can be easy to sell their product through Google Play at free of cost.

Job prospects

As a result of an increase in android mobile users, Android developers are being hired in all sectors. An average person spends 3 hours a day in his/her smartphone making payments, online shopping, playing games, and on mobile applications. Nowadays Android apps are available for almost everything. Every business is developing its own mobile apps to improves sales and customer satisfaction and as a part of their marketing strategy. Websites are being vanished as a result of mobile apps.

How to Start Your Android Development Journey

  • Android Core Concepts
  • Official Android Training Guides
  • Download Android Studio IDE
  • Try some coding Official Android Training Guides
  • Stay up to date

Android Core Concepts

As someone who is going to develop an Android mobile application for the first time, you must have some basic idea about bellow concepts.

  • Activities
  • Fragments
  • Layout XML Files
  • Intents
  • Services
  • Sensors

Activity

Activity is the screen that the user interacts with. In an application, there will be one more activity. For example, we can consider login screen as an activity and when login gets success the user goes to another activity.

Fragments

A fragment is a part of an activity. We can think fragment is like an independent part of a modular UI component attached to an activity. Since a single fragment can be used in many activities, Fragments are reusable.

Fragments

Layout XML file

Activities, fragments, and some ViewGroups can use XML files to define their layout and contents. we can create our UI using XML code. Android studio provides an XML editor along with preview functionality.

XML Android development

Intents

Intents are the messaging system by which one activity is able to launch another activity.

Intent Android development

Services

Android services are used to perform background tasks. We can create apps that work on the foreground as well as in the background. Services are used to create apps that work on the background. An alarm is a good example of service, as it always runs in the background when we set an alarm.

Sensors

Android devices contain different types of sensors like Accelerometer, Gyroscope, Magnetometer, GPS, etc. We can access all these sensors programmatically and we can link with our application. For instance, we can access GPS for getting a position in our app.

Official Android Training Guides

The official training (https://developer.android.com) guide for Android developers from Google is extremely useful for any beginner developer. It has plenty of code examples and covers almost everything. They provide everything you needed to become an excellent android application developer. They also properly update their documentation if they replace any functions or elements with newer ones.

Official Android Training Guides

Download Android Studio IDE

Android Studio is an integrated development environment (IDE) that is used for building apps on every type of Android device. We can refer to the official website for download and installation of an android studio. It is also important that you need a high-end PC for the proper working of android studio.

Android Studio IDE

Try some coding

After the successful installation of your android studio, you can try some basic coding. Every new project on android studio is by default a sample app (Hello world). There are many websites out there having many numbers of sample tutorials. Just start with simple projects.

Stay up to date

Technologies are changing day-by-day. So, staying up to date with the latest trends is important. Google updates everything with the Android and they publish on their official site. We can update it from there. Staying up to date with the latest developing trends would be very helpful in starting a new project or refactoring an old one.

Conclusion

Android applications can be developed by anyone who is having a basic knowledge of programming. The Android development industry today offers an outstanding career for anyone who is enthusiastic in coding and help them to contribute to the field of technology innovation and application development.

- Dyenal Dinesh

Solutions: most dangerous mobile security threats of 2019

Prevention of mobile security threats helps organizations and individuals to protect their devices, apps, users and content from malicious attacks. Security teams can prevent these threats by using an app that scans devices and configurations within the network, or by setting up security protocols in case malware is present on the network.

Solutions: most dangerous mobile security threats of 2019

Cryptojacking attacks

Check these steps to minimize the risk of your organization falling into a trap

  1.     Install an ad-blocking or anti-crypto mining extension on web browsers.

Since crypto jacking scripts are often delivered through web ads, installing an ad blocker can be an effective means of stopping them. Using ad blockers like the Ad Blocker Plus can easily detect crypto mining scripts. Experts recommend extensions like No Coin and MinerBlock, which are designed to detect and block crypto mining scripts.

  1.      Keep your web filtering tools up to date.

If you identify a web page that is delivering crypto jacking scripts, make sure your users are blocked from accessing it again.

  1.      Maintain browser extensions.

Browser extensions are meant to make our tasks simpler. But, some of them could be a trap set by an attacker to execute crypto mining scripts.

  1.    Use mobile device management (MDM) solution to better control users’ devices.

Bring-your-own-device (BYOD) policies for preventing illicit crypto mining. An MDM solution can help to manage apps and extensions on users’ devices. MDM solutions tend to be geared toward larger enterprises, and smaller companies that often can’t afford them. However, experts note that mobile devices are not as at risk as desktop computers and servers. Because they tend to have less processing power, they do not produce a great deal or profit for hackers.

Insecure Communications

Here is a list of few best practices to be used for Android phones which may bring down risks related to insecure communication.

Understand that the network layer is highly capable of eavesdropping, thus making it insecure.

  • It is important to apply SSL/TLS to transport channels used by the mobile app to transmit sensitive pieces of information, session tokens, or other sensitive data to a backend API or web service.
  • When an application runs a routine via the browser/WebKit, using outside entities for third-party analytics companies and social networks could be more secure. Mixed SSL sessions should be avoided as they could expose the user’s session ID.
  • Always use a strong, standard cipher suites with suitable key lengths.
  • Use certificates signed by a trusted CA provider.
  • Do not pin certificate for security conscious applications and never allow using self-signed certificates.
  • Always require SSL(Secure Socket Layer) chain verification.
  • Always establish a secure connection with trusted certificates from keychain after verifying the identity of the endpoint server.
  • Build a UI that alerts users when a mobile app detects an invalid certificate.
  • Avoid sending sensitive data over alternate channels (e.g, SMS, MMS, or notifications).
  • Apply a separate layer of encryption to any sensitive data before it is given to the SSL channel. In the event of a possible vulnerability in the SSL implementation, the encrypted data will provide a secondary defence against confidentiality violation.

Mobile Ransomware

  • Only install applications from authorized stores like Google Play or AppStore. To be sure that no application makes its way onto your device from an untrusted source, go to Android settings, choose Security, and make sure that the “Unknown Sources” box is not checked.
  • Regularly check updates for your installed applications and your device OS. You can choose to update all installed apps automatically. It’s better to do update the system to the latest version as soon as an over-the-air (OTA) update arrives.
  • Install a strong security solution. Downloading apps from only the official stores and updating them regularly alone will not promise maximum security. Malware can lurk into even Google Play and, can also spread by means of exploit kits using yet-unknown vulnerabilities.

Phishing attacks

  • Think Before You Click!
  • Keep Your Browser Up to Date
  • Keep Informed About Phishing Techniques
  • Check Your Online Accounts Regularly
  • Use Firewalls

SMS –based Attacks

  • Think before you click a link from SMS
  • Do not open spam messages
  • Keep informed about phishing techniques

Botnets attack

To avoid system compromises, it is advised to use only licensed and genuine software. Keep your mobile updated with latest security patches. Install anti-malware solution and update it regularly. Disable Autoplay /Autorun for removable drives.

Always protect your device from Trojans and other threats by using effective anti-malware software.

User & Device Authentication

  • Think before allowing store passwords, and your data in mailing apps and browsers

Remember there is no single fool-proof way to avoid mobile security threats.

Habeeb Rahman

References

1 . Wikipedia (https://www.wikipedia.org)

2 . Medium (http://medium.com)

3 . Quora (https://quora.com)

Most dangerous mobile security threats of 2019

Smartphones are widely used across the world today, hence the security threats are also widely spread.

Our phones have become the most connected devices, at the same time the least secure. The security threats we face are those which we fail to notice and will be more hazardous in the near future.

Let us look at some of the major security threats that every mobile user must be aware of.

Most dangerous mobile security threats you should avoid at any cost in 2019

Cryptojacking

Cryptojacking is defined as the secret use of your smartphone device by the attacker to mine cryptocurrency.
Cryptojacking used to be confined to the victim unknowingly installing a program that secretly mines cryptocurrency.

When using browser there is no need of a separate program to do the In-browser crypto jacking.

How cryptojacking works

  1. The threat actor compromises a website
  2. The crypto mining script executes when the user connects to the compromised website.
  3. Users unknowingly start mining cryptocurrency on behalf of the threat actor
  4. When successfully adding a new block to the blockchain, the threat actor receives a reward in cryptocurrency coins.

Insecure Communications

The networks that you use to communicate are never fully foolproof, making your device vulnerable to attacks from malware. There are chances that hackers tend to set-up fake access points when you access WiFi in public places such as coffee shops, airports, etc. The access points are named using nonexclusive names, which can fool even the most brilliant people.

It is always good to be cautious when connecting to public WiFi. Use public WiFi only if extremely required and never use it to access personal information like bank account access etc.

Mobile Ransomware

A form of ransomware which affects only mobile devices is called mobile ransomware.

A cybercriminal uses mobile malware to steal sensitive data from smartphones or attempts to lock a device, before demanding payment to return the data to the user or to unlock the blocked device. Sometimes people may find some innocent content or some software through social networks, which they download accidentally and get tricked into downloading some malicious ransomware.

After the malware is downloaded onto a device, it will ask the user to pay an amount before encrypting files and locking the phone. After the payment is processed online, often via Bitcoin, the ransomware will send a code to unlock the phone or data.

While installing any app, make sure the app is downloaded from Google Play or App Store than from any third-party app stores.

Phishing attacks

A social engineering attack often used to steal user data, including login credentials and credit card numbers is called Phishing.

It occurs when an attacker fools the victim into opening an email, instant message, or text message by acting as a trusted entity.

User can play smart by not clicking any unfamiliar email links. Always enter URLs manually as much as possible.

SMS –based Attacks

From the email world, the phishing has evolved into the SMS world. You get SMS texts and links that you are asked to open to authenticate certain information. To any novice user, the links and the sender would seem genuine. However, clicking on these links can make your device vulnerable to the attacks, and in turn, give away your confidential information. This is a developing security threat for your mobile device.

Botnets attack

A botnet is just a short form for the terms “robot” and “network”.

A botnet is a number of web-connected devices, each of which is running one or more bots. Botnets can be used to perform distributed refusing of service attack (DDoS attack), send spam, steal data, and allows the attacker to access the device and its connection.

A botnet attack firstly requires creating numerous botnets or a botnet army. Once the attack is initiated, these botnets are used to send network/Internet-based requests to the target system in a large quantity. These requests can be in the form of bulk email messages to simple ping messages. The attack can slow down the network/server, making it busy or unable for others to access it or temporarily freeze the server.

Distributed denial of service (DDOS) is a common example of a botnet attack that utilizes a number of botnet devices to send a large number of simultaneous requests/packets to the targeted system.

Installing effective antivirus/anti-malware software can protect your device from such attacks.

User & Device Authentication

Most mailing apps have provided the user & device authentication, which has allowed the user to store passwords, and their data on the devices. If the device is stolen, your authentication and the data will be at risk. This is one of the major threats to mobile devices, as they contain our valuable personal pieces of information.

The smartphone is a device that blurs the boundaries between professional and personal life and the users are up to three times more likely to be the victims of mobile threats. Safe browsing, identifying suspicious files or phishing emails, ensuring safe data access at public Wi-Fi networks, safe downloads are some of the important tips that a user must be careful about. Other than these security measures, several mobile security software is available to download from Google Play and App Store to ensure safety in your mobile devices.

Understanding these common security threats and implementing recommended solutions can help you protect data in your smartphone.

Habeeb Rahman

Performance Testing using JMeter

If you’ve ever done performance testing on a website, you know that there is not really an effective way to manually create enough load on that website.

Getting actual users to execute web application operations over and again is nearly impossible. For that, we need virtual users that can open multiple connections in parallel.

When bulk users attempt to access a website (say commercial websites) at the same time, there are high chances that the website suffers slowness and poor usability. Speed is one of the most important attributes of an application. A slow running application will lose many of its potential users.

Performance testing is done to ensure that the web application performs well under their expected workload.

Performance Testing using JMeter

In today’s competitive world, support for features and functionalities are not the only priority, the speed with which the website responds is also of great concern. The goal of performance testing is not to find bugs, but to eliminate the performance bottlenecks. A web application attributes like its response time, reliability, source usage and scalability do matter a lot. So, in order to test different aspects of a web application, we must test it in different ways. Different performance testing types are as follows:

Different Types of Performance Testing

Load

Load testing is performed to determine how a system behaves when multiple users access it simultaneously.

Stress

Stress Testing is done to ensure that the system would not crash in difficult situations.

Endurance

Endurance testing is done to evaluate how the system behaves when a significant load is applied over a long period of time.

Spike

In Spike testing, the web application is tested with extreme increments and decrements in the load.

Volume and scalability

Volume testing describes the ability of an application to handle additional user loads without affecting the performance. Scalability test is done to find the minimum and maximum loads at software, hardware and database levels. This gives the idea that the system is scalable after a load.

There are many robust testing tools available in the market that are capable to handle the various types of performance testing. Few of them have become the industry standard. The recent trend shows that most of the big players in the industry have taken tools like JMeter for all their performance testing needs.

jmeter

JMeter

Apache JMeter is a load testing tool that is based on Java. This open source software is used for testing the performance of most of the web-based applications. Performance is an inevitable factor for both mobile and web application as the user strength is very huge.

Advantages of JMeter

  • Open source and built in Java platform. It is highly extensible and platform independent.
  • User friendly- JMeter has got comprehensive GUI and it can easily create a test plan and configure the elements.
  • Support- Basically JMeter is designed for performance testing. But it can also be used for non-functional testing such as stress, distributed and web service testing by creating a test plan.

JMeter provides support for protocols such as FTP, SOAP, JDBC, HTTP

  • Documentation- Because of its robust documentation, user can have a clear idea on every step starting from the installation and configuration of test settings and generating the final report.
  • Recording- JMeter allows the user to record HTTP or HTTPS to create test plan using the recording facility. It uses a proxy server that allows JMeter to watch and record user actions while the user browses the web application with any normal browser. Once the recording is complete, we enter the number of threads, time and Start test. It is advisable to use the Non-GUI mode of JMeter if the user count is large.
  • Reporting- JMeter supports dashboard report generation. These reports help the user to understand test execution results.

Installation of JMeter

 Before installing JMeter, it is essential to check that Java is installed in the system. JMeter is a pure Java desktop application. It needs fully compliant JVM 6 or higher to perform its tasks. User can download and install the latest version of the Java SE Development Kit.

The latest version of JMeter available is JMeter 5.1

JMeter can be downloaded from the official website Apache.

From this website, user can download JMeter PGP or zip file under the Binaries section and then unzip the zip file into the directory where JMeter is to be installed. JMeter directory structure includes the following directories and files.

  • Bin: holds JMeter script file to start JMeter
  • Docs: holds JMeter documentation files
  • Extras: related extra files
  • Lib: holds the required Java library for JMeter
  • Lib/ext: includes core jar files for JMeter and its protocols

A test plan is stored in XML format.

Elements of JMeter

Thread Group

Thread group is the collection of threads. Each thread represents 1 user using the application under test. Basically, each thread simulates 1 real user request to the server.

elements of Jmeter

Samplers

Samplers indicate which type of request is sent to the server. It can be HTTP, FTP, JDBC requests.

Listeners

Listeners display the result of test execution. It can show the result in different formats such as tree, table, summary report, log files and graphs.

Configuration Elements

Config elements in JMeter are used to configure the sampler requests sent to the server. Commonly used config elements are CSV data set config, HTTP Cookie Manager, Login Config Element HTTP Request Defaults and FTP Request Defaults.

Assertions

It is used to validate the response of the request that the user sent to the server. Here user can verify the expected result with the actual result. If a user wants to check assertion of a sampler, then assertion must be added as child of that sampler. User can view Assertion result by adding Assertion Listener to the thread group.

Testing in non-GUI method

In non-GUI mode, JMeter can handle more requests per second. Increasing threads after a certain limit will result in JMeter crash in GUI mode. The following command is used to run the test plan in non-GUI mode.

jmeter -n -t <test JMX file> -l <test log file> -e -o <path to output folder>

Report Generation

A result log file can be generated in CSV or JTL format after running the load test.

Hope this article gave a real insight into the importance of performance testing in today’s web world and how modern testing tools like JMeter helps you to execute performance testing efficiently.

Happy Performance testing!

- Sneha Mohan

5 Trending React Native UI Components in 2019

Every software companies always tend to have an increasing interest in cross-platform applications since they have dramatically reduced the amount of resources required to build mobile apps.

React Native applications stands at the top when comes to cross-platform apps.

React native UI components

React Native has tremendous possibilities in designing the user interface of an application.

The main time-consuming process for building an app is its user interface. Many third-party libraries and UI toolkits are now available to help you build next level react native application.

Let’s see some possibilities of React Native UI designs.

1.NativeBase

NativeBase is the most popular and widely used library. It provides a wide range of cross-platform UI components for react native.

Nativebase is 100% open source.

One of our main goal with NativeBase 2.0 is to make it easy to theme the components with very little changes to the components themselves.

Nativebase are built with blocks called components. The Components are constructed in pure React Native platform along with some JavaScript functionality with a rich set of customizable properties. They are constructed in pure React Native platform along with some JavaScript functionality with a rich set of customizable properties. These components allow you to quickly build the perfect user interface.

Native base UI components

Building a button using normal react native code on left and with NativeBase on right

NativeBase includes components such as anatomy of your app screens, header, input, buttons, badges, icon, form, checkbox, radio-button, list, card, actionsheet, picker, segment, swipe-able list, tabs, toast, drawer, thumbnail, spinner, layout, search bar etc.

Each of these components in NativeBase is made with a better version of the same component in its native part.

After finding out about NativeBase we found ourselves using it in every app we develop.

For example, we used it in various screens in Referr app, a mobile application that helps users to win points and gift cards by recommending local businesses to their friends and family. Titles of every screen were made with NativeBase  { Header, Title }. This helped us in saving a lot of time and effort.

React native UI Referr app

We use NativeBase Header component in Referr to make a better feel in UI and to reduce time and effort.

 2. React Native Elements

 React Native Elements is another cross-platform react native UI toolkit. It is completely built in Javascript and is very much easy to use. React Native Elements also supports Expo. Every component in react native elements is customizable. You can change the basic colour, size, fonts etc. for each component.

React native elements component

With React Native Elements, coding becomes much simpler. If you want to create a button component, it is as easy as the below code.

 import { Button } from’react-native-elements’;

 <Button

     title=”Solid Button”

/>

React Native Elements also gives a wide collection of icons. It has all the social icons that a developer needs in the current scenario.

 3. React Native Material UI

 React Native Material UI provides highly customizable material design components for React Native. To make more customized components, React Native Material UI is using a single JS object the uiTheme. By default, it is a light theme that can be changed easily.

React native material UI

Installing React-native-vector-icons helps to unveil the full potential of React Native Material UI.  React-native-vector-icons has wide support for icons. It helps to easily change the primary colour of the application.

 4. UI Kitten

UI kitten react native UI component

React Native UI Kitten is a mobile framework with a set of easily customizable elements. Despite there are a lot of standalone react-native components nowadays, there are not so many frameworks that offer you a wide set of commonly used components as a single dependency with similar UI design.

For instance, in Web Development there are CSS frameworks like Bootstrap that allows you to add dozens of nice-looking elements. You can also style them according to your corporate guidelines by just changing variables.

UI Kitten framework attempts to fill this gap.

All components are flexible and can be customized. It aims at boosting your mobile application development and allows you to focus on business logic instead of view composition. It helps you to bring your MVP to life in a shorter period of time.

Using React Native UI Kitten you will be able to create style configurations of components that you use the most (buttons, inputs etc.). These styles can be reused then in the process of development. Configure them once and use anywhere!

For example, below code showcases how to build a button using UI kitten.

import{RkButton }from’react-native-ui-kitten’;

 render( ) {

  return(

    <View>

       <RkButton> Click me! </RkButton>

    </View>

  )

}

 5. Nachos UI

Nachos UI kit

 Nachos UI is a React Native component library. It has almost 30 customizable UI components. Nachos UI Kit is coded with Avocode which is a fully featured tool to share, hand-off and inspect Photoshop and Sketch designs.

Nachos UI also works on web with the help of React Native Web. It also has Prettier which is an opinionated JavaScript formatter. It also uses Jest Snapshot Testing. Nachos UI is so easy to use. For example, let’s look into an example of building a simple slider.

 import { Slider } from ‘nachos-ui’

 const Example = ({ value, handleOnChange })  =>  {

  return (

   <Slider

       value = { value }

       onValueChange = { handleOnChange }

   />

   )

 }

Conclusion

For every developer, his main aim is to build his application with impressive UI in a limited time frame. When I stepped into React Native, a most difficult milestone for me to pass was to build the user interface for an application. Because this took me a lot of time and effort to offer my client an effective solution with a mind-blowing interface. But now, with these predefined and customizable UI components, the styling of the user interface is made a lot easier. I suggest you should try at least one of these UI components in your next project.

Sharoon Shaji

 

What are the advantages of Kotlin over Java?

Kotlin vs java has been one of the hot topics of debate for the last few years.

Ever since Kotlin was released in February 2016 programmers have been having doubts about which language to use for Android development.

Kotlin vs Java

Java has been around for a very long time. It is being used by millions of programmers worldwide but had some minor drawbacks. Then Google introduces a new language specifically for android which is said to be better than Java.

Last year, Kotlin has been made a ‘first class’ language for Android development by Google in addition to existing support for Java and C++. The impact of Google’s decisions for adopting Kotlin can be seen from GitHub’s findings.

The number of GitHub notes and contributors using Kotlin for projects has more than doubled over the last couple of years.

I’ve been making android apps using Java for about 4 years now and, I learned Kotlin just three months ago. While making an app in Kotlin, I quickly understood that there are many advantages of using Kotlin over Java.

Advantages of Kotlin over Java

Readability

Comparing to Java, Kotlin has more readable and precise code which makes it easier to understand the program. After a small learning curve, a Java developer can easily understand how to write Kotlin very quickly.

After learning Kotlin I observed that it needed much less code than Java as shown below

Java

Java readability

Kotlin

Kotlin Readability

As we can see, Kotlin reduces boilerplate as compared to java. Now, boilerplate refers to those codes which must repeat lots and lots of times and which do not serve any purpose to the functionality of the application. Kotlin has been designed in a way that it eliminates the need for boilerplate code.

Kotlin requires fewer lines of code as compared to java.

In Java, we must create references for views using findViewById. In Kotlin, that is taken care of automatically, therefore, reducing the lines of code drastically. That makes it easier for a beginner to learn Kotlin.

Null-Safe

Null pointer exceptions also referred to as “The billion-dollar mistake”, is one of the most common errors that cause apps to crash if you are using Java.

Kotlin is null-safe by default. It does not allow variables to be assigned with a null value. But in Java, we can assign null values to variables and, it may lead to null pointer exception that may crash the application.

Using Getters and Setters

In Java, we have to use getter and setter functions for receiving data from variables in the modal classes. Model classes are just used for holding data. We can use the getters and setters for accessing the data from model classes.

Using getters and setters

In Kotlin we don’t need all those getter and setter functions. We can access all the data’s using the variable name itself. See the example below.

Kotlin getters and setters

This modal class in Kotlin only has to define the variables instead of also defining the getter and setter methods. While comparing the above two images, we can clearly see that Kotlin uses less code as compared to java.

Interoperability

Kotlin language is interoperable. This means that both Java and Kotlin are somewhat similar and we can use java commands and Java libraries in a Kotlin project.

Since Java is still being used by most programmers, Kotlin has been made to be interoperable. It can be used with existing Java classes and won’t cause any errors. The compiler will allow the code containing the Java and Kotlin classes to work flawlessly.

Because of this feature, developers can transition from Java to Android with ease.

Immutability

An immutable object is an object whose state cannot be changed once it is created.

In Kotlin variables are defined using val or var to help developers easily understand which values can be reassigned.

Using val in our code makes it super clean and will be able to safely assume that the properties will never be changed and that they will not be null. The benefit is that it allows you to just get on with the project at hand.

Conclusion

I can confidently say, Kotlin language is far better than Java for Android development as it takes care of the drawbacks Java has. Moreover, the transition from Java to Kotlin is easy and anyone who is interested in programming can make good progress within a short span of time.

- Benedict Thomas

« Older posts