Dallas Gutauckishttp://dallasgutauckis.com/
Wed, 19 Apr 2017 13:38:23 +0000Wed, 19 Apr 2017 13:38:23 +0000Jekyll v3.4.3Generate JUnit assertions from your JSON<p>Got some JSON you want to build into a model and test?</p>
<p>It can be pretty tedious writing all of that code. Instead, why not generate the assert* code automatically? I&#39;ve been writing code manually for a while now and finally decided to build something to write that boilerplate code for me.</p>
<p>I&#39;ve put up a <a href="http://json-java-test-writer.herokuapp.com">live version</a> for anyone to use, as well as <a href="http://github.com/dallasgutauckis/java-json-test-writer">open-sourced it on GitHub</a>. Let me know what you think!</p>
<p>Here&#39;s some JSON to test with:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w">
</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
</span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"An ice sculpture"</span><span class="p">,</span><span class="w">
</span><span class="nt">"price"</span><span class="p">:</span><span class="w"> </span><span class="mf">12.50</span><span class="p">,</span><span class="w">
</span><span class="nt">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"cold"</span><span class="p">,</span><span class="w"> </span><span class="s2">"ice"</span><span class="p">],</span><span class="w">
</span><span class="nt">"dimensions"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nt">"length"</span><span class="p">:</span><span class="w"> </span><span class="mf">7.0</span><span class="p">,</span><span class="w">
</span><span class="nt">"width"</span><span class="p">:</span><span class="w"> </span><span class="mf">12.0</span><span class="p">,</span><span class="w">
</span><span class="nt">"height"</span><span class="p">:</span><span class="w"> </span><span class="mf">9.5</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="nt">"warehouse_location"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="nt">"latitude"</span><span class="p">:</span><span class="w"> </span><span class="mf">-78.75</span><span class="p">,</span><span class="w">
</span><span class="nt">"longitude"</span><span class="p">:</span><span class="w"> </span><span class="mf">20.4</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div>Fri, 27 Feb 2015 06:35:51 +0000http://dallasgutauckis.com/2015/02/27/generate-junit-assertions-from-your-json
http://dallasgutauckis.com/2015/02/27/generate-junit-assertions-from-your-jsonUncategorizedAndroid Animations: Bring Your Application to Life<p>My Animation talk from Droidcon New York City 2014</p>
<ul>
<li><a href="https://speakerdeck.com/dallasgutauckis/android-animations">Slides on SpeakerDeck</a></li>
<li><a href="https://www.dropbox.com/s/qhim23pfk3smsse/Android%20Animations.zip?dl=0">Original keynote with animations</a></li>
<li><a href="https://github.com/dallasgutauckis/AnimationStation">Sample app for camera distance tip</a></li>
</ul>
<p>Video:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/odRemFcN4CE" frameborder="0" allowfullscreen></iframe>
Mon, 02 Feb 2015 20:22:09 +0000http://dallasgutauckis.com/2015/02/02/android-animations-bring-your-application-to-life
http://dallasgutauckis.com/2015/02/02/android-animations-bring-your-application-to-lifePresentationsWi-Fi issues on Moto X 2nd Gen<p>I received my 2nd Gen Moto X today. During setup, I attempted to connect to our company&#39;s Wi-Fi network to no avail. I was able to connect to another public Wi-Fi in the area but for some reason not to our typical Cisco WAP setup at work. All of the other devices we have at work are able to connect to the network, so I&#39;m not sure what is going on.</p>
<p>I&#39;ve contacted Motorola customer support, supplied a logcat output of the Wi-Fi-related messages during the connection attempt, but they were not immediately able to resolve the issue. Instead, they&#39;ve gathered my information and will be reaching out to me after escalating the issue internally.</p>
<p>I&#39;ll follow up more here as this issue and hopefully resolution progresses.</p>
<p><strong>UPDATE 1 [2014-09-26T14:30:00EST]</strong>: Motorola has called me back and are currently connecting me to their &quot;level 2 support&quot;. I&#39;m on hold now waiting for them to chime in. Will update more as this progresses.</p>
<p><strong>UPDATE 2 [2014-09-26T14:40:00EST]</strong>: Motorola got back on the phone with me and explained that their level 2 support is currently swamped and that they have my information and will call me in the next 24 hours.</p>
<p><em>In the meantime, I&#39;ll just blow through my carrier data allocation as I install all of my apps again (because I had to reset my phone to see if that&#39;d solve the problem).</em></p>
<p><strong>UPDATE 3 [2014-09-27T14:07:00EST]</strong>: Someone by the name of &#39;Matt&#39; followed up on this blog in the comments to ask me to bring the conversation to email. So, I did. The conversation so far is as follows:</p>
<p><strong>Me to them</strong></p>
<blockquote>
<p>From: Dallas Gutauckis &lt;[redacted]&gt;<br>
Date: Fri, Sep 26, 2014 at 11:37 PM<br>
Subject: Re: http://dallasgutauckis.com/2014/09/26/wi-fi-issues-on-moto-x-2nd-gen/#comments<br>
To: supportforums@motorola.com</p>
<p>Hi,</p>
<p>Someone naming himself Matt commented on my blog post about the Wi-Fi issue some users are having with their 2nd Gen Moto X asking me to reach out. I already have an ongoing support issue ([redacted]) where I also already shared logcat output — not much but all I could give.</p>
<p>Let me know if there is something else I can provide to get this matter resolved expediently.</p>
<p>Best,<br>
Dallas</p>
</blockquote>
<p><strong>Them to me</strong></p>
<blockquote>
<p>From: Motorola Support Forums &lt;[redacted]&gt;<br>
Date: Sat, Sep 27, 2014 at 10:00 AM<br>
Subject: Re: http://dallasgutauckis.com/2014/09/26/wi-fi-issues-on-moto-x-2nd-gen/#comments<br>
To: Dallas Gutauckis &lt;[redacted]&gt;</p>
<p>Hi Dallas.</p>
<p>Have you updated your router software? The Wifi team says old software versions of Cisco APs have problem with PMF supported devices. Cisco fixed this issue in later software versions.</p>
<p>Let me know if that helps. Thanks.</p>
<ul>
<li>Matt</li>
</ul>
<p>Matt and Mark<br>
Social Media - Customer Care<br>
Motorola Mobility<br>
Visit us at https://forums.motorola.com</p>
</blockquote>
<p><strong>Me to them</strong></p>
<blockquote>
<p>From: Dallas Gutauckis &lt;[redacted]&gt;<br>
Date: Sat, Sep 27, 2014 at 2:06 PM<br>
Subject: Re: http://dallasgutauckis.com/2014/09/26/wi-fi-issues-on-moto-x-2nd-gen/#comments<br>
To: Motorola Support Forums &lt;[redacted]&gt;</p>
<p>Matt,</p>
<p>I&#39;m unaware of whether the AP is up to date, and unfortunately, I&#39;m not going to be able to simply try to update the routers because we don&#39;t employ any full-time IT staff capable of managing the routers — this would instead require we pay a contractor to come in and ensure they&#39;re up-to-date, something I&#39;m not willing to do if we can&#39;t be sure it&#39;s the problem.</p>
<p>I know of other people having the issue — they might be able to check such a thing on their network. See https://twitter.com/cavega_/status/515566709927706624</p>
</blockquote>
<p>What I still don&#39;t understand is why this is a 2nd-Gen-specific issue and not 1st-Gen. I realize they&#39;re different devices, and potentially different networking hardware, but I would assume if it can work on one, it can work on the other.</p>
<p>Not yet sure where this is going to get us…</p>
<p><strong>UPDATE 4 [~2014-09-27T9:00:00EST]</strong>: Got a call that went to voicemail (because I was still asleep). The caller said they were just checking in on me to see if my issue was fixed or not. If it wasn&#39;t, they gave me the number to contact their level 1 support (seems I&#39;ve been downgraded). Obviously, nothing has changed, so nothing is resolved. <em>Note that this call came in before the email response from Matt.</em></p>
<p><strong>UPDATE 5 [2014-10-07T19:30:00EST]</strong>: Our IT contractor happened to need to come in to set up network redundancy for our internet connection, at which time we also asked him to update the Cisco controller. The update seems to have fixed the PMF as suggested by Motorola support. Quick! Call your IT gang out to update your controllers. Best of luck to all. Still a ridiculously shitty experience to have for a new device [where they know it&#39;s going to be broken for users].</p>
Fri, 26 Sep 2014 17:38:17 +0000http://dallasgutauckis.com/2014/09/26/wi-fi-issues-on-moto-x-2nd-gen
http://dallasgutauckis.com/2014/09/26/wi-fi-issues-on-moto-x-2nd-genUncategorizedAndroid Animation &mdash; Bringing Your Applications to Life @ Droidcon NYC 2014<p>Last weekend, I gave a talk on animation on Android at the innaugural Droidcon NYC (2014). The talk was well-received and I got some tough questions. Nonetheless, I&#39;m happy I did it and I&#39;m posting the presentation for your viewing pleasure. I highly recommend checking out the actual Keynote file (linked to from the Speakerdeck site) if you can as it includes the videos/animations as opposed to just static images.</p>
<p><a href="https://speakerdeck.com/dallasgutauckis/android-animations">speakerdeck</a></p>
<p>You can check out all of my presentations (regardless of how old they are) at <a href="/about/presentations/">/about/presentations/</a></p>
Thu, 25 Sep 2014 04:25:08 +0000http://dallasgutauckis.com/2014/09/25/android-animation-bringing-your-applications-to-life-droidcon-nyc-2014
http://dallasgutauckis.com/2014/09/25/android-animation-bringing-your-applications-to-life-droidcon-nyc-2014PresentationsAndroid Authority: Best resources for Android development<blockquote>
<p>Whether you’re a seasoned professional or just beginning with Android development, this list of resources (including tools, libraries, and blogs) is useful for any developer or team on just about any project, big or small.</p>
</blockquote>
<p>Read more: <a href="http://www.androidauthority.com/best-resources-android-development-372414/" title="Best resources for Android development">Best resources for Android development</a></p>
Mon, 12 May 2014 03:29:27 +0000http://dallasgutauckis.com/2014/05/12/android-authority-best-resources-for-android-development
http://dallasgutauckis.com/2014/05/12/android-authority-best-resources-for-android-developmentUncategorizedListing connected Android devices with OS version and model<p>I was wandering down the path of trying to associate the myriad of devices connected to my machine for debugging. I wanted to know very easily what the devices&#39; model and OS version were without having to manual check by disconnecting and reconnecting devices and using the process of elimination.</p>
<p>One way to see this information is using a special flag with adb:</p>
<div class="highlight"><pre><code class="language-" data-lang="">adb devices -l
</code></pre></div>
<p>This yields something like</p>
<div class="highlight"><pre><code class="language-" data-lang="">List of devices attached
HT16JHX24920 device usb:14130000
015d2a506750081b device usb:14120000 product:nakasi model:Nexus_7 device:grouper
4d005e148cc950eb device usb:14112000 product:ja3gub model:GT_I9500 device:ja3g
0A3BC06A11010002 device usb:14140000
e08b84fd device usb:14113000
HT346W912280 device usb:14114000
</code></pre></div>
<p>Which as you can probably tell doesn&#39;t give us all of the information we want, nor does it seem to work on every device.</p>
<p>So instead, I wrote a script for printing out what I needed. The bash script reads properties from the device via <code>adb shell</code>.</p>
<p>The output for that looks like:</p>
<div class="highlight"><pre><code class="language-" data-lang=""> HT16JHX24920 [ 4.0.3]: PG86100
015d2a506750081b [ 4.4.2]: Nexus 7
4d005e148cc950eb [ 4.3]: GT-I9500
0A3BC06A11010002 [ 4.1.2]: DROID RAZR
e08b84fd [ 4.1.1]: SAMSUNG-SGH-I747
HT346W912280 [ 4.1.2]: HTC One
</code></pre></div>
<p><a href="https://gist.github.com/dallasgutauckis/10306968">View, download, or fork the script</a></p>
<p>In case you were curious, the corresponding properties are:</p>
<div class="highlight"><pre><code class="language-" data-lang="">$ adb shell getprop ro.product.model
PG86100
</code></pre></div>
<p>and</p>
<div class="highlight"><pre><code class="language-" data-lang="">$ adb -s HT16JHX24920 shell getprop ro.build.version.release
4.0.3
</code></pre></div>Wed, 09 Apr 2014 18:46:36 +0000http://dallasgutauckis.com/2014/04/09/listing-connected-android-devices-with-os-version-and-model
http://dallasgutauckis.com/2014/04/09/listing-connected-android-devices-with-os-version-and-modelUncategorizedMaking Borders for Views Using layer-list<p>Android is full of many ways to do things differently. One of those things happens to be making a border for a View.</p>
<p>The common approach I&#39;ve seen is for developers to have two Views. One View is the View with a background (be it solid, bitmap, or otherwise). The other View acts as a border, typically either 1px or 1dp in width or height, the other side matching the height or width of the other View. Although this is certainly an easy approach, at adds more to your layout than is likely necessary.</p>
<p>Example with Views:</p>
<div class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt">&lt;View</span>
<span class="na">android:layout_width=</span><span class="s">"match_parent"</span>
<span class="na">android:layout_height=</span><span class="s">"1px"</span>
<span class="na">android:background=</span><span class="s">"#ccc"</span> <span class="nt">/&gt;&lt;/p&gt;</span>
<span class="nt">&lt;TextView</span>
<span class="na">android:layout_width=</span><span class="s">"match_parent"</span>
<span class="na">android:layout_height=</span><span class="s">"wrap_content"</span>
<span class="na">android:background=</span><span class="s">"#eee"</span>
<span class="na">android:text=</span><span class="s">"Hello, World"</span> <span class="nt">/&gt;</span>
</code></pre></div>
<p>Assuming those Views are encapsulated in a LinearLayout with vertical orientation, you&#39;ll end up with a TextView with background of <code>#eee</code> and top border of <code>#ccc</code>.</p>
<p>Now, let me introduce you to <a href="http://developer.android.com/guide/topics/resources/drawable-resource.html#LayerList">layer-list</a>…</p>
<p>layer-list allows you to do many things regarding multiple drawables. One of the more common implementations is adding a border to something.</p>
<p>I&#39;ll explain by example:</p>
<div class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="cp">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span>
<span class="nt">&lt;layer-list</span> <span class="na">xmlns:android=</span><span class="s">"http://schemas.android.com/apk/res/android"</span><span class="nt">&gt;</span>
<span class="nt">&lt;item&gt;</span>
<span class="nt">&lt;shape&gt;</span>
<span class="nt">&lt;solid</span> <span class="na">android:color=</span><span class="s">"#ccc"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;/shape&gt;</span>
<span class="nt">&lt;/item&gt;</span>
<span class="nt">&lt;item</span> <span class="na">android:top=</span><span class="s">"1px"</span><span class="nt">&gt;</span>
<span class="nt">&lt;shape&gt;</span>
<span class="nt">&lt;solid</span> <span class="na">android:color=</span><span class="s">"#eee"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;/shape&gt;</span>
<span class="nt">&lt;/item&gt;</span>
<span class="nt">&lt;/layer-list&gt;</span>
</code></pre></div>
<p>What this example shows is the layer-list way of going about the previous example. This will produce a drawable that has a 1px solid top border colored <code>#ccc</code> and a background of <code>#eee</code>. The confusing part to this for most people tends to be where the 1px is designated. layer-list draws top-down in the XML. This means that #ccc is drawn in the full background first, and then #eee is drawn over top of that, with a 1px top offset.</p>
Thu, 20 Mar 2014 15:01:42 +0000http://dallasgutauckis.com/2014/03/20/making-borders-for-views-using-layer-list
http://dallasgutauckis.com/2014/03/20/making-borders-for-views-using-layer-listUncategorizedA Better Parcelabler...<p>A little bit ago (okay, a long time ago) I wrote <a href="http://dallasgutauckis.com/2012/01/20/parcelabler-for-implementing-androids-parcelable-interface/" title="parcelabler: for implementing Android’s Parcelable interface">a blog post about a tool I wrote for creating Parcelable implementations for Android</a>. At time of writing, I knew it wasn&#39;t a great solution, but that at least it worked... Since then, I constantly put off writing what I thought would be a better solution: an IDE plugin.</p>
<p>So last week, I embarked upon the journey of making a plugin for Android Studio. I immediately saw that <a href="https://github.com/mcharmas/android-parcelable-intellij-plugin">something existed</a>, but it was a bit older, and not quite as feature-packed as I had hoped. So, I took it upon myself to <a href="https://github.com/mcharmas/android-parcelable-intellij-plugin/pull/7">make some enhancements and submit a pull request</a>.</p>
<p>I&#39;ll be continuing development under <a href="https://github.com/dallasgutauckis/android-parcelable-intellij-plugin">my fork</a>, where you&#39;ll always be able to grab the latest as I work on enhancements. Please feel free to fork and submit pull requests as well.</p>
<p><a href="https://github.com/dallasgutauckis/android-parcelable-intellij-plugin">Check out the plugin...</a></p>
Mon, 10 Feb 2014 23:19:33 +0000http://dallasgutauckis.com/2014/02/10/a-better-parcelabler
http://dallasgutauckis.com/2014/02/10/a-better-parcelablerprogrammingprojectsandroidMoving to New Opportunities, New Things, New York...<p>Over six-and-a-half years ago, I joined a small startup, MeetMe (then myYearbook), of around 20 or 30 employees in the small, artsy town of New Hope, PA. Over the years, MeetMe provided me with many opportunities to grow and learn, allowing me to transition from a full stack web engineer to an Android engineer. I truly am grateful not only for the opportunities that I&#39;ve been given, but also for the team that I&#39;ve gotten to work with.</p>
<p>But then, there is change. I&#39;ve decided to make a transition and move on to new opportunities. I can&#39;t express how excited I am to transition to my new role as the lead Android engineer for SeatGeek, a search engine of sorts for finding great tickets to events -- be it sports, theater, music, or otherwise.</p>
<p>I&#39;m excited for all of the new challenges I&#39;ll face working with the <a href="http://seatgeek.com">SeatGeek</a> team, and I wish all of the best to the MeetMe team as they continue to help the world meet new and interesting people.</p>
Tue, 04 Feb 2014 20:59:59 +0000http://dallasgutauckis.com/2014/02/04/one-new-place-to-another
http://dallasgutauckis.com/2014/02/04/one-new-place-to-anotherprogrammingMeetMeSeatGeekAndroid Animation: Bringing Your Application to Life<p>At MeetMe, we have a yearly internal conference wherein we invite folks internal and external to speak to the team (en masse &amp; in breakouts) about emerging technology, trends, core company bits, etc. My core focus this year has been about spicing up our Android applications through exceptional UI/UX specifically using the grace and beauty of animations. As they say, sharing is caring, and I want everyone else to have access... so please, take a look through my presentation. If you have feedback, questions, hate mail, or anything else -- please comment below.</p>
<p><a href="https://speakerdeck.com/dallasgutauckis/android-animation"><img src="http://res.cloudinary.com/drnxhecup/image/upload/c_crop,h_528,w_528,x_88,y_0/h_150,w_150/v1395532660/Screen-Shot-2013-12-31-at-17_15_49_rapucj.png" alt="Screen Shot 2013-12-31 at 17.15.49"></a></p>
<p>https://speakerdeck.com/dallasgutauckis/android-animation</p>
Tue, 31 Dec 2013 22:17:39 +0000http://dallasgutauckis.com/2013/12/31/android-animation-bringing-your-application-to-life
http://dallasgutauckis.com/2013/12/31/android-animation-bringing-your-application-to-lifeprogrammingandroiddesignpresentations