ButterKnife and DeBugging with Logcat

ButterKnife is a coding utility and a great tool that software engineers use to instantiate the views in the layout code into the application code, however the “tidying up” process can create some interesting bugs in the code which gives the Android SDK Emulator fits, panic and seizures!

We are fans of the Android SDK built-in emulator, however a lot of software engineers also use GenyMotion for test their mobile apps before publishing their APK to the Google Play Store…

BTW, ButterKnife went to “@Bind” from “@Inject” commands for instantiating views in layout into application code (“Main_Activity.java”):

@Bind(R.id.timeLabel) TextView mTimeLabel;
@Bind(R.id.temperatureLabel) TextView mTemperatureLabel;
@Bind(R.id.humidityValue) TextView mHumidityValue;

ButterKnife.bind(this);

It is an important notation in order to maintain consistency!

In putting together the final touches on our new Android app IRIEWeather, a simple one-page weather forecast mobile application by Javadeus Labs using the Forecast.io API data stream we got a few errors and it is a great learning environment as software engineers often learn the most from their “bugs”.

It is also amazing to see some of the live data coming from the Internet and various APIs and integrating this data into a cool Android layout mockup:

IRIEWeather Layout

01-28 13:49:18.131 872-885/com.javadeus.irieweather E/MainActivity﹕ {“latitude”:37.8267,”longitude”:-122.423,”timezone”:”America/Los_Angeles”,”offset”:-8,”currently”:{“time”:1453988957,”summary”:”Mostly Cloudy”,”icon”:”partly-cloudy-night”,”nearestStormDistance”:6,”nearestStormBearing”:11,”precipIntensity”:0,”precipProbability”:0,”temperature”:48.98,”apparentTemperature”:48.98,”dewPoint”:46.2,”humidity”:0.9,”windSpeed”:1.93,”windBearing”:7,”visibility”:3.95,”cloudCover”:0.6,”pressure”:1025.52,”ozone”:294},”minutely”:{“summary”:”Mostly cloudy for the hour.”,”icon”:”partly-cloudy-night”,”data”:[{“time”:1453988940,”precipIntensity”:0,”precipProbability”:0},{“time”:1453989000,”precipIntensity”:0,”precipProbability”:0},{“time”:1453989060,”precipIntensity”:0,”precipProbability”:0},
Our code needs a little work! For software engineers, the debugging processes offers the greatest opportunities to learn more interacting with the Java programming language in Android SDK/IDE.

Logcat in Android SDK is a great feature of Android SDK. You can see the bugs in your code and work on each one and test in the SDK Emulator. It can be time consuming…but it is great for learning how to tidy up code and write cleaner code!

logcat:

at com.javadeus.irieweather.CurrentWeather.getFormattedTime(CurrentWeather.java:78)
at com.javadeus.irieweather.MainActivity.updateDisplay(MainActivity.java:107)
at com.javadeus.irieweather.MainActivity.access$200(MainActivity.java:30)
at com.javadeus.irieweather.MainActivity$1$1.run(MainActivity.java:77)

Leave a Comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s