Posts

ES7 brings two new features

ECMAScript 2016 (more commonly known as ES7). ES7 brings two new features: 1. Array.prototype.includes() 2. New exponential operator: **. Array.prototype.includes() We used .indexOf() to know if an element existed in an array. For example: ['my','dad','hates','me'].indexOf('dad')  // 1 // I know it sounds confusing but the value 1 represents // the index at which the string 'dad' appears in the array. The key word is “exist.” .indexOf() is fine if we want to know at which index a given element appears. But if our goal is to know if a given element exists in an array, then .indexOf() is not the best option. And the reason is simple: When querying the existence of something we expect a boolean value, not a number. Array.prototype.includes() does exactly that. It determines if a given element exists in an array, returning true if it does, false otherwise. var life = ['mom', 'dad', 'brother'] ...

The Arrival of Digital Home

What is DLNA ? DLNA stands for “Digital Living Network Alliance”. It's a way for multimedia devices to communicate with each other on a local network. DLNA-compliant devices can stream local video, audio, and picture files to each other over your network. It’s a way for your TV to stream videos from your media server and your smartphone to act as a remote that can play a file from one device on another device. That’s the idea behind DLNA. How DLNA Works DLNA-certified devices use UPnP — Universal Plug and Play — to discover each other on your network and communicate. DLNA divides devices into different classes. For example: DLNA is based on Universal Plug and Play. DLNA-compatible devices use UPnP to communicate, and there are three classes of DLNA devices: Home Network Devices: includes media servers, AV receivers, TVs, consoles, and tablets Mobile Handheld Devices: includes smartphones and media tablets Home Infrastructure Devices: includes routers and hubs. UPnP U...

Android: Adaptive Icons

With the release of Android 8.0 (API level 26) Android introduces adaptive launcher icons, which can display a variety of shapes across differnet device models. For example, An adaptive launcher icon can display a circular shape on one OEM device, and display a squircle on another OEM device. Each device OEM (Original Equipment Manufacturers) provides a mask, which the system then uses to render all adaptive icons with the same shape. These adaptive icons are intended to provide a more consistent look and feel across the device’s launcher. You can control the look of adaptive launcher icon by defining two layers, consisting of a background and a foreground. You must provide icon layers as drawables without masks or background shadows around the outline of the icon. Creating Adaptive Icons in XML To add an adaptive icon to an app using XML, begin by updating the android:icon attribute in your app manifest to specify a drawable resource. <application     … ...

Comparing the Performance between Native iOS (Swift) and React-Native

Nice comparison of two app development approaches. https://medium.com/thcomparisonive-log/comparing-the-performance-between-native-ios-swift-and-react-native-7b5490d363e2

NFC wave is coming

Near Field Communication (NFC) is a method of wireless data transfer that is a feature of almost every mobile phone on the market these days. An NFC chip forms a wireless link when activated by another, for the transfer of data. This is commonly used for features such as Apple and Android Pay, linking a smartphone with a smartwatch or pair with speakers and many other functions. NFC has been around in Android phones since 2010 and on iOS since 2014. Android phones can read any NFC tags however NFC usage on iPhone has been limited to Apple Pay only. Recently at WWDC 2017, Apple introduced Core NFC framework in iOS 11 that enables other apps to detect NFC tags. Enabling NFC to apps other than Apple Pay opens a whole new opportunities. Companies(retail, healthcare etc) have not been not fully committed for NFC usage in the past because it was only available on Android platform where iOS has 45% of US market share. Opening NFC to other apps on iOS would open lot opportunities in retail...

From PHP to JavaScript with Node.js

A practical journey explained here . https://blog.matters.tech/migrating-from-php-to-javascript-with-node-js-155534498b58

Custom Cordova plugin

Cordova plugin ? Cordova provides a bridge between JavaScript and native code, enabling you to write native code that gets exposed to your app via a common JavaScript interface. Each method exposed by a plugin’s JavaScript interface is mapped to a method in the plugin’s native code via the Cordova bridge, which also enables you to pass parameters back and forth between the JavaScript and native methods. A Cordova plugin typically consists of :     Native code for each supported platform     A common JavaScript interface     A manifest file called plugin.xml The conventional structure for a Cordova plugin supporting both Android and iOS is: - Plugin top-level folder      - plugin.xml      - src/         - android/            - <Java source code>         - ios/   ...