Learning Android App Development: The Journey Begins

via <a href="https://commons.wikimedia.org/wiki/File:Android_App_Development.jpg" target="_blank">Johnsallen / Wikimedia Commons</a>

For more than a couple of years now, I have been wanting to learn how to develop mobile applications and made a couple half-starts with Android app development. My biggest hurdle, with any project, is coming up with an idea of what to create. While I lack the creativity to come up with an idea (great or small) of what to do, once I have that idea I am usually able to bring that idea to fruition. Back in July, the idea of creating a random job title generator was born. I decided that this idea can serve as a way for me to start learning about Android app development. This posting discusses some of my early issues in that learning process.

There was a very early bump that I had to go over and that was during the SDK installation process. The issue surrounds 32-bit vs 64-bit Java (though it’d be nice if that were cleared up by Oracle and company). Android Studio, a 64-bit application, requires that the 64-bit Java Developer Kit be installed first. When I went to www.java.com to download the JDK it provided me the 32-bit version automatically, presumably detecting that I was using a 32-bit Google Chrome browser. I wasn’t paying attention to this little detail and installed the 32-bit JDK which resulted in Android Studio refusing to install as a result. I uninstalled the 32-bit JDK, manually downloaded and installed the 64-bit JDK and all was well.

The Android development website includes a short tutorial on developing Android apps. The tutorial is a very short tutorial that guides you through creating a two screen app. The first screen allows you to enter text in a field and click on a button. That takes you to a second screen that displays the text that was provided by the user. The tutorial provided a good introduction to the Android Studio and some of its features. The step-by-step tutorial ended very quickly however. There is still a lot of good information at android.com but it is less guided with respect to learning development. I suppose this is where being a proficient programmer/developer to begin with helps out.

After the short tutorial I went forward with developing my Job Title Generator app. In doing so, there were a couple issues that I had to deal with and I figured I’d highlight them now. I created a function in the Java portion of the app to generate the job title and translated the PHP code I wrote previously for this function. There is a button in the app to generate a new job title and when that button is clicked the function is called. By nature of using the button, the function needed an argument containing a View. I also wanted to call this function from the main function when the application loads. I could never quite figure out how to get the View object during the app’s initialization phase, but I never used the View argument in my job title generation process. So I passed null to the function when the app loads. At some point, if I continue Android development, I’ll figure out how to obtain information about the app, including the available Views.

The next issue was a design layout issue. It was trivial to place the button and the “Would you like to be…” static text in their places and centering them in the view. The design portion of Android Studio takes care of this for me automatically. Properly placing and centering the job title itself was less straight forward, particularly since its length changes with every new job title, and therefore needs to be recentered with every change. The best solution I could find was when I updated the job title text I used the setGravity() function to Gravity.CENTER_HORIZONTAL. I was not completely happy with the results because sometimes the text is skewed a little bit to the left. But for the purpose of this quick and dirty app, it’ll do for now.

Developing the app and deploying with it Android Studio to my cell phone to test it was great. However, one purpose of doing this work was to add it to my portfolio. So I needed to learn how to build an unsigned APK that I could put on my website for people to try download and install if they should so desire. Simple instructions for creating the APK was found at StackOverflow. The instructions worked well. The only flaw was an issue with the naming of the APK file which Android Studio wanted to create it as app-debug.apk. “App” is the name of the Android Studio project and I was unable to rename the parent project/module to my desired name due to naming conflicts. To fix this would require some more comprehensive renaming and I wasn’t up for doing that for a simple play project.

So that is my initial adventure in Android Development. If you are interested in seeing the resulting app itself, you can check out the App section of my Portfolio. I may be willing to distribute the source code to potential employers, but I’m not ready to open-source it just yet. There is still the crazy thought of putting the app up in the Google Play store. The app publishing process is involved and I’ll save that for later.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.