How to Make Your First App in Java sequence # 1
How to Make Your First App in Java
NOTE: WE NEED ANDROID STUDIO AND ITS TOOLS TO CREATE FIRST ANDROID APP..
NOW FOLLOW THESE INSTRUCTION: TO INSTALL JDK (JAVA DEVELOPMENT TOOL & ANDROID STUDIO FOR WINDOWS ND LINUX OPERATING SYSTEM ).
Android Studio Basics
Environment Building:➔ Download JDK
➔ Install JDK in Windows / Ubuntu
➔ Environmental Variable JAVA_HOME
➔ Prerequisite Android Studio
➔ Download Android Studio
➔ Install Android Studio
➔ Clarify created folders related to Android
Studio
➔ Build & Run First App
Prerequisite Windows
➔ Microsoft® Windows® 8/7/Vista/2003 ( 32 / 64 -bit)
➔ 2 GB RAM minimum, 4 GB RAM recommended
➔ 400 MB hard disk space➔ Min. 1GB Android SDK, emulator system images & caches
➔ 1280 x 800 minimum screen resolution
➔ Java Development Kit (JDK) 7 or higher
➔ Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel®
EM64T (Intel® 64), and Execute Disable (XD) Bit functionality
➔ Create separate partition for Android Environment. OR for Ubuntu/Linux installation
Prerequisite Linux (Ubuntu)
➔NOME or KDE desktop
➔GNU C Library (glibc) 2.11 or later
➔2 GB RAM minimum, 4 GB RAM recommended➔400 MB hard disk space
➔Min. 1 GB for Android SDK, emulator system images & caches
➔1280 x 800 minimum screen resolution
➔Oracle® Java Development Kit (JDK) 7 or higher
➔Tested on Ubuntu® 12.04, Precise Pangolin (64-bit distribution capable of running 32bit applications)
➔Separate partition for Ubuntu & Android installation.
JDK (Java Development Kit)
Download JDK
➔Install JDK in Windows
● Click the dk-8u31-windows-x64.exe program file & press Next upto finish Installation.
(NOTE:(install earliest version))
●Set Environmental Variable from My Computer->Properties->Advance Settings ->Environmental Variable-> New System Variable: Set Name—JAVA_HOME and path ofJDK folder.
➔Install JDK in Ubuntu
● Goto Terminal from Online sources, remember user id /
domain name. Copy one by one command from jdkterminal-commands.txt file to install JDK and set Environmental Variable from terminal.
JDK Installation Guide
➔JDK installation commands….
# sudo mkdir -p /usr/local/java/
# cd ~/Downloads# sudo cp -r jdk-8u25-linux-x64.tar.gz /usr/local/java/
# cd /usr/local/java/
# sudo tar xvzf jdk-8u25-linux-x64.tar.gz
# sudo gedit /etc/profile
JAVA_HOME=/usr/local/java/jdk1.8.0_25
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
# sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.
8.0_25/jre/bin/java" 1
➔JDK installation commands….
# sudo update-alternatives --install "/usr/bin/javac" "javac"
"/usr/local/java/jdk1.8.0_25/bin/javac" 1
# sudo update-alternatives --install "/usr/bin/javaws" "javaws"
"/usr/local/java/jdk1.8.0_25/bin/javaws" 1
# sudo update-alternatives --set java /usr/local/java/jdk1.8.0_25/jre/bin/java
# sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_25/bin/javac
# sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_25/bin/javaws
# . /etc/profile
# java -version
reboot.
Configure Android Studio
Download Android Studio
➔Install Android Studio for Windows (NOTE:(install earliest version of Android studio))
● Click android-studio-bundle-135.1641136.exe, clicknext for simple installation.
● Click android-studio-bundle-135.1641136.exe, click next for simple installation. Usefull-commands.txt is useful for Android Studio installation, desktop-entry.
txt is used to create shortcut of it.
Android Studio Installation Guide
➔Android Studio installation commands….
INSTALL OPEN TERMINAL HERE:
# sudo apt-get install nautilus-open-terminal# nautilus -q
INSTALL ANDROID STUDIO
# cd /home/developer/android-studio/bin
# ./studio.sh
IF ADB Connection ERROR:
# sudo apt-get install lib32z1 lib32z1-dev
# sudo apt-get install lib32stdc++6
Add these LINES FOR ADD ADB IN SYSTEM PATH:
sudo gedit .bashrc
#Android PATHS
export PATH=$PATH:/home/developer/Android/Sdk/tools
export PATH=$PATH:/home/developer/Android/Sdk/platform-tools
Android Studio Installation Guide
➔Android Studio installation commands for Desktop….
# cd ~/.local/share/applications
# gedit AndroidStudio.desktop[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Exec="/home/student/android-studio/bin/studio.sh" %f
Icon=/home/developer/android-studio/bin/idea.png
Categories=xorsat;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-android-studio
Name[en_GB]=android-studio.desktop
LESSONE # 3
LINUX (UBUNTU) INSTALLATION ENVIRONMENT SCREENSHOTS
WINDOWS INSTALLATION ENVIRONMENT SCREENSHOTS
WINDOWS INSTALLATION ENVIRONMENT SCREENSHOTS
BIOS & Acceleration Driver
➔ An Intel accelerator HAXM is download from SDK Manager for Windows then its installed to the System.
➔The BIOS setting in Intel is performed to accelerate emulator.Prepare to Build Your First App.
➔ Before start to build your first app, you should have read about iconography & Supporting Multiple Screens.
➔ Then, create a launcher icon with
following attributes :◆ Name: ic_launcher
◆ Size: 48x48 pixels
◆ for high density
➔ Should have resource of icon(ic_launcher.png).
Building Your First App
➔ After Setting Up Environment Now,
➔ Launch Android Studio
➔ The 03 important Android Studio folders:- Android folder --- SDK
- Android-Studio folder (Android Studio Software)
- Android Studio Projects folder (Workspace).
➔ The package name is like web address.
➔ Only Min. SDK is required in Android Studio.
Building Your First App
➔ Configure new project
➔ Build Your First App.
➔ Application Name
➔ Company domain
➔ Package name
➔ Project location
➔ Select the form factors your app will run on:
◆ Phone and Tablet
➔ Minimum SDK
➔ Add an activity to project
◆ Blank Activity
➔ Describe new activity for your project, Run Your App
➔ After successfully create of your first.
➔ Build your app. (Compile)
➔ Start an AVD.
➔ Click Play icon or F5 to run app.
➔ Request to select device to run app.
➔ Result shows on Emulator.
Comments
Post a Comment