Review: OnePlus 2

February 2016 | Dios Kurniawan

It raised eyebrows whenever I told friends what phone I had bought; a OnePlus Two. No one has ever heard of OnePlus, let alone the ‘Two’ model (there is OnePlus One which came before it). The company/brand name is new, and their products are not sold in stores in Jakarta, so it is quite normal to see that OnePlus is still far away from stardom and fame. Because many have asked why I had chosen this never-heard-of phone, so I guess it is good to write a short review of it.

Few months ago, I started to feel the need to get a dual-SIM phone because I began to dislike the idea of carrying two phones everyday. I needed a one powerful phone to replace both my trustworthy Samsung S5 and my 3-year-old BlackBerry Q10. I usually keep two phone numbers with me, one for business and the other one for personal contacts. Therefore, carrying one phone instead of two while keeping my both SIM cards active in a dual-SIM device sounds like a promising move.

So I went to the market to check what’s available, and OnePlus 2 came to the top of my list. OnePlus 2 (or OPT, as some users call it) offers a slick build and strong specs that only expensive ‘flagship phones’ carry.

OnePlus 2 is a 5.5-incher smartphone equipped with a powerful processor, large RAM and a decent camera. It has dual SIM slots, which is the main reason why I chose this phone. It is a feature something the other flagship contender such as Samsung S6 or Sony Z3 simply do not possess. The metal frame and the iconic sandpaper back cover help the look.

What I Like About OPT:

  • Strong top-notch Snapdragon 810 processor and the whopping amount of 4GB RAM – never again I have experienced lags or sluggishness. It handles everything I throw at it very well.
  • The fingerprint scanner; it’s very fast and accurate. It is way much better than the swipe fingerprint scanner of my old Samsung S5, which most of the time is a hit-and-miss action. With OPT, I can unlock my phone with fingerprint almost 100% of the time.
  • The physical ‘Alert Slider’ which allows me to put the phone into silent mode instantly without even looking at the screen. A simple idea which helps a lot.
  • Multi-user This feature is actually part of Android 5 release, but somehow not all device manufacturers have enabled this capability in their products. OPT with its own Oxygen OS, is very close to stock Android and lets me use this multi-user feature with no restriction. This feature comes up very handy as now I can have multiple WhatsApp account, Google account etc. on a single phone. Very neat!
  • The reversible USB Type-C Being able to plug the cable without looking at the orientation is really a convenience. The connectors are stronger that ordinary USB, too.

What I Don’t Like:

  • The LCD screen. I have the impression that its 5.5-inch display could have been better. It does not deliver any real pop, and colors look less striking compared to Super AMOLED screen of my Samsung S5. AMOLED technology allows displays to produce deeper and richer blacks, making the pictures look more dynamic, which is not the case with OPT’s screen.
  • It’s heavy. OPT is, in my opinion, very heavy and feels bulky. Perhaps because I used to use Samsung S5, a much lighter, plasticky device.  I just wish OPT could be lighter.
  • Does not support LTE / 4G. I was unlucky to get a Chinese version (A2001) that did not support LTE/4G bands in Indonesia. Learning from the online forums, there is another version which does supports 4G bands, it is called A2003. So readers who are interested to buy OPT, I strongly recommend you to get the A2003 version.
  • No infrared I used to have fun with infrared remote control apps in my Samsung S5, allowing me to control TV sets, airconditioners and other home appliances. Too bad, I lost this when I migrated to OPT.
  • The battery does not last very long. A single charge can only last 7-8 hours, even after I removed all power-hungry apps. This is still a mystery to me to understand what is causing the power drain.
  • The metal frame needs a protective cover.
  • It’s not cheap. At S$580, I cannot say this is a cheap phone.

Overall, OPT is a good buy and I enjoy every moment using it.

Holiday Project: Simple IoT Experiment

September 2015 | Dios Kurniawan

Last Lebaran holiday in July was a good time for me to jump back into my programming hobby. Quiet days, no interruptions and no deadlines. It was really a good time to delve into coding. Well, programming is actually much more fun if it is only a hobby when you can choose what real-life problems you want to solve with your software, pick the language you like, and choose how to do it. This time, I got about a week worth of leisure time, and I decided to create a solution to one domestic problem: a refrigerator door sensor.

A remote sensor for refrigerator

Let’s be more clear with the requirement. The problem definition is: I want to know how many Magnum Mini ice cream packs are left in my fridge. Yes, ice cream. My daughter loves to eat Magnum Mini while the same is true for me. It creates some sort of competition situation, either she or myself would eat up the ice cream. Nothing more upsetting to me than seeing no more Magnum Mini is left in the fridge each time I got home from work. I wish I could have an app in my hands telling me if my ice cream supply falls short, so I could stop by at local groceries store on my way home to restock the ice cream. I was thinking about some kind of a camera that monitors the inside the freezer, or a counter device to see how many times the fridge door is opened each day, but I could not find such thing in local DIY shops. Enter Android smartphones.

My stockpile of Magnum Minis in the fridge

Nearly all Android phones today are equipped with built-in accelerometers. This sensor is good for measuring the acceleration force that is applied to a device on all three physical axis (x, y, and z), including the force of gravity. Just like an aircraft, an Android device orientation is also defined by pitch, roll and azimuth. So why don’t we use this sensor for detecting door movements? Simply attach a cheap Android phone on the door and let it run to detect motion. All we need is an app that reads the accelerometer and sends the data over the internet thru Wi-Fi or 3G connection, basically turning an Android device into a remote sensor, or as some people prefer to call it : an M2M (machine-to-machine) sensor.

Device orientation variables for detecting open-close state

For this purpose, I wrote a simple Android app (I named “dSensor“) that reads the accelerometer sensor, detects movement and sends the event over the Wi-Fi to a remote server, which in turn will store the data. I do not intend to create anything overly complex because I understand a decent movement detection algorithm would need an in-depth study on digital signal processing theories. I would try to skip that and make the detection function as simple as it can. Simply detect changes in orientation and trigger the event to send data. Luckily, Android provides pretty complete library for accessing sensors under android.hardware.Sensor package.

import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;

Quite straight forward, detecting door’s open/closed position is achieved by implementing code in the onSensorChanged() event. The movement detection is implemented using accelerometer which in turn would trigger detection using magnetic field sensor, to determine if the door is opened or closed.

@Override public void onSensorChanged(SensorEvent event) { 
 if(event.sensor.getType()==Sensor.TYPE_ACCELEROMETER) { 
 //detect any slight movement to trigger door check 
 } 
 if(event.sensor.getType()==Sensor.TYPE_MAGNETIC_FIELD) { 
 //get azimuth, pitch & roll to check if door is open or closed 
 } 
}

After a couple days of coding, my first prototype app was ready to test. For this purpose I used my 4-year-old Samsung Galaxy Y which had been lying around unused at my house for quite a long time. This old smartphone is glued on the fridge’s door with its battery charger permanently attached, and continuously running the app in the foreground.

Android app to detect motion and send the data over Wi-Fi

The Android phone is attached to the fridge, acting as a sensor

Data from the device is transferred in JSON format via HTTP and is then stored in a database. Initially I chose MySQL, but later I moved to MongoDB (a NoSQL database) to take advantage of its scalability. I also created a simple web application to display the reports.

+---------------------+------------+----------+------------+
| time stamp          | azimuth    | pitch    | roll       |
+---------------------+------------+----------+------------+
| 2015-08-23 20:55:28 | 36.71875   | -25      | 11.5234375 |
| 2015-08-23 20:50:27 | 36.71875   | -25.7812 | 12.3046875 |
| 2015-08-23 20:45:26 | 35.9375    | -25      | 13.0859375 |
| 2015-08-23 20:40:25 | 39.84375   | -25      | 9.9609375  |
| 2015-08-23 20:35:24 | 39.84375   | -25      | 9.9609375  |
| 2015-08-23 20:30:23 | 39.84375   | -24.2187 | 9.9609375  |
| 2015-08-23 20:25:32 | 40.625     | -25      | 9.9609375  |
| 2015-08-23 20:20:21 | 39.84375   | -25      | 9.9609375  |
| 2015-08-23 20:15:20 | 39.84375   | -25      | 9.9609375  |
| 2015-08-23 20:10:18 | 35.9375    | -26.5625 | 8.3984375  |
| 2015-08-23 20:05:18 | 37.5       | -25      | 11.5234375 |
| 2015-08-23 20:00:16 | 37.5       | -25.7815 | 12.3046875 |
+---------------------+------------+----------+------------+

Now the analysis part. The raw data sent from the sensor tells me how many times the door is opened, but it cannot tell me how many ice cream packs are still in the fridge. The approach is to make an assumption that each time the door is opened, one Magnum Mini is taken out. I understand that my kids get home from school at around 3 PM, therefore any door opening event during the time until they get to sleep at around 10 PM can be assumed that my kids are extracting Magnum Minis from the fridge. Using simple if-then statements, each time the door is opened during this period, the number of ice cream counter is subtracted by one. Of course in reality it is not that simple as there may be other things inside the fridge, but at least that’s the closest approximation.

The application would require me to adjust the counter each time I restock my ice cream. Subsequently, the application will count how many ice cream has been consumed and will display the (estimated) remaining number in my fridge. Now, I can remotely view this information at my fingertips anywhere I have access to my web application. Pretty neat.

Web application shows how many times door has been opened during the day, and estimate how many remaining ice cream are still there

Not limited to refrigerators and ice cream, my sensor-on-a-phone solution can also be used on doors to detect theft, to count how many people entering a room, and many other uses. I am now working on modifying the code to detect motion and even vibration in my car. This demonstrates that a pretty versatile sensor can be had with a old, cheap hardware (under $30) which would otherwise become electronic waste.

Theft Detector

My simple project here highlights the vast opportunity to use Android devices for sensors, especially in light of the emergence of IoT (Internet of Things) trends. This is just a simple experiment, but the potential use case is limitless. There is nothing as exciting as starting a new project and seeing it evolve.

When A Maritime Minister Speaks About Planes

August 2015 | Dios Kurniawan

The newly appointed Minister of Maritime, Mr Rizal Ramli, recently made the headlines by publicly insisting the national flag-carrier airline Garuda to cancel the order of 30 new Airbus A350 wide-body aircrafts on the basis of “the aircraft is only good for Europe and US routes”, and “those routes are unprofitable business, Garuda should concentrate on domestic market instead”. We will see how false these statements are.

Boeing 787 (above) and Airbus A350 (below). Photo: flightglobal.com

To begin with, medium-sized wide-body aircrafts such as A350 and its main competitor Boeing 787 are not necessarily used for long-haul flights. Many airlines use wide-bodies to fly short-to-medium regional sectors, typically flights under 6 hours. Japan Airlines, All Nippon Airlines and Air India fly Boeing 787 for their domestic routes. Thai Airways and Qatar Airways fly 787 for regional flights as short as Bangkok-Kuala Lumpur and Doha-Abu Dhabi. Moreover, some airlines, for example Singapore Airlines and Emirates, exclusively operate wide-body aircrafts.

Modern wide-bodies are preferred because they can carry 200-500 passengers and tons of cargo in one go with superb efficiency. They are also valuable assets for serving busy airports with limited available flight slots.

Wide-body aircrafts are the workhorse of all major airlines, and Garuda as part of its expansion plan should have enough of them in its fleet. Medium-sized 200-300 seater Airbus A350 or Boeing 787 fits nicely into routes not sizeable enough to warrant the operation of larger aircraft such as Boeing 777-300ER. Garuda can make use of A350 (or 787) to serve Japan, China, Korea, Australia and emerging markets in the future.

Next comes the waiting list problem. All major airlines in the world are lining up to get new jets to replace their old ones and to expand their networks. The problem is: there are only two wide-body aircraft manufacturers in the world today; Airbus and Boeing. In the last several years, they have already been swamped with orders from airlines, fueled by growing demand of the world’s air travel which has yet to show sign of a downturn. Current backlog orders at Airbus and Boeing have reached record-high with more than 10,000 planes on order. That is a huge task for Airbus and Boeing to fulfill.

Boeing factory. (photo: boeing.com)

Despite continuing attempts to boost production capacity, Airbus and Boeing can only produce around 1,000 jets each year. That means if you place an order today, the planes will be delivered to you 5-10 years from now. A very long time for most customers to wait, which could mean lost opportunities.

One cannot expect to buy a plane now and have it delivered next week. For airlines, purchasing aircrafts requires proper long-term planning.

The statement “long-haul market is unprofitable” may be true for Garuda at this moment, however the demand for long-haul travel remains stable at around 5% annual growth (source: Boeing Market Outlook 2015). Garuda needs to gradually penetrate the global market, stealing market share currently enjoyed by Emirates, Singapore Airlines and others.

Also, Garuda needs to grab the increasing inbound tourists and business travelers from Asia, Australia, Europe, Middle East and even the US. Last year saw a healthy growth of 7% per year in foreign tourist traffic. To accommodate the anticipated growth, Garuda will require to expand its fleet of wide-body aircrafts, and as well to replace its ageing 1990-era A330 and B747-400 aircrafts.

At the present, Boeing 787 and Airbus A350 are the most viable choices as they offer the right seat capacity, range and operating costs.

Looking at this, either to go with Airbus or Boeing, Garuda’s decision to place order for wide-body aircrafts today is the right one. Garuda needs to stay competitive by expanding its fleet with fuel-efficient aircrafts, both narrow-body and wide-body. If Garuda does not plan to acquire new wide-body jets now, Garuda will be left with not enough wide-bodies in its fleet in the next 5 years as its older aircrafts must leave the fleet for retirement.

Retired Boeing 747s at Cengkareng Airport (photo: Dios Kurniawan)

In point of fact, one of the significant factors that brought Merpati Nusantara Airlines into bankruptcy was its failure to expand its fleet (see my other post). Fleet expansion is crucial.

Mr Rizal Ramli, Minister of Maritime (source: Google)

In spite of this, Mr Ramli thinks that the wide-body purchase is a mistake. He believes that there is no need to gradually build the network of international routes. He prefers to let other countries’ airlines to seize the increasing tourist traffic to Indonesia. A very smart and visionary minister (yes, it is a sarcasm).