Architecture for IoT applications.

Architecture for IoT applications.

Architecture that’s built to heal.

If you are not aware of the software architecture then go through this tutorial Software architecture. In this tutorial, we are gone through software architecture, not the hardware architecture & electronic device connectivity.

What is IOT?

Before going into the what is IOT let me tell one story that we all know? The story of blind men & elephant originated in the Indian subcontinent. It is a story of a group of blind men (or men in the dark) who touch an elephant to learn what it is like. Each one feels a different part, but only one part, such as the side or the tusk. They then compare notes and learn that they are in complete disagreement. The same thing with IOT we did.

The internet of things (IoT) is the internetworking of physical devices, vehicles (also referred to as “connected devices” and “smart devices”), buildings and other items — embedded with electronics, software, sensors, actuators, and network connectivity that enable these objects to collect and exchange data.

— wikipedia

If you overlook the definition, then we say there is nothing new it is just the stack of technologies which you already familiar. So someone says it is sensor programming, embedded programming, big data, machine learning, map reduce, etc. And one seeing man come and say this is NOT (this is the elephant).

The term “The Internet of Things” was coined by Kevin Ashton in a presentation to Proctor & Gamble in 1999. Ashton is a co-founder of MIT’s Auto-ID Lab. He pioneered RFID use in supply-chain management.

Now you are aware of what is IOT & software architecture. Then let us combine both things.

How we define IOT application architecture?

For defining architecture I will not go into the electronic & hardware part, I will keep you at the software stack and How we will need to arrange the software technologies as part of our dream IOT product.

This is just the blocks I arranged. Let us discuss in brief. We will explain from bottom to top.

  1. The bottom & core part of IOT application is the sensors and electronic devices that are able to connect to things & grab the data from it.

2. The sensor collects the data but that we need to convert it into understandable format & connect those sensor devices using some protocol that we need to configure here in layer two and also filter data i.e put some threshold for your data for taking a smart decision.

3. Network connectivity, connect your device with wireless connectivity or internet wired connection. This connectivity is changed based on context & domain.

4. We can say this layer as a security layer or application abstraction layer or data abstraction where we can apply security to our product. This layer position should be changeable based on the domain & How we want to apply abstraction to our application.

5. At this stage, we will persist our logic, use this data for taking a smart decision or for reporting purpose. This is the important layer, where our actual product & business logic comes into the picture.

6. This layer where we can say its presentation layer or decision was taken layer. Based on the requirement we can display reports or applying machine learning or some custom logic and takes a smart decision and send a signal back to the sensors.

7. This is where our God exists. For whom we are designing this whole product. The user interacts with this layer. This is the UI layer.

This is the brief description about we can arrange the blocks to design our IOT product.

IOT is simply connectivity of application, device and data.

For the more technical way, we can understand the same architecture.

There are number IOT device vendors & service provider every one has there own SDK & different protocols also there is a number of ways to connect a device to a network.

For more technical, I have designed simple IOT architecture using the Java stack. Here What we are following architecture for our use case.

On the left side is our sensors or core part of our IOT application.

Define architecture is art. There is a number perspective which is needed to be considered while designing architecture. This is a simple & general perspective to design IOT application architecture. Internet of Things for Architects.

This is just an idea. Dig deeper find more & let me know as well.

For more stories.

Lets connect on Stackoverflow , LinkedIn , Facebook& Twitter.

Android for a smart device.

Android for a smart device.

For more stories.

Android Things is Google’s new OS for smart devices.

What is Android Things?

If you can build an app, you can build a smart device.

Android things are Google android based IOT (Internet of Things) platform. Android things have android os stack with additional support for IOT. Google IO 2015 google announced Brillo & Wave for IOT.

Android things pushed the boundaries of android mobile os to work on hardware peripheral devices & drivers.

Overview of Android Things.

Android things platform is android based but this is different from the Android mobile OS. Below image describes the overview architecture of Android things. Android Things provide you the ease & power of Android. Enhance your device with google & android things.

Don’t reinvent wheel, build autonomous vehicle.

Android things platform come with Android SDK, Google services Java API F/W with things support a library. If you are already familiar with android or java then download preview version & build your own IOT device.

Android Things is an additional plugin in Android stack, don’t worry to learn from scratch just take few minutes & build it.

Use android infrastructure? Why we have to use Android Infrastructure?

Android is built in a mature platform for device program. Android is available for mobile, watch, TV, car and know for devices. The best part of Android Things development is very similar to traditional Android mobile development and involves writing apps using the Android framework with android studio IDE and tools. You need is a development board flashed with the Android Things OS and the required peripherals for your device.

Though Android Things devices will be able to integrate with Android (and or other ) devices, they would do so through Weave, a related but distinct communications system that Google launched alongside Brillo back in 2015.

The hope is that experienced developers will be able to quickly adapt, get up to speed and start work on a new product.

Android is now every where isn’t it? Arduino kit.

Advantages of Android Things.

  1. Open source.
  2. Android ecosystem.
  3. New APIs for IOT devices.
  4. Google API & services are build in.
  5. Trusted Security.
  6. The power of google at fingertips.

Getting started Android Things.

Build you first APP.

To download system image & test application.

Make Hands dirty with more sample.

Go through the Android things Github page https://github.com/androidthings.

This is just trailer. Go deeper find more & let me know as well.

If you enjoyed this article, please don’t forget to Clap.

For more stories.

Lets connect on Stackoverflow , LinkedIn , Facebook& Twitter.

Future of global transaction BlockChain.

Future of global transaction BlockChain.

For more stories.

It is a game-changing technology!! It attempts to describe the outline of the blockchain.

From last few years, I work in the finance domain. Major in m-commerce, e-commerce, banking application & payment gateway integration. My friend asked me, you told me every bank is connected, e-money, digital world & how it is easy to purchase, sale & do the payment within a fraction of second, then for cheque deposit why it will take 2–3 days. Why claiming insurance takes time? Why for stock market settlement it will take 2–3 days. I told him some satisfactory answer & he satisfies, but I was not satisfied with my answer, and I was looking for a solution, then I encounter BlockChain.

Blockchain What is it?

Ref from a wiki. “A blockchain originally, block chain — is a distributed database that maintains a continuously-growing list of records secured from tampering and revision. Each block contains a timestamp and a link to a previous block”.

The blockchain is the new hot technology. If you haven’t heard about it, you should be knowing about Bitcoin that’s enough. It is a design pattern made famous by bitcoin, but its uses go far beyond. The blockchain is naming itself has explanation no need to explain more.

The blockchain is a technology for a new generation of transactional applications that establish trust, accountability, and transparency while streamlining business processes. I come to this technology when I encounter the TED talk which is really worth to watch it.

The block chain is a shared public ledger on which the entire Bitcoin network relies.

For sake of understanding, blockchain is a shared business ledger, So ledger contains the transaction details such as date of transaction, transaction name, transaction to whom, by whom, etc. Ledger is always growing.

Distributed ledgers, i.e. a list of transactions that is replicated across a number of computers, rather than being stored on a central server.

Generally, blockchain has two types.

  1. Public Blockchain:– Anyone, without permission granted by another authority, can read, write data. Bitcoin use underlying public blockchain.
  2. Private Blockchain:– Only trusted a user can read, write data. It’s private blockchain.

How Does BlockChain work? (Less is more.)

Why we should worry about it?

The blockchain is managed the global transaction in a ledger and it almost works on every type of transactions such as money, assets, property, contracts, identity, energy, art, votes, bonds & stocks. This is limitless. It also reduces the fraud, corruption because every transaction is recorded is distributed ledger. Across the country, banking is very easy by using the blockchain.

Who is using it?

Major companies are working on it, such as you know popular bitcoin, ethereum, abra app.

Banks and other financial institutions have also been active in investing (time and/or money) in this space.

What are the benefits?

  1. Protecting rights through immutable records.
  2. Creating a true sharing economy.
  3. Enabling the remittance rip-off
  4. Enabling citizens to Protect privacy.
  5. Ensuring compensation for the creators of value
  6. Empowered the users. Users control all transaction & data.
  7. The blockchain is complete, consistent, timely accurate & widely available.
  8. Fault tolerant, durable because of decentralized networks, blockchain does not have a central point of failure and is better able to withstand malicious attacks.

If you are open source lover. If you want to do some open source contribution in blockchain.

Hyper-ledger open source project. https://www.hyperledger.org/.

Open world Principle

  1. Collaboration
  2. Transparency
  3. Sharing
  4. Empowerment

Blockchain is future of money. Not physically only logical transformation.

The blockchain is not only affected by the financial domain, but there are also many more other domains below is the list & companies trying to harness the power of the blockchain.

  1. Banking:- e.g vault os new banking model.
  2. Payment & money transfer:- e.g bitcoin, abra app.
  3. CyberSecurity:- e.g. writes Goldman Sachs, Guardtime
  4. Academic records:- e.g Holbertson School
  5. Voting:- e.g Follow my vote
  6. Car leasing & sales:- e.g Docusign,
  7. Networking & IOT:- e.g IBM & Samsung have been working on a concept ADEPT(Autonomous Decentralised Peer-to-Peer Telemetry), Filament another one.
  8. Forecasting:- e.g Augur decentralized predication market.
  9. Online Music :- e.g MyCelia, Ujo music
  10. Ride Sharing :- e.g Lazooz
  11. Stock trading :- e.g TØ.com
  12. Real Estate :- e.g Ubiquity
  13. Insurance :- e.g Stratumn
  14. HealthCare:- e.g Gem Health, Tierion
  15. Supply Chain Management:- e.g Provenance, Fluent, Skuchain
  16. Cloud Storage :- e.g Storj
  17. Energy Management :- e.g Transactive Grid
  18. Sports Management :- e.g Jetcoin Institue
  19. Gift Card & Loyalty:- e.g Gyft, Chain
  20. Government:- e.g GovCoin Systems

There is a lot more to explore in the blockchain, there is only the outline of it.

Reference:– Blockchain Revolution book.

https://www.blockchain.com/

For more stories.

Let’s connect on Stackoverflow, LinkedIn, Facebook& Twitter.

Interactive Java (REPL) shell.

Interactive Java (REPL) shell.

For more stories.

When I started learning about the python I encounter with the interactive shell, which is a really cool feature to explore the API, prototyping then I feel why it is not in Java. But the answer is here. JDK 9 come with project kulla. What is the goal of project kulla? Master in Java9

The goal of the Kulla project is to investigate the creation of a
Read Evaluate Print Loop (REPL) tool for the Java programming
language.

When my friend ask me why you love Java. I told them Java is rich. There is a native way to REPL (Read-eval-print loops). If you want to checkout quickly the System.out.print(“Hello world”); then you have to create a separate project. JShell has emerged a powerful tool introduced in JDK9.

JShell is playground, on playground you can play cricket, football or whatever you want.

JShell is deeply integrated with JDK. JShell is tightly integrated with the Java compiler and Java virtual machine, JShell enhances the programming experience for the Java language. You can test your code as you create it, and way before you are done with your whole project. JShell is simple UNIX shell it will read instruction set, evaluate them & present the outcome.

JShell’s Advantages.

  1. It reduces the Java learning curve
  2. Start expression rather with classes.
  3. Immediate feedback & easy understanding.
  4. Explore new API, experiment, instantly get a result.
  5. Incrementally write complex code.

JShell takes two kinds of inputs

  1. Java code “Snippets” — snippet is small chunks of code.
  2. JShell Commands.

Experience without theory is blind, but theory without experience is mere intellectual play.

Let’s experience the JShell & interact with the project kulla. Get your hands dirty.

For downloading the JDK9 click here.

For mac os multiple JDK path. Please go through this.

  1. Download latest JDK build
  2. set the Java_Home path & check java version

3) Open terminal/ command prompt type jshell.

If Jshell not open then I have a trick for mac os redirect to the below path

/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/

The world is your playground. Why aren’t you playing? Let us play.

Let’s play and enjoy. If you are the wrong jshell will give you the meaningful message. Please look below message ” it created variable all, it cannot be referenced until class lists are declared”.

You can declare, define & call a method from jshell.

JShell Commands

List of JShell commands

/help — to get the list of commands.

| /list [<name or id>|-all|-start] — list the source you have typed

| /edit <name or id> — edit a source entry referenced by name or id

| /drop <name or id> — delete a source entry referenced by name or id
| /save [-all|-history|-start] <file> — Save snippet source to a file.
| /open <file> — open a file as source input
| /vars [<name or id>|-all|-start] — list the declared variables and their values
| /methods [<name or id>|-all|-start] — list the declared methods and their signatures
| /types [<name or id>|-all|-start] — list the declared types
| /imports — list the imported items
| /exit — exit jshell
| /reset — reset jshell
| /reload [-restore] [-quiet] — reset and replay relevant history — current or previous (-restore)
| /classpath <path> — add a path to the classpath
| /history — history of what you have typed
| /help [<command>|<subject>] — get information about jshell
| /set editor|start|feedback|mode|prompt|truncation|format … — set jshell configuration information
| /retain editor|start|feedback|mode — retain jshell configuration information for subsequent sessions
| /? [<command>|<subject>] — get information about jshell
| /! — re-run last snippet
| /<id> — re-run snippet by id
| /-<n> — re-run n-th previous snippet

| intro — an introduction to the jshell tool
| shortcuts — a description of shortcuts

For example ‘/help intro’.

Then play and enjoy. Thanks for reading.

If you found this post is helpful, recommend it to others.

For more stories.

If you enjoyed this article, please don’t forget to Clap.

Software Architecture What, Why & How ???

Software Architecture What, Why & How ???

For more stories.

What is architecture ?

Architecture is arranging the blocks in modular, structured manner. Architecture is Art & architect is the artist.

Everything required architecture, it is not rocket science. Every one is the architect in a day to day life. In our house we are arranging our material, books, kitchen tools anything that we arrange in well manner is architecture. The shopkeeper arrange shop. Anything arranged in modular & structured manner is architecture.

Architecture is an art, so in art we have patterns & styles. The styles & patterns are changed based on the context, domain, and problem.

As per the Wikipedia which defines software architecture as “the set of structures needed to reason about the system, which comprise software elements, relations among them, and properties of both.”

Good software architecture is describe the applied patterns, layers or tiers which are used to define the clear separation of concerns of your business.

Why it is required ?

Less Is More. The WhatsApp Architecture Facebook Bought For $19 Billion.

As stated by Microsoft, “The goal of architecture is to identify the requirements that affect the structure of the application. Good architecture reduces the business risks associated with building a technical solution.

Architecture must be like switch, plug & play. Business is ivy it grows, just you need to manage. Good architecture is easy to understand & cheap to modify.

The success of business is depend on the architecture.

Benefits of architecture.

Benefits which we always curious about it. Without benefits there is no business.

Below are the benefits you will get if you fallow the architecture styles & patterns.

  1. High Productivity.
  2. Better maintainability.
  3. High adaptability.
  4. Makes It easier to reason about and manage change.
  5. Secure & Scalable.
  6. Deliver higher quality in lower cost.

Architecture defines set of rules and constraint that are specific to the system or project. Architecture enables the quality attribute of the system or we can say it defines the quality with every action.

How we design a good architecture ?

To become a expert we need to practice. Practice for perfection.

There are some important principles need to be consider while designing architecture.

  1. Common sense :- (What is it ?) is a basic ability to perceive, understand, and judge things.
  2. The system should be built to change instead of building to last.
  3. Learn from your past experience & current technology trends.
  4. There’s more way than one to do it. ( It is useful to find the optimise solution )
  5. Understand the end user context & business domain.
  6. Follow the Design patterns & styles.
  7. Follow coding best practices.
  8. Understand the business module, sub module, consider component & layers (tiers ) to abstract them & identify the key interfaces.
  9. Use iterative approach while designing architecture.

Software architecture & Software design are two different thing don’t mix them. Software architecture is skeleton while software design is meat.

Software architecture is more about the higher level & software design is more about there component, class or modules.

Software architecture patterns e.g MV* pattern & software design patterns e.g DAO, Factory.

Any software architecture has two key components.

  1. Architecture Patterns :- It defines the implementation strategies of the components.

2. Architecture Style :- It actually defines the components & connectors.

” Life is better when things are made for good. “

Software Architecture Category

  1. Communication
  2. Deployment
  3. Domain
  4. Structure

There is lot more to explore in software architecture. Would like to hear your suggestion, inputs on this post.

For more stories.

Lets connect on Stackoverflow , LinkedIn , Facebook& Twitter.

Android CI & CD

Android CI & CD

For more stories.

What the heck is that you may ask?

Before started explaining What is what? Let us introduce today’s era buzzword DevOps. What is DevOps? Thanks for such a great article. Please go through it.

This term is not specific to android only. They are generic we can use them with any of the technology.

Working on the big organization and enterprise app development. Working with large teams in an agile process it could be very hard to track the development progress, code integration, code review & deployment process. Always learn from the past experience that’s the best way to gain the experience and improve your self.

A great development workflow will make your good developers great, and your great developers exceptional. A bad workflow will take your best engineers productivity down to a junior level and make wish he worked elsewhere.

Grady Booch first named and proposed CI in his 1991 method

Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early. CD is Continuous Deployment or Delivery.

By integrating regularly, you can detect errors quickly, and locate them more easily.

CI & CD is for the large enterprise & especially product based companies.

By adopting both Continuous Integration and Continuous Deployment, you not only reduce risks and catch bugs quickly but also move rapidly to working software.

With low-risk releases, you can quickly adapt to business requirements and user needs. This allows for greater collaboration between ops and delivery, fuelling real change in your organization, and turning your release process into a business advantage.

Pros of CI & CD

  1. CI reducing the risk & Overheads
  2. Defects are detected & fixed sooner
  3. Analysing & Reporting
  4. Automated Testing, you can do pre-commit & post-commit testing, pre-deploy, post deploy testing.
  5. Code control, code versioning
  6. Prevent wrong commits, missing file & resource while committing code.
  7. It will reduce efforts, time & money.
  8. Build automation
  9. Deployment Automation.

How we will achieve the same for the Android?

Note :- The process I explained it for the Gradle based project build tool.

There are different tools

On server machine you have to install Android SDK, Jenkins Server, Gradle Project build tool.

Configure Jenkins for CI & CD.

  1. Install plugins in Jenkins Gradle, git & android emulator plugin (if you want to use an emulator).
  2. For Continuous delivery add Google Play Android Publisher Plugin.

Configure Jenkins there is two tutorial from code path. Please go through it.

If you enjoyed this article, please don’t forget to Clap.

For more stories.

Lets connect on Stackoverflow , LinkedIn , Facebook& Twitter.