Setting up Software for development and testing

We're going to get into some fun and practical knowledge for this post.  As mentioned in my first blog post, this site will use C / C++.  To that end, we'll start with examining the tools we'll use and getting the IDE (Integrated Development Environment) setup.  In order to try and avoid confusion, I will present a survey of IDE choices and setups that are popular and give advantages and disadvantages of each along with when to use them.  If you feel confused anywhere within this post, just skip to the Android Studio at the end, using it and Gradle is not only the official way to do things, it's also what I'll use in all my projects that target Android on this blog.

Choosing an IDE

Up until recently, May of 2015 when Google announced Android Studio Native Development Kit support; the old official way of using the Native Development Kit involved using an IDE known as Eclipse.  While I'll be mentioning the official ways, but there are non-official IDEs that are worth examining as well.  Microsoft Visual Studio can be paired with the NDK to create a valid application fairly easily.
To keep with the times, I'll use and encourage use of Android Studio and the experimental gradle.
I'll create a separate post surrounding what gradle is and how to use it (both the current gradle and the experimental).  However, in this post I want to concentrate on the tools we need to download and provide an overview on how to use them.  So for now, let's get the latest Android Studio downloaded and look at some of the supporting toolsets I like to use.

Setting up Tools


  1. Git - First, there's the need to use a version tracking system.  I highly recommend git as it supports Android Studio natively and you can always see what changed and why, no matter what platform you're developing from.  Get Git here along with install instructions: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
  2. Trepn Power Profiler - Next you should grab some tools to help you tell how your app is performing.  The Trepn Power Profiler will tell you how much power your app is drawing in order to run.  As power consumption is vital to embedded development, being able to know what it takes to run the code you have and where to optimize your code is key to being kind to your users.  As we'll discover in a later blog post, networking is a very costly operation.
  3. Snapdragon Profiler - In addition to a power profiler, a profiler will tell you how the app is performing on the processor.  We want to find ways to get more use out of the same hardware, the only way to do that is to optimize.  To quote one of the great computer scientists, Don Knuth, "premature optimization is the root of all evil."  Once you have code written, you can check where to optimize by profiling it; without this important step, you could be optimizing code that isn't the source of the slow down problem.
  4. Google Tests or gtests - I'm a big believer in writing unit tests and test driven development.  Having a test framework that automatically runs all units of your program through rigorous tests is very often the difference between bugs buried deep in the Labyrinth of a large code base.  Unit tests are a programmers' tool for knowing that parts of the code work as designed independent of other parts of code.
  5. Valgrind - I will do a whole blog post on how to use this incredibly handy tool.  However, for now, know that this tool will help find memory problems.  I typically will use it in a continuous integration (CI) solution that allows me to monitor if the latest checkin from git doesn't release the memory it allocated.  Memory leaks are often the source of many subtle problems caused when a programmer allocates and reserves memory for their data structures but fails to release it back to the operating system once they are done with it.
  6. Jenkins - Speaking of Continuous Integration, this is one of my favorite solutions.  It has a simple web user interface and allows you to create builds automatically for your automatic tests.  When something stops working, a CI solution makes it possible to know when it stopped working and can save many hours in tracking down a solution.  It also can generate reports that utilizes other tools posted here to give a better picture of the health of your project.
To get a better picture as to how to develop with each of these tools, I'm going to create a post about each and give an example project that uses each starting with the magic mirror project.  Join me in setting git up and I'll walk you through each of the steps for all 6 above tools.

Comments

Popular posts from this blog

Drone VR Software Architecture

Build Snapdragon Flight Drone

Soldering new connectors for the drone