Android OS is currently installed on more mobile devices than any other OS which makes is a very popular and lucrative platform to learn. Also, the Android OS can be installed on:
Smart Phones
Tablets
Amazon Fire devices
Chrome OS devices
Android TV
Android Wear (e.g., watches)
Android Glasses
Android Auto
Except for the framework, an app's APK is composed of the following resources that you have complete control over:
Framework (e.g., SDK, Gradle Build, etc.) -
Settings (e.g., AndroidManifest.xml file) - defines the look-and-felt of the app, its settings, version numbers, etc.
Assets (e.g., audio, video, images) - any file or resource that is usde by the app.
Layout files (e.g, xml and java files) - xml files or java classes that are used to define the app layout and its components (e.g, text fields, buttons, listviews, etc.)
Classes (e.g., built-in and custom class files) - code on how the app works, behaves and how it handle events (e.g., button events).
These resources are compiled to build the app using a build system called Gadle Build
To test and enable an Android device for development requires several environments and settings to be setup. While these processes are tedious, most of them are one-time setup unless you have to upgrade to a newer version:
NOTE: If you are using HTML5, CSS3 and JavaScript to create an app using PhoneGap and you would like to test on a real device, you only need to do the last step (Test on Real Device(s)) and only the Test on Real Device with PhoneGap.
Google takes a very different approach to unlocking a device for development purposes from Apple. Android allows you to install and run apps that have not been digitally signed for public release (debug version). But in order to do so, you must first enable a setting on a device that is turned off by default on a real device. And since there are so many types of Android devices and versions of the Android OS, the exact instructions on how to set it might be different. If you're having trouble locating it, do a quick online search. The apps PhoneGap Build compiles for Android are actually assigned a debug key automatically. When an app is ready to release publicly it will need to be signed digitally with a personal key.
You don't have to use an IDE to create an app, you can use a Command Line Interface (CLI) using PhoneGap. However, it is easier to use a free IDE like Android Studio from Google that has replaced Eclipse as the tool of choose. Android Studio is based on the Java development environment called IntelliJ IDEA created by JetBrains and is available for Windows, Mac OS X and Linux.
Configure Environment
Now that you know how to navigate the Android Studio project structure, you will want to configure certain aspects of it to control the appearance and behavior of Android Studio.
Go to File > Settings... (CTRL+ALT+S) on Windows and go to the Android Studio menu and select Preferences (CMD + ,) on the Mac.
Appearance
Console Folding
Debugger
Editor (e.g., line numbers, colors and fonts) NOTE: Under Colors and Fonts, to create custom themes by click the Save As... button and give the scheme a new name.
etc. TIP: To reset the settings to the defaults, close Android Studio and then delete the folder .Android Studio under the Home folder in Windows and in the
/Library/Preferences/Android Studio on the Mac and then restart Android Studio.???
Check For Updates
You should check every now-and-then for updates to ensure you have the latest version.
Open Android Studio and click the Help >Check for Updates Now link.
If there's a newer version available, you can update and restart immediately.
NOTE: It is important to note that there are multiple channels for updates. The Stable Channel is the default. However, you can change it to another channel. To get the latest version that have not be fully tested, change to the Canary Channel.The Canary Channel will offer early beta software that may not have been fully tested but has new features and improvements. After a few days of testing, it will be promoted to the Beta Channel.
Click the Configure button and then on Windows, click on Settings and on Mac, click on Preferences.
Click on the Updates option to change to another channel.
NOTE: On Windows, you might be prompted with the User Account Control dialog box. And on Mac, you might need to type in your administrative password.
Restart Android Studio.
Another place to check for updates in in the SDK Manager.
Open the SDK Manager:
From the Welcome screen, click on the Configure > SDK Manager from the bottom of the window..
From the menu, select Tools > Android > SDK Manager.
From the of the window, select the SDK Manager icon.
Use the SDK Platforms tab to download different versions of the Android SDK. Each API level corresponds to an Android version (e.g., Android 6 (Marshmellow) refers to API Level 23). The minimum API Level the is set by default is Android 4.0.3 (IceCreamSandwich) or API Level 15 so you will need to download that version as well.
Integrating Source Control
Android Studio also provide ways to integrate with many source control packages (e.g., CVS, Subversion, git) via add-ons which allow it to manage checking out files, etc. However, not all files are suitable for source control (e.g., files in the bin and gen directories).
To exclude these files add some extension to the exclusion list (e.g., *.apx, *.ap_, *.dex). ????
Import Sample Apps
Another way to test and learn how to use Android Studio is to import sample apps.
Open Android Studio, go to File > New > Import Sample... and select a sample from the list and then click the Next button.
NOTE: You can click the browse the source in GitHub link to view the source files. You will have to install Git on your computer if you don't already have it installed or go DIRECTLY to GitHub and clikc on the Download zip file to download the file from there.
Accept the defaults and then click the Next button.
NOTE: Many samples may use a older version of the Android Build Tools. You could update the Gradle file to the latest version or click the link at the bottom of the screen and follow the prompts, click the Accept radio button and then click the Next button to download the needed Build Tools.
In the Configure Sample dialog box that appears, accept the defaults and then click the Finish button and return to Android Studio.
In the Language Level Changed dialog box, you will be prompted to reload the project, so click the Yes button.
Click the Run button and choose a virtual device and then click the OK button.
CHECK POINT: You should see the app load in the virtual device.
(Optional) Return to Android Studio and examine the files that were created from the sample app.