Saturday, May 28, 2016

Using Android Studio Virtual Machines - Emulators

 
 

Android Studio Virtual Device Manager

If you want to test your app on a variety of devices you can do so without owning the hardware - instead you can run your app programs on virtual devices on your computer screen to see how they will function before you put them in the marketplace.
 
You can select the Android Virtual Device (AVD) Manager in Android Studio above the Main Editor Window.
 
 



In the manager window click on Create Virtual Device



In the configuration window select the hardware type you would like to test with and hit NEXT




In the System Image window, use the recommended armeabi-v7a  (with Google APIs) which should work on most desktops without the need for additional emulator compatibility steps - hit NEXT




To verify the configuration - Hit FINSIH



Hit the Play Button next to the newly created virtual device to launch it and then close the manager window


The Virtual Device will then open and boot - the boot time is similar to an actual device


Running Apps on the Android Studio Virtual Emulator


You can run your app project on the virtual device by hitting the RUN APP button just above the Main Editor Window in Android Studio




Choose the emulator device you want to run your app on (or launch a new emulator device) and hit OK




If it doesn't work the first time just try it again - I had to rerun this a few times and wait a while for it to run properly





Wednesday, May 25, 2016

The Android Studio Editor Interface

 
 

Creating a New Android Studio Project

Once Android Studio is installed, click on the Start a New Android Studio Project Button

 

 
In the New Project Window edit the project name to something unique (update location if desired) and hit NEXT




Ensure that Phone and Tablet is selected, Choose API 21, and Hit NEXT


 

Select the Empty Activity and hit NEXT
 
 
Leave the default names and hit FINISH
 
 

The Android Studio Editor

 

The Main Editor Window is for viewing, creating, and editing the files that make up your Android Project
 
 
The Program Files Window shows you an overview of your whole project
 
 
 
 
By Selecting the Tab activity_main.xml you can view the Interface Editor
 
 
 
The Interface Editor Window allows you to drag and drop different items into the user interface of your app (ie adding a button to the interface)
 
 
  
You can then program the functionality of these items in the Text Tab which has added some initial code for that component automatically
 
 
 
 If you lose a menu just click on the name on the side or bottom of the screen to toggle that menu's visibility
 
You can expand / contract menus by clicking and dragging the windows dividers (double arrows appear when the divider can be moved)
 
 
 
 


Sunday, May 22, 2016

Getting Started with Android Studio - Installation Guide



Android Studio - Installation


The following guide goes through the complete installation of Android Studio and associated items along with links so you can easily follow along.


STEP 1: Install the JAVA Development Kit (JDK)


Go To - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

for latest version check : http://www.oracle.com/technetwork/java/javase/downloads/index.html




Accept the license agreement

Choose the specific install that matches your computer configuration 

I am using a Windows x64 machine -

 
Save and Run the .exe file
 
The Installation Wizard will open 
 
Hit NEXT -
 
 
 
Install the Development Tools and Source Code to the default location-
 
Hit NEXT -

 
 
 
Hit NEXT Again to install in the default location folder -
 
 
 
Hit CLOSE once the installation is complete -
 
 



Ensure that the  JAVA_HOME environmental variable points to the location of your JDK install.

For Windows 8 go to the control panel -> system -> advanced system settings


Select Environmental Variables -


Highlight the JAVA_HOME Variable

Hit EDIT -



Fill in the full file location of the JDK that was installed earlier and hit OK -



STEP 2: Install Android Studio IDE (Integrated Development Environment)

Go To - https://developer.android.com/studio/index.html

Hit the green DOWNLOAD Button



Accept the license terms

Click DOWNLOAD -



If the File Save Prompt does not pop-up try again -

Click Download on the Left -


 
Save (this may take a little while) and Run the .exe file
 
The Android Studio Setup will launch
 
Hit NEXT -
 
 
 
Make sure all three options are selected for install
 
Hit NEXT -
  
 
 Agree to the license terms -
 
 
Use the default locations for the install
 
Hit NEXT -
 
 

Click INSTALL -



When the install is complete hit NEXT -


Hit FINISH to close


IF you get an error about file not being found update the JAVA_HOME environmental variable to point to the location of your JDK install (see STEP 1).

Now you are all set!

Tuesday, May 17, 2016

Suggested Reading - Book Reviews



I put together some helpful book reviews for the suggested reading list from the WEEK 1 videos. I hope this helps you choose the right one / ones !


1. The Busy Coder's Guide to Android Development

Click Here
 
Click to Buy

Positives:
This book covers all of the basics and gets you started on your own app development quickly. It has a very straightforward, clear, and informal writing style with good illustrations of examples. There are a few associated books (see the Busy Coder’s Guide to Advanced Android Development - below) so you can step through the series as needed. The author is active online in various blogs and does a pretty good job at answering email if you have a specific question.

Negatives:
It’s a good source for using the Andriod SDK but is a bit out of date (references SDK 1.0) It is not specifically focused on JAVA programming – and is not specific to the Android Studio interface. It’s not as searchable for specific topics as other books if using it as a quick reference.

 Associated Books:


Click Here
 
Click to Buy


 2. The JAVA Programming Language - 4th Edition

Click Here  

 
Click to Buy

Positives: 

Academic, text-book style writing very specific to help program in JAVA. Very comprehensive covering all aspects of the programming language and its parts. Makes for a great catch-all reference book to look up topics as needed. 

Negatives:


This is written for more experienced JAVA users to use as a reference rather than to teach beginners. There are not a huge number of examples so you would be expected to be able to put different parts of the information taught together to create something that works. It is also not specific on programming for Android App development.


 3. Design Patterns: Elements of Reusable Object-Oriented Software

Click Here

 
Click to Buy

Positives:
A very well-known book for programmers, this book will teach you how to “think” about programming in object-oriented languages.  Identifying patterns in code (where you are essentially doing the same operation over and over again) is extremely important for properly structuring your program to run smoothly and quickly.  The great thing about patterns is they tend to fall into different types and this book explores how to identify and simplify your code in a way that follow its operation’s natural patterns.
  
Negatives:

Primarily going to be helpful if you are trying to do a large task with a little bit of code (Which is exactly what we want to do when programming for our limited Android Apps!)  If you are a beginner to programming it may not be obvious immediately where and how you would use this information.
  


 4. Design Patterns: Elements of Reusable Object-Oriented Software

 Click Here
 
Click to Buy

Positives:
Part of a five-book series it’s often compared to another programming staple “Gang of Four’s” Design Patterns: Elements of Reusable Object-Oriented Software (see # 3). This book is great for exploring the deeper thought that goes into what the “best” ways of coding are and why, and for the expert to raise their level of understanding of the complex trade-offs and choices that come up when programming in Object-Oriented languages.

Negatives:


This book often references items and ideas from the “Gang of Four’s” book so it works best as a companion. Probably best suited for the mid-level to high level programmers out there who are tackling larger projects and need to start to understand different ways to organize larger amounts of code cleanly.  It’s not going to specifically address JAVA or Android development/Android Studio but learning how to think about software architecture IS very important if you have an ambitious project in mind.