Game Changing Mobility

knowledge engineering blog

Month: July 2019

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