## Installation of Android Studio
### 1.1. System requirements
Development for Android can be done on a reasonably sized computer. For a nice experience a modern computer is recommended, for example, a 2.6 GHz CPU with at least 8 GB of memory. An SSD speeds up the start of the Android emulator significantly.
### 1.2. Requirements for using Linux
The Android SDK is 32-bit, therefore on a 64-bit Linux system you need to have the package ia32-libs installed. For Ubuntu you can do this via the following command.
apt-get install ia32-libs
Please check your distribution documentation if you are using a different flavor of Linux.
On Ubuntu 13.04 you also have to install the OpenGL support. This can be done on Ubuntu 13.04 via following command.
# install OpenGL support
sudo apt-get install libgl1-mesa-dev
Please check your distribution documentation if you are using a different flavor of Linux.
### 1.3. Download Android Studio
Download Android Studio from the Android Studio website. The download comes in two flavors, SDK Tools only and Android Studio Packages. You want to download the Android Studio Package for your operation system.
### 1.4. Installation of Android Studio
Installation for Windows is simple, just lauch the .exe you downloaded. On Max OSX drag and drop Android Studio into the Applications folder.
On Linux unpack the downloaded ZIP file into an appropriate location for your applications. To launch Android Studio, navigate to the android-studio/bin/ directory in a terminal and execute studio.sh.
### 1.5. Configuration
The first time you start Android Studio you can select if you want to import your setting from an existing installation.
Afterwards click through the setup guide.
Once you reach the last page, press the Finish button.
## 2. Android SDK Manager
### 2.1. Using the Android SDK manager
The Android SDK Manager allows you to install specific versions of the Android API.
The Android SDK Manager allows you to install and delete Android packages.
### 2.2. Open the Android SDK manager in Android Studio
Select Tools ? Android ? SDK Manager or the SDK Manager icon in the toolbar of Android Studio to open the Android SDK manager.
### 2.3. Install selected Android version or library
In the Android SDK manager select the version of Android you would like to develop for from the tree and press the Install button. The following screenshot shows the selection for the API 18 version of Android.
Press the OK button to start he installation.After the installation is completed the select option is available.
The SDK Platforms tab is used to install API versions, which the SDK Tools is used to install the development tools.
### 2.4. Install support library
The support library allows you to use functionality provided by higher Android releases in lower Android versions.
In the Android SDK Manager select Extras and install the Android Support Repository. The Android Support Library is for the usage of the Eclipse ADT tooling.
Android currently has several versions of the library, the v4, v7 and v13 version which are valid as of the respective API level of Android. For example, the support library v7 works as of Android devices with version API 7. Higher versions of the support library require also the lower versions to work. For example, support library v7 requires the v4 library.
## 3. Using Android Virtual Devices or real devices for testing
### 3.1. Android emulator and Android Virtual Device
The Android tooling contains an Android device emulator. This emulator can be used to run an Android Virtual Device (AVD), which emulates a real Android phone.
AVDs allow you to test your Android applications on different Android versions and configurations without access to the real hardware. Even if you have a real Android device available, you should get familiar with the creation and usage of AVDs. Virtual devices give you the possibility to test your application for selected Android versions and a specific configurations.
During the creation of your AVD you define the configuration for the virtual device. This includes, for example, the resolution, the Android API version and the density of your display.
You can define multiple AVDs with different configurations and start them in parallel. This allows you to test different device configurations at once.
If you stop and AVD during startup process the AVD might get corrupted. The first start may take up to 10 minutes on an older machine. On a modern machine it typically takes 1-3 minutes for a new AVD to start.
After the AVD has started, you can control the GUI with the mouse. The emulator also provides access to the phone buttons via a menu on the right side of the emulator.
Once started, don't stop the AVD during your development. If you change your application and want to test a new version, you simply re-deploy your application on the AVD.
### 3.2. Debug certificate and expire date
Android applications must be signed before they can get installed on an Android device. During development Eclipse signs your application automatically with a self-signed certificate called the debug key.
This debug certificate has an expiration date of 365 days from its creation date. When the certificate expires, you will get a build error that the certificate has been expired.
To fix this problem, delete the debug.keystore file. The default storage location is in ~/.android/ on OS X and Linux, inC:\Documents andSettings[username].android\ on Windows XP, and in C:\Users[username]].android\ on Windows Vista and Windows 7.
The next time you build, the build tools will regenerate a new keystore and debug key.
### 3.3. Android device emulator shortcuts
The following table lists useful shortcuts for working with an AVD.
Table 1. Android device emulator shortcuts
Maximizes the emulator.
Changes the orientation of the emulator from landscape to portrait and vice versa.
Turns the network on and off.
If you select the Snapshot option, the second time you start the device it is started very fast, because the AVD stores its state if you close it. If you select Use Host GPU the AVD uses the graphics card of your host computer directly which makes the rendering on the emulated device much faster.
### 3.4. Speed optimization with the Intel system image
It is possible to run an AVD with an image based on the ARM CPU architecture or based on the Intel CPI architecture.
An Android virtual device which uses the Intel system image is much faster in execution on Intel / AMD hardware compared to the ARM based system image. This is because the emulator does not need to translate the ARM CPU instructions to the Intel / AMD CPU on your computer.
The Intel image for an API can be installed via the Android SDK Manager. In Android Studio this happens automatically if you create an device. If is possible to configure this via the package details.
An Intel image is not available for all API levels.
At the time of this writing your also need to download and install extra drivers for MS windows.
After the download you find the driver in your Android installation directory in the extras/intel folder. You need to install the drivers by running starting the .exe file. This additional installation step is required on Window to accelerate the Intel emulator. Only downloading the driver via the Android does not make a difference.
After the download you can create a new AVD based on the Intel emulator. The emulator does not start faster but is way faster during the execution of your Android application.
Linux requires a more complex setup. For a detailed installation description see the Intel emulator installation guide which also includes detailed instructions for Windows.
### 3.5. Using a real Android device for testing
Turn on USB Debugging on your device in the settings. Select Settings ? Development Options, then enable the USB-Debuggingoption.
You may also need to install the driver for your mobile phone. Linux and Mac OS usually work out of the box while Windows typically requires the installation of a driver.
For details on the driver installation on Windows please see Google guide for device deployment.
The minimum Android version of your Android application needs to fit to the Android version on your device.
If you have several devices connected to your computer, you can select which one should be used. If only one device is connected, the application is automatically deployed on this device.
## 4. Exercise: Getting started with Android Studio
### 4.1. Target
In this exercise you create an Android project and start it on an Android virtual device via Android Studio.
### 4.2. Create a new Android project
Press the Start a new Android Studio project link to get started. Alternatively you can select the File ? New Project... entry from the menu.
Use the following data of input for your project. Project location and package name are derived from your input. If you want another package name, press the small Edit hyperlink.
Table 2. Setting for your Android project
API (Minimum, Target, Compile with)
Android Studio automatically downloads the required Android SDK, if that has not already been done. So depending on your installation, the next dialog might not be displayed.
Afterwards select the Empty Activity template.
On the last page, accept the defaults.
### 4.3. Review the generated project
The above wizard generates based on your input an Android project. Review the generated project structure and files.
### 4.4. Create a virtual device (AVD)
Define a new Android Virtual Device (AVD) by opening the AVD Manager via Tools ? Android ? AVD Manager. Afterwards press the Create Virtual Device... button.
Select values similar to the following screenshots.
On the next screen select the latest API level for your AVD. You may need to select the option for additional images as highlighted in the following screenshot.
Afterwards press the Finish button. This will create the AVD configuration and display it under the list of available virtual devices.
### 4.5. Start your virtual device
Select your new entry and press the Play button.
### 4.6. Start the application on your virtual device
Select Run ? Run 'app' to start your application. This opens a dialog in which you can select your device to deploy your application to.
After a while your application should start on the virtual device.
Sign up to https://developers.facebook.com/apps
Create New App.
Get the ?Facebook Id?, ?applicationId? and replace these in Xcode info.plist file with
495398417220934 and fb495398417220934 respectively.
Sign up to https://www.parse.com/
Create New App.
Get the ?ApplicationId? & ?Client Id? and replace these in Xcode info.plist file with
?Your- ParseApplicationId & Your-ParseClientId? respectively.
Twitter Setup Detail
STEP 1: Go to https://dev.twitter.com/;
STEP 2:click on Developers
STEP 3: click on Manage my App
Now following page will come
Click create new app
STEP 3: Fill the form and the accept agreement
STEP 4: Replace with twitter consumer key and twitter consumer secret in variable constant class.
Facebook Setup Detail
For Creating new facebook App open the website https://developers.facebook.com/apps
STEP 3: create new app
# STEP 3 Get the ?applicationId? and replace these in ParesApllication class
# and in String Xml file with
Parse Setup Detail
# STEP 1: Sign up to https://www.parse.com/
i) Open the website http://www.parse.com
ii) Sign Up to parse
# STEP 2: Create New App
i) Click on "+ Create New App" on the top right of your custom admin screen with parse
ii) Enter app?s title and click ?Create app? button.
iii) After creating your name you will be supplied with App Keys, please take a note of all, preferably take a screenshot and save it.
Most important are APPLICATION ID and CLIENT KEY
iv) Click on Get All Your App Keys
# Step 3 : Get the ?ApplicationId? & ?Client key? and replace these in ParseApplication calss with ?Your- ParseApplicationId & Your-ParseClientId? respectively.
CONGRATULATIONS YOUR BASIC CLONE IS SETUP!