Profile

Cover photo
Chris Dawson
Works at Webiphany
Attended University of Washington
Lives in Portland, OR
279 followers|275,807 views
AboutPostsPhotosYouTube+1's

Stream

Chris Dawson

Discussion  - 
 
I'm following along with this tutorial, attempting to get my wear app and mobile app communicating.

https://www.binpress.com/tutorial/a-guide-to-the-android-wear-message-api/152

I think some part of the solution must be omitted, however, because I keep getting this crash:

E/AndroidRuntime: FATAL EXCEPTION: Thread-4
Process: com.webiphany.wearsync, PID: 27299
java.lang.NullPointerException: GoogleApiClient must not be null
at com.google.android.gms.common.internal.zzac.zzb(Unknown Source)
at com.google.android.gms.internal.zzzv$zza.<init>(Unknown Source)
at com.google.android.gms.wearable.internal.zzm.<init>(Unknown Source)
at com.google.android.gms.wearable.internal.zzcb$2.<init>(Unknown Source)
at com.google.android.gms.wearable.internal.zzcb.getConnectedNodes(Unknown Source)
at com.webiphany.wearsync.MainActivity$2.run(MainActivity.java:61)
at java.lang.Thread.run(Thread.java:761)

My wear and mobile apps are here:

https://github.com/xrd/WearSync

The relevant connection code for the wear app is here:

https://github.com/xrd/WearSync/blob/master/wear/src/main/java/com/webiphany/wearsync/MainActivity.java#L75

The connection code for the android app is here:

https://github.com/xrd/WearSync/blob/master/mobile/src/main/java/com/webiphany/wearsync/MainActivity.java#L79

Any suggestions on what I am doing wrong?
Android Wear comes with nifty features right out of the box (e.g. notifications), but its true value comes in with native apps that communicate directly with paired smartphones. In this tutorial, I'll cover how to use Android Wear's Message API to send data from a phone to a wearable.
1
Sterling Udell's profile photoJeffrey Pugh's profile photoChris Dawson's profile photoAppGlobe's profile photo
4 comments
 
+Chris Dawson about BIND_LISTENER it was deprecated in April:
android-developers.blogspot.se - Deprecation of BIND_LISTENER with Android Wear APIs

...but it looks like you changed that already.

I understand you're probably still in the early stages, but n you ListenerService I see you implemented on onMessageReceived, but you listen for all other events as well. This would start that service for just about anything.
Add a comment...

Chris Dawson

Discussion  - 
 
Is there no way to connect an Android wear emulator to an Android emulator? I'm sketched out by this post and the requirement of downloading and installing an unknown apk. There is no way to configure from the shell that the emulator should connect to a device emulator via a simulated Bluetooth connection?
I don't have an Android Wear, nor do I have a phone running 4.3. Is there a way to connect the JB 4.3 emulator and Android Wear emulator for app development?
1
Chris Dawson's profile photoHarshal Kshatriya's profile photo
13 comments
 
I've tried com.google.android.wearable.app_2.0.0.138530141.gms-760210831_minAPI18(nodpi)_APKdot.com, com.google.android.wearable.app_2.0.0.138705214.gms-760210833_minAPI18(nodpi)_APKdot.com, com.google.android.wearable.app_2.0.0.141371744.gms-760277317_minAPI18(nodpi)_APKdot.com. But unable to pair handheld emulator with wear emulator. I had forwarded the ports on handheld emulator as directed. On clicking setup button in the wear companion app on handheld emulator, witnessing crash.
Add a comment...

Chris Dawson

Discussion  - 
 
I'm trying to get the voice reply example working on my Android Wear app (https://developer.android.com/training/wearables/notifications/voice-input.html). I am never getting the results into my reply activity.

Specifically, I'm unsure where I call the function `getMessageText()` . Inside the ReplyActivity? When the PendingIntent is resolved (is that the correct terminology?) I imagine the app should launch into that activity, but I'm unclear how that happens when the reply is initiated by the wear side of things (it seems strange to launch an entire new activity and UI on the Android device when a reply is made from the watch).

Here is a gist with the two activities:

https://gist.github.com/xrd/4c2dbb6c8bef472bd55ec177678ed83f
2
Add a comment...

Chris Dawson

Shared publicly  - 
1
Add a comment...

Chris Dawson

Shared publicly  - 
1
Add a comment...

Chris Dawson

Shared publicly  - 
 
“Invalidate my VIP ticket but please don’t steal the magic!” @xrd https://medium.com/@xrd/invalidate-my-vip-ticket-but-please-dont-steal-the-magic-aec943c3ced4
Last week, my wife and I had plans to attend the Seu Jorge tribute to David Bowie concert together. She is nine months pregnant and this…
1
Add a comment...

Chris Dawson

Help Center  - 
 
I'm trying to get the voice reply example working on my Android Wear app (https://developer.android.com/training/wearables/notifications/voice-input.html). I am never getting the results into my reply activity.

Specifically, I'm unsure where I call the function `getMessageText()` . Inside the ReplyActivity? When the PendingIntent is resolved (is that the correct terminology?) I imagine the app should launch into that activity, but I'm unclear how that happens when the reply is initiated by the wear side of things (it seems strange to launch an entire new activity and UI on the Android device when a reply is made from the watch).

Here is a gist with the two activities:

https://gist.github.com/xrd/4c2dbb6c8bef472bd55ec177678ed83f
1
Ian Lake's profile photoChris Dawson's profile photo
2 comments
 
Thanks, I reposted there.
Add a comment...

Chris Dawson

Shared publicly  - 
 
My son, at the beach.
1
Add a comment...

Chris Dawson

Help Center  - 
 
So, this is a threading question, I think.

I recently wrote a "toy" Android app (https://github.com/xrd/technocrat-android) for this webinar I presented for O'Reilly ("Building Slackbots with Hubot in a Docker playground": http://www.oreilly.com/pub/e/3711).

The app has a custom view with an onDraw() method where I draw the "batsignal." This 30 second video demonstrates what it should look like, but this is somewhat faked: https://www.youtube.com/watch?v=j4nBTzzTskg.

The code seems more complex that it needs to be. Right now, I have a while(true) loop (https://github.com/xrd/technocrat-android/blob/master/app/src/main/java/com/inqry/technocratsignal/MainActivity.java#L106) and inside that I call an AsyncTask named "LongOperation." Its only function is to call the custom view's update() method to trigger a redraw. Since this is UI code, I feel like I should be able to call the update() method right inside the main calling function (initializeTechnocratSignalViewAndServerPoll), rather than by instantiating an AsyncTask and then calling update() inside the onPostExecute() function.

I put together a branch (https://github.com/xrd/technocrat-android/blob/easier_flow/app/src/main/java/com/inqry/technocratsignal/MainActivity.java#L48) which simplifies the code, but when I run it, I just get a white screen where the custom view should be running. I have no idea why, in the debugger it definitely can find the view using findViewById (it is not null) but it never enters the onDraw() method if I set a breakpoint there.

And, this "working" code is really just a demo anyway. I just turn the "batsignal" to on manually once it has hit 9 seconds. In real life, I want to poll a JSON server endpoint and if the results of that say to turn on the batsignal, then do it. But, when I tried to put an AsyncTask inside the Runnable in which I am running this code, it didn't work. I imagine I'm not supposed to start a thread inside a thread, which is itself inside the main UI thread. Right? If so, is there a pattern for notifying the UI thread from inside a Runnable?

Anyone interested in pulling this code and seeing if the master branch and the easier_flow branch work for them?

Thanks for your eyeballs.
1
2
Wilhelm Fitzpatrick's profile photoChris Dawson's profile photo
3 comments
 
Thanks +Wilhelm Fitzpatrick​. This is great, I'll give these suggestions a try.
Add a comment...

Chris Dawson

Discussion  - 
 
Hi, I just wrote a book for O'Reilly on the GitHub API. There is a chapter in the book that explains how to write a single page app that speaks to the GitHub API using Github.js and AngularJS. The chapter includes Karma (using Jasmine) tests, and one of the reasons I chose AngularJS for the book was its strong commitment to testable JS code. Note there is no ReactJS chapter. :)

All the code samples are here: github.com/xrd/building-tools-with-github

You can find the book here: shop.oreilly.com/product/0636920043027.do

And, until tomorrow there is a good deal on all GitHub ebooks (50% off). http://shop.oreilly.com/category/deals/github.do?mobile=off&code=WKGTHB

Hope this helps people interested in writing testable AngularJS applications. Happy to answer questions on the code samples even if you don't buy the book. 
7
Add a comment...
Work
Occupation
CEO/President
Skills
JavaScript, Ruby on Rails, Android, Linux
Employment
  • Webiphany
    2001 - present
  • Box Populi
    CEO/President, 2003 - 2010
  • RealNetworks
    Application Engineer, 1999 - 2001
  • Virage
    Software Engineer, 2001 - 2003
  • Claris (Apple)
    Software Engineer, 1996 - 1997
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Portland, OR
Previously
Portland, OR - Sapporo, Japan - Kanazawa, Japan - Rio de Janeiro, Brazil - Salvador, Bahia, Brazil - Seattle, WA
Links
Education
  • University of Washington
  • Reed College
Basic Information
Gender
Male
Birthday
December 11
Chris Dawson's +1's are the things they like, agree with, or want to recommend.
Millennials to Snake People
chrome.google.com

Replaces the text 'Millennial' with 'Snake People'.

Freehand Drawing
market.android.com

Freehand drawing is the simple drawing canvas. User can draw any shape and save them as image.Simple and light size of just 20Kb. :)Can be u

Fala Geral
market.android.com

Shop Google Play on the web. Purchase and enjoy instantly on your Android phone or tablet without the hassle of syncing.

the quiet place
amitaytweeto.com

have you ever noticed how many things require your attention?

Input/Output - Google I/O 2012
developers.google.com

Google I/O 2012 brings together thousands of developers for three days of deep technical content focused on building th

Aldiko Book Reader
market.android.com

Read and download thousands of eBooks right on your Android phone or tablet.Download one of the best Android eBook Readers now!★The leading

MediaHouse UPnP / DLNA Browser
market.android.com

Stream music, videos, movies and pictures from PC, NAS or any other device running UPnP/DLNA compliant media server. MediaHouse powers your

Google I/O 2012
developers.google.com

Google I/O 2012 brings together thousands of developers for three days of deep technical content focused on building th

The Story of Send
www.google.com

Follow an email on its journey to see what happens when you send a message. Along the way, discover our data centers with videos and photos.

Portland Real Estate &amp; Homes for Sale Portland
ericsteindler.com

Portland Real Estate &amp; Homes for Sale: Search all active real estate listings in the Portland area including bank owned foreclosures,REO

American Ninja
www.youtube.com

Spoof / Parody of "American Woman" by the Guess Who with a Ninja Twist.

Seven Steps to Creating a Data Driven Decision Making Culture.
www.kaushik.net

Home; Press, Videos, Podcasts; Speaking Engagements; Knowledge; About ▼. Avinash Kaushik; Mi Pequeña Pasión; Occam&#39;s Razor – What ? Disc

Moving Teachings: learn and teach on public transportation
www.youtube.com

MovingTeachings.com helps you connect with people sitting next to you on the bus. Everyone has a hidden talent; use MovingTeachings.com to e

AtmTag.com: stop paying outrageous ATM fees
www.youtube.com

Use AtmTag.com on your mobile phone to search for the closest and least expensive ATM for you.

"Cloud Atlas" in The New Yorker's Archive : The New Yorker
www.newyorker.com

In this week’s issue, Aleksandar Hemon chronicles Lana and Andy Wachowski’s long journey to make a film adaptation of David Mitchell’s best-

The Bravest Man in the Universe
www.bravestman.com

Join Bobby Womack in an interactive music journey. A Mobile Chrome experiment.

Web Lab: Orchestra
www.chromeweblab.com

Web Lab. A series of interactive Chrome Experiments made by Google. See the magic of the web brought to life. Open to the world online. Live

How to Get Me Involved in Your Smartup
jeffsayre.com

I receive six to eight requests for help from startups each year—from angel investing, to advising, to consulting, to joining as a founder.

Three Months, Three Weeks &amp;Two Days
market.android.com

Shop Google Play on the web. Purchase and enjoy instantly on your Android phone or tablet without the hassle of syncing.