Cover photo
Siamak Masnavi
Attended University of British Columbia (Canada)
Collections Siamak is following
software developer and technology jounalist
Basic Information
(full-time) software developer and (part-time) journalist
  • University of British Columbia (Canada)
    Computer Science, 1982 - 1986
  • Port Moody Senior Secondary
    1984 - 1986
  • Queen Mary & Westfield College, University of London (United Kingdom)
    Computer Science, 1986 - 1992


Siamak Masnavi

Shared publicly  - 
Ever wanted to download adb or fastboot without having to download the whole of Android Studio?

...but didn't want to download executables from some random warez site?

Good news this week:

These links will always return the adb/fastboot binaries currently shipping with Android Studio. No need to guess what the current version is, or update your own links: just follow these and get the latest binaries, direct from the source.

This is thanks to +Siva Velusamy and Kevin Quinn, not me.
40 comments on original post

Siamak Masnavi

Shared publicly  - 
Checking USB type-c to type-a cable compliance with the Nexus 5X

Install adb
Enable developer options and usb debugging on your Nexus 5X
Connect your phone to your computer with the cable to be tested

adb shell dmesg | grep 'Avail curr from USB'

If you don't have grep, just run

adb shell dmesg

And then just look for the Avail curr line.  There may be more than one entry, but we're looking at the last one which is the most recent.  My results are

[22560.060485] dwc3 f9200000.dwc3: Avail curr from USB = 3000

If you see 3000 then I'm sorry, but you have a non-compliant cable.

If instead you see Avail curr from USB = 500 or possibly 1500 then your cable is good.
125 comments on original post

Siamak Masnavi

Shared publicly  - 
OnePlus introduces its On-Guard warranty policy for the OnePlus 2 and X

By +Robert Triggs 
OnePlus has a pretty patchy reputation when it comes to customer satisfaction and service, but the company has just announced a new optional warranty policy for its smartphones that should help to improve the customer experience. OnePlus has teamed up with a couple of insurers around the world to offer global protection. OnePlus 2: On-Guard is provided by simplesurance for Europe, and B2X OnePlus Service2 and Protect2 for Indian customers. One...
7 comments on original post

Siamak Masnavi

Shared publicly  - 
Honestly, if you have a +Samsung Mobile USA Galaxy Note 5 or Galaxy S6 edge+ and you _don't _ buy the Fast Wireless Charger then I don't know what's wrong with you. 

#Samsung   #Note5   #wirelesscharging  +Samsung Mobile +Samsung USA 
You can’t knock Samsung’s commitment to wireless charging. Having decided to embrace it in the latest Galaxy range, it went whole-hog, packing in both wireless types and, with the launc…
2 comments on original post

Siamak Masnavi

Shared publicly  - 
+Ted Salmon You should read the comments, esp the one about the 3600mah battery for the Nexus 5.
Replaced the battery in my Nexus 5. It's like having a new phone. I don't think the phone lasted this long when it was new. 
16 comments on original post

Siamak Masnavi

Shared publicly  - 
A flowchart for background work, alarms, and your Android app
Pro-tip by +Ian Lake

For many apps, doing work in the background can be an important part of building a great experience. An alarm registered with AlarmManager ( is one way to schedule your app to be run sometime in the future, even if your app isn’t in the foreground. What alarm type and API should you use for your app or are alarms even the best option? Let’s go through some of the factors that should influence your opinion:

How often do you want to trigger?
For events less than 60 seconds apart, alarms aren’t the best choice: use the much more efficient Handler ( for frequent work.

Want to set a user visible alarm clock?
On API 21+ devices, new APIs allow you to set a user visible alarm via setAlarmClock() ( the system UI may display the time/an icon and apps can retrieve the next alarm clock with getNextAlarmClock(). Note that alarms set with setAlarmClock() work even when the device/app is idle (similar to setExactAndAllowWhileIdle()): getting you as close to an exact wake up call as possible. For backward compatibility, you’ll follow the same guide below for a single alarm.

Wake up the device/app while idle (i.e., doze, app standby)?
On Android 6.0+ (API 23) devices, additional power-savings optimizations ( have been added in the form of Doze (triggered by a completely stationary, unplugged, and idle device) and App Standby (triggered by an unplugged device on idle apps that haven’t been used recently). You’ll use setAndAllowWhileIdle() ( for inexact and setExactAndAllowWhileIdle() ( for exact alarms if you need it to fire an alarm while in these idle states. If it can wait until the user returns to their device/your app, use the standard set() and setExact() to be the best Android citizen and save your user’s battery.

(We’ll be talking more specifically about Doze and App Standby later!)

Just a single alarm?
A single alarm can be set with the aptly named set() ( method. One thing to keep in mind is that on API 19+ devices when you target API 19+, the system will be treated as inexact, potentially batching alarms together - the alarm will never go off before the time specified, but may go off afterwards. If you have some flexibility in the start time but have a hard deadline, consider using setWindow() ( to gain more control over the exact time period to be used.

You can use setExact() ( for a precisely timed single alarms on API 19+ devices, but use these only when the exact timing is required (such as with a calendar reminder).

Need to repeat at a constant rate?
For repeating alarms, batching is the key to good battery life. setInexactRepeating() ( does exactly that. Prior to API 19, you can use one of the INTERVAL_ constants (such as INTERVAL_HOUR ( to batch alarms of the same interval. On API 19+ devices, all repeating alarms (no matter what the interval) set with setInexactRepeating() will be batched.

You’ll note there’s also setRepeating() - similar to set() the behavior changes with API 19 from exact to inexact repeating alarms, meaning if you are on an API 19+ device and target API 19+, this functions identically to setInexactRepeating(). If you really need exact repeating alarms on API 19+, set an exact alarm with setExact() and schedule the next alarm once your alarm has triggered - keep in mind the battery implications though!

BUT WAIT: should you even use alarms?
If you want to be as battery efficient as possible (and you should!), consider using JobScheduler ( on API 21+ devices or GcmNetworkManager ( on all Google Play services enabled devices of API 9+.

Supporting both one off and periodic work, these APIs lack the ability to wake from idle, but gain the ability to wait for network access, wait until the battery is charging, take advantage of automatic backoff and retry, persist across reboots, and batch jobs across the system (meaning lower battery usage!).

That’s a lot of good reasons to use JobScheduler and GcmNetworkManager so consider them strongly in your push to #BuildBetterApps
87 comments on original post

Siamak Masnavi

Shared publicly  - 
The RT-AC5300 router is supposed to be shipping in the 4th quarter; the price should be in the $300 - $400 range since the existing AC-3200 model currently has a street price of $280. So, I am expecting the list price for the RT-AC5300 to be $399.
If you were wondering how Asus would respond to the challenge of Google's OnHub wireless router, wonder no longer. Forged in an off-world colony and teleported here by its own sheer power of will,...

Siamak Masnavi

Shared publicly  - 
This was a disappointing story to have to write. What a shame.
When you've made your name as the company customers can count on for reliable Android upgrades, you can't drop the ball like this.
98 comments on original post

Siamak Masnavi

Shared publicly  - 
Mostly good news if you have a 2014 or 2015 Moto phone.
Nearly all of the 2014 and 2015 Motorola phones will get the next version of Android, but some of the useful Moto software add-ons are going away.
11 comments on original post

Siamak Masnavi

Shared publicly  - 

Siamak Masnavi

Shared publicly  - 
Amazing true story by +Jason Howell. Most definitely worth reading.
The abrupt end of this week's +All About Android

I realize I ended this week's episode with a rather sudden shift in tone and subject matter, and I mentioned not wanting to go into further detail as to why.

Truth be told, I'm still coming to terms with the experience, and every day, its getting easier to understand what happened, but what I realize is that there are only positive things that can come from sharing the story, especially because it has a happy ending. THANKFULLY.

 I didn't want to get into details during the show cause I didn't want to dilute the message, or misconstrue my reason for doing so.

But honestly, it weighs heavily on my heart, and I think writing about it might actually help me to move beyond it, and might actually encourage others to take action of their own if ever they are in a similar position.

Last weekend, I was at a pool party with lots of friends and families. Towards the end of the evening as it was getting dark, I decided to throw on some goggles and dive into the pool to see if I could swim from one side to the other while holding my breath. When I started underwater, I notice a dark form on the floor of the other side of the pool. Unsure what it was, but fearing it might be a person or child, I suddenly found myself swimming as fast as I could to investigate and sure enough it was the body of a little boy, my friends son.

Holding my breath underwater was never easier at that moment, I still hadn't come up for air. Adrenaline is a crazy thing. The boy was lying on the pool floor, face down, absolutely still and completely colorless. It was as if he was lying on your living room floor, but at the bottom of 4.5 feet of water. He had drowned. My reaction was to swim to him as quickly as possible and lift him out of the pool, which I did. This is a scene that has replayed in my mind countless times since then. It's kept me up at night and its brought me to tears.

My memory is somewhat splotchy but I remember coming up with his body and screaming "Help! Help! I need help!" over and over as loud as I could scream, at which time THANKFULLY his parents were there quickly, running over and pulling him from my arms.

I then recall his mom on top of him at the side of the pool doing chest compressions and counting up to 30, then pausing as his dad breathed into his son's mouth 2-3 times. At which time his mom began swiftly compressing his chest counting loudly to 30 as she did it, basically repeating the process. I learned about CPR prior to having our first child so the process wasn't foreign to me, but watching two people who REALLY knew what they were doing (he is in fitness, she is a nurse) was really powerful. Knowing that it was his parents made it even more so.

This went on for around 2-3 minutes, though my sense of time is warped. All I know is at some point, I eventually saw the boy twitch a few times ("he's moving! holy shit he's moving..."), move his arm, and finally vomit all over the pool while still lying on his back.

CPR continued until it was obvious that he was lucid and by this time, the ambulance had arrived. He was whisked away to the ER with his parents. My wife and I kept their 2 year old daughter with us to take care of her while they went to the hospital with their son.

Something to know about drowning is that simply reviving a person who has drowned does not in fact mean they are out of harms way. Secondary drowning is something that happens when water enters the lungs, like happens when someone is drowning, and restricted breathing as a result of that trapped water can take place anywhere between 1-24 hours after the incident. Risk is low (1-2%) but significant. He had considerable water in his lungs and pumping his lungs of water still resulted in about 10% of the water still in there that they couldn't pump out. He was monitored in the hospital for 48 hours to be safe.

He was also given a multitude of brain scans and tests and all tests came back positive. No brain damage, something that begins to set in after around 4-6 minutes of no oxygen to the brain.

We don't know how long he was in the water. Based on his skin color (grayish to blue) when I found him, and based on the tests and oxygen saturation in his body, the hospital expects he was likely in the pool for around 2-4 minutes. Meaning had I not gone into the pool when I did (a freaky, random decision on my part cause I NEVER swim laps thanks to a shoulder surgery years ago, and I also NEVER wear goggles cause I don't actually own any), he would likely be brain damaged at the very least, or worse yet, dead. We literally got to him, and revived him at the last possible moment.

We were lucky. So fucking lucky.This boy has been given a second chance at life. His parents were given a second chance at having a son.


Because of quick action on our parts, he is alive. On Monday while at work, I got a text message. I checked it and it was a photo of him in his hospital smock, smiling and playing. It hit me hard. That being two days after the incident. If anything had happened differently, I could instead be getting a text message with details of his funeral. Instead, I got a picture of him being a four year old kid, happy and healthy, and ALIVE.

This is why I didn't tell the story on the show. Please don't mistake this post for being a story about me and how I helped. This is not my story. This is about how knowing what to do in an emergency actually saves lives, and that's important stuff. If YOU know CPR, something that takes little time to learn.... YOU could be the one to bring someone back to life from death.

Can you even understand how powerful that is? You are literally a super hero. Magical powers. All that shit. Knowing this is the difference between life and death.

(deep breath) OK I feel better.

Become CPR certified, please:
Why Train with the Red Cross? Training people how to respond to and prepare for emergencies is a core mission of the American Red Cross. We offer a range of health and safety classes that teach you new skills, keep you knowledgeable, confident and ready to respond in almost any emergency ...
134 comments on original post