Category Archives: Tech

android_wear_logo_new

Developers to Android Wear – Are We There Yet?

The short answer seems to be no, but maybe soon.

The long answer is quite a bit more involved.

Development

From a development aspect, starting an Android Wear project is straight forward and simple. In reality, creating a great Android Wear app is neither straight forward nor easy. I’ve been holding off on beginning any Android Wear projects that utilize features present in the Wear 2.0 Preview, so right now a developer usually ends up with a project that contains at least two modules: a handset app module and a wear app module. By default, you’re not presented with any shared code layer since the mobile app “depends” on the wearable, you can either move all shared objects to the wearable module (don’t do this), or you can create a new shared module that both the handset and the wear apps will depend on. This seems somewhat straightforward, but is yet another area developers are left on their own to figure out the quirks of the platform. My favorite part about developing for Android Wear has been using the hardware. I now have a Huawei Watch that really gives my Apple Watch a run for its money in terms of style and use (though my Apple Watch is still my daily driver).

Deployment

Android Wear app deployment is hilariously convoluted. Currently, using the wearApp() gradle dependency the wearable app will only be packaged when the app is built using the release variant. What about a debug build? Don’t bother looking – Google’s documentation on this subject is sparse at best. Here’s what I ended up adding to my mobile app’s debug buildType:

gradle.taskGraph.whenReady { graph ->
    if (!graph.hasTask(assembleRelease)) {
        android.applicationVariants.all { v ->
            if (v.buildType.name == "debug") {
                v.preBuild.doFirst {
                    copy {
                        from("../wearable/build/outputs/apk") {
                            include "**/wearable-*.apk"
                            exclude "**/*-unaligned.apk"
                            rename "wearable-", "wearable_"
                            rename "-unsigned", "_unsigned"
                        }
                        into "./src/main/res/raw/"
                    }
                    println("Packaged Wearable APK in Mobile App")
                }
            }
        }
    }
}

But this isn’t all you need – you’ll also need to create a wearable_desc.xml file to tell your app what your wearable’s name under res/raw will be. BUT WAIT, THERE’S MORE! You’ll need this file to be different for release, because the release apk will be named android_wear_micro_apk.apk. Is this tiring you yet? We haven’t even touched the problems inherent when testing with a wear emulator and various versions of Google Play Services being outdated/out of sync, problems with the wear app properly syncing over to the wearable device, or the problems with synchronizing communications.

User Perception

Most Android users have no idea that a Samsung Gear S2 is any different than an Android Wear device, that it runs a different operating system (Tizen), or that it’s basically not compatible with anything you write for Android Wear. I’ve had requirements in the past that asked me to deliver an Android Wear application only to find out they had wrongly assumed Samsung’s Gear S2 devices would be supported. This fragmentation is bad for Google and for Samsung. Google gets wrongly accused of having no Wear apps (there are tons) when a user is only interacting with the Gear (Tizen) app store. For those in the know – they complain about Samsung selling them a wearable that’s not compatible with the much larger Android Wear ecosystem. Going forward this doesn’t seem like it will be as big of a deal as Android Wear looks to be the “Android” smartwatch platform with partners like Tag Heuer, Huawei, LG, Motorola, Fossil, and more, but for now this isn’t a stellar ecosystem for users to dive into without any guiding hand or clear answers.

Wear Are We Going?

Wear isn’t leaving us – as Google presented a brand new 2.0 redesign of Wear at this year’s I/O conference, it’s only getting better. The redesign is a huge improvement in terms of usability that goes toe-to-toe with Apple’s WatchOS 3.0, and I truly hope that Google only postponed the 2.0 release because it wanted to make the development story less of a headache. Developers need a better way to test on the emulator without worries of remembering all the little tricks they need to do in order to test and debug their apps. Developers need the emulators to update Google Play Services, if we want them to, just like a real device does. And finally, developers need users to somewhat understand and adopt the platform so their apps are seen and used. There’s nothing more satisfying than seeing someone using your app in public, and there’s nothing more heartbreaking than developing for a half-baked platform created by a multi-billion dollar company.

Microsoft’s Surface PC Event

With Microsoft’s new announcements, including the new Surface Studio PC – it seems like they’re finally trying to go after what remains of the PC market. Microsoft is finally at the table, trying to eat Apple’s lunch. With Apple’s “Hello Again” event tomorrow, it will be nice to see if Apple is going to take another year off, or if they’re finally ready to make some much needed updates and improvements to their Mac lineup.

Driver Problems with ALC1150, DSP, and Windows 10

Having trouble getting a driver installed with your fancy onboard sound card such as the Realtek ALC1150 115dB SNR HD Audio, or any of the new sound cards with onboard DSPs, DACs, and so on in Windows 10?

You may want to check your BIOS to see if there’s an option to the likes of “Audio DSP” and disable that. Once disabled, Windows should properly detect your ALC1150 and install the drivers automatically. It seems as though the drivers haven’t really been updated to support all of the features that the sound cards offer in Windows 10, and only basic Windows 10 support has been included. Hopefully in a few months these driver woes will disappear.

gigabyte motherboard

New Motherboard Restarts After Reboot: Enable Power Loading

After booting my new Gigabyte Z170X-Gaming 5 once, shutting down, and rebooting, my new home server was in trouble.

It just kept restarting.

It would power up for maybe 10 seconds, and shutdown. Power up again for another 5 seconds, and shut down again. All the meanwhile no PC speaker noises (I actually harvested an old speaker from a long unused machine to test) and no motherboard display error codes (the Gigabyte motherboard I have actually has a two character 8 segment display). I thought maybe it was a problem with one of the components, the power supply was bad, or possibly something wasn’t seated properly (RAM, CPU, etc.), but none of those issues ended up being the case.

Instead, it seems as though the new motherboard and processor use so little power during boot up that it causes the power supply to shut off.

Enter, a new setting in the BIOS: “Power Loading”.

Power Loading, as described by Gigabyte, “enables or disables a dummy load. When the power supply is at low load, a self-protection will activate causing it to shutdown or fail. If this occurs, please set to Enabled.”

Awesome. Having “Power Loading” enabled keeps enough load on the power supply that when the motherboard and processor are being super efficient during POST, the computer doesn’t shut down.

Fix for Chromium Network Location Provider Returning Error Code 403

I had been using Chromium and wondered why it kept returning error code 403 and the message that’s in the title of this post when using the html5 geolocation features. It turns out that Chromium does not ship with Google’s API credentials as the normal build of Google Chrome does so those services are unavailable (Chrome/Chromium does not use the operating system’s built in location services and instead relies on Google’s API). After reviewing the Chromium documentation here, I’ve come up with the following steps to properly enable Chromium’s google services. It’s a lot of work, but I hope this is useful for the many people using Google’s open source Chromium on Linux, OS X, or Windows.

  1. Join the chromium dev group here by subscribing. You don’t have to receive email updates, you just have to be a member of the group in order for the right APIs to show up in the developer console.
  2. Visit the Google API Console and create a new project.
  3. Visit your project’s page in the console, click the APIs link in the left menu, and begin subscribing to developer APIs of your choice. In order to resolve network location provider issues when using Chromium, you’ll need the “Google Maps Geolocation API”. The Chromium documentation notes the following as useful APIs for Chromium:
    • Chrome Remote Desktop API
    • Chrome Spelling API
    • Chrome Suggest API
    • Chrome Sync API
    • Chrome Translate Element
    • Google Maps Geolocation API – (requires enabling billing but is free to use; you can skip this one, in which case geolocation features of Chrome will not work)
    • Safe Browsing API
    • Speech API
    • Time Zone API
    • Google Cloud Messaging for Chrome
    • Drive API (Optional, enable this for Files.app on Chrome OS and SyncFileSystem API)
    • Google Now For Chrome API (Optional, enabled to show Google Now cards)
  4. Click the settings gear after enabling the APIs of your choice and choose “Project Billing Settings”.
  5. Click “Enable Billing”, choose a personal billing account, and enter your billing information. Yes, in order for Google Maps Geolocation API calls to work, you have to have a payment method on your account. Having a payment method tied to your account won’t affect the fact that the quota for API calls to the Geolocation API is 100 calls per day and 100 calls are billed at $0.0 for personal accounts. If you’re still worried, check out Google’s documentation on Geolocation pricing here.
  6. Click the “Credentials” link in the left menu under “APIs & auth” on the Google API Console.
  7. Click “create new key”, then click “server key”, then click “create”. This is your “GOOGLE_API_KEY” which you’ll need later.
  8. Under “OAuth”, click “Create new Client ID”, choose “Installed application” and click “Configure consent screen”. Fill in the required information in the form and click “save”.
  9. Choose “Installed application” again, and click “Create ClientID”. Now you have your GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET which you’ll need later.

Now you’ll need to setup some environment variables for Chromium to pick up when it’s launched, the rest of these instructions are specifically for OS X using launchd, though with a little bit of googling it should not be that difficult for you to find a solution that works with your OS’ service/startup/daemon manager:

  1. Create a new script in your home directory, mine is named ‘.setGoogleEnvVars.sh’
  2. Add the following to the script, replacing the XXXs with appropriate values from your Google API developer console:
    launchctl setenv GOOGLE_API_KEY XXX
    launchctl setenv GOOGLE_DEFAULT_CLIENT_ID XXX
    launchctl setenv GOOGLE_DEFAULT_CLIENT_SECRET XXX
    
  3. Create a new launchd service in your home’s LaunchAgents directory, ~/Library/LaunchAgents/, mine is called local.setGoogleEnvVars.plist with the following contents, replacing the label and program argument of “~/.setGoogleEnvVars.sh” if necessary:
    <?xml version="1.0" encoding="UTF-8"?>                                                                                  
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.setGoogleEnvVars</string>
      <key>ProgramArguments</key>
      <array>
        <string>sh</string>
        <string>-c</string>
        <string>~/.setGoogleEnvVars.sh</string>
      </array>
      <key>RunAtLoad</key>
      <true/>
    </dict>
    </plist>
    
  4. Make sure your startup script is executable by using the terminal and chmod +x to set the executable bit like this, replacing the script name if necessary:
    chmod +x ~/.setGoogleEnvVars.sh
  5. At this point, you can either restart your computer or load the service with launchctl load ~/Library/LaunchAgents/local.setGoogleEnvVars.plist, replacing the plist name if necessary.

    That’s it! It’s a lot of work, but you’ve now enabled any of your selected Google APIs in Chromium, and you should no longer receive error messages like network location provider at 'https://www.googleapis.com/' : returned error code 403. code 2 if you’ve chosen to enable the Geolocation API and billing.

    Windows 10 Technical Preview – Finally, virtual desktops.

    I made a quick video highlighting my experience with Microsoft’s Virtual Desktop solution inside the new Windows 10 Technical Preview. So far, I’m extremely thrilled that Microsoft added virtual desktops, as it was something sorely lacking in Windows and yet was available on most other popular operating systems. Also included is a remapping of the old Windows Aero Flip 3d (Windows Key + Tab) to the new Windows 10 Task View – which is basically OS X’s Mission Control – a method for managing, switching to, and viewing virtual desktops. Here are some other useful shortcuts that are new or changed from previous versions of Windows (from here on out I’ll refer to Windows Key as WinKey):

    Alt + Tab is basically unchanged and properly switches to the correct desktop when an app is selected that isn’t on the current desktop.

    WinKey + Ctrl + D is the shortcut to create a new virtual desktop.

    WinKey + Ctrl + F4 is the shortcut to close a virtual desktop. Closing a virtual desktop will move all open applications and windows on that desktop to the next available desktop – so don’t fret about losing all of your work by closing a desktop.

    WinKey + Ctrl + Left (or Right) Arrow switches you to the left or right virtual desktop you have open. If you’re currently switched to a virtual desktop on one of the ends, it does not loop you back around if you try to continue in that direction.

    The only downside to the new virtual desktop setup in Windows 10 is that you currently cannot move applications or windows from one virtual desktop to the next while in Task View. This is a major selling point of Mission Control for me, as it allows me to easily manage all of my open applications and regroup them under current or new virtual desktops as necessary to fit my current task. Other than my hopes that Microsoft implements better application and virtual desktop management into Task View before launch, I’m excited to upgrade all of my Windows 8.1 desktops and virtual machines to Windows 10 when it’s launched. The new Start menu (with integrated Start Screen) is really what Windows 8 should have shipped with; Microsoft’s new Windows 10 operating system is finally aware of its place when installed on a computer with a mouse.

    First Talk as a Speaker Submitted

    I’ve never been particularly good at public speaking unless I am extremely passionate about the topic, or I’ve rehearsed my talk dozens of times. Even with rehearsal or passion, I’m not “good”, I just have less fear so I feel as if I’ve done a better job than if I was more fearful.

    For me and my career, the most common venue for public speaking is during a meeting or presentation with a client. These client/customer meetings are generally easier for me due to my belief in my skills, abilities, or the product I’m effectively selling. Being able to stand behind and stake my reputation on something has been a terrific motivator and driving force behind where I’m at in my career today, but doing this as a speaker at a tech conference seems significantly more difficult. Most of the tech I have either passion for or belief in, or both (and that I would be qualified to speak about), are things I have not had any hand in creating. That lack of ownership made it difficult for me to justify to myself that I am even qualified to speak about or stand behind said tech. The other way I’d justify things is if I was bringing something new to the table about a topic, and previously all of the items I had wanted to talk about were already being covered in some way by pretty well-established speakers.

    I finally overcame my own ridiculous self-doubt/mildly ridiculous justifications and submitted a talk entitled:

    PHP misses you.

    I’m 100% happy with this, regardless of the possibility of it being accepted or not.

    The talk revolves around the idea that PHP has changed a lot and was spurred by a random conversation I had with someone about PHP at CodeMash 2014. I can’t recall the exact statement, but the person I was having the conversation with (honestly) posed a question that went something like:

    “Oh, PHP – are they still doing releases of that?”

    Yes, they are, and things are getting better finally. My potential talk would showcase lots of recent work that has gone on in PHP like closures, functional and object-oriented code, asynchronous, event-driven and non-blocking I/O, generators, iterators, and more neat things you can quickly use to get stuff done in PHP. It seems as though with this talk that I should be able to bring something new to the table for most attendees (though some pieces of my talk may be old hat to frequent PHP developers).

    I realize I made the “mistake” of only submitting one talk. Most frequent speakers seem to acknowledge some sort of common knowledge that if you want to get accepted you should submit as many talks as you’re qualified for. I realize this is probably a more strict requirement for someone that they have to pay travel expenses for, but I live in the area of the conference I submitted my talk to so maybe my lack of multiple submissions will be overlooked.

    I am excited and happy that I am taking steps forward to rectify some self-doubt and grow myself and my career further. I hope that this marks the beginning of another chapter in my life at the ending of which I’m amazed at the result and how I arrived.

    When an employee or department falls for spyware pop-ups

    Malware gets installed, computers get hosed, and hilarity ensues, but at what cost?

    Everyone should take a really long, hard look at themselves and ask if their abilities are at the level the company requires them to be at. If not, do everything you can as an employee or organization to take a step forward. If, as an individual, you can’t take that step, you should probably find another job.

    If as a company you can’t take that first step, you’ll likely be obsolete soon.