Monday, 24 August 2015

HELLO WORLD

DISPLAY HELLO WORLD CODES


CREATE LINEAR LAYOUT

Create or Update the template layout, Relative Layout to the following Code.
===>>src/main/res/layout/activity_home.xml

<LinearLayout
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent" >

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content" 
android:textColor="@android:color/black"
android:textSize="50sp"
android:text="@string/hello_world"/>
</LinearLayout>







CREATE ACTIVITY


Create or Update the template java Class. ==>> src/main/java/package-name/HomeActivity.java
Change ActionBarActivity to Activity for extended class for java class HomeActivity


public class HomeActivity extends ActionBarActivity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 }
}





REGISTER ACTIVITY

Register your activity in manifest file.  ===>>src/main/AndroidManifest.xml
In it we define which activity is launcher activity means execute first.



<manifest package="net.uni_world.android_1110.foodscourt">
<application android:theme="@style/AppTheme" android:label="@string/app_name" android:icon="@drawable/ic_launcher"android:allowBackup="true">
<activity android:label="@string/app_name" android:name=".MainActivity">

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>




NOTE: 

 REMIND THESE 3 MAIN POINT FOR CREATE APP.LIKE:
  1.  FIRST IS CREATE LAYOUT ACTIVITY (XML)
  2.  SECOND ONE IS CREATE JAVA ACTIVITY CLASS (.JAVA)
  3.  THIRD ONE IS REGISTER UR ACTIVITY IN MENIFEST.XML ACTIVITY.




Sunday, 23 August 2015

ANDROID APP.. DESIGNING CODES

FOR UNDERSTAND ANDROID CODE AND APP. DESIGN FIRST WE NEED TO UNDERSTAND SOFTWARE REQUIREMENT SPECIFICATION (SRS).






The Key Steps….

Understand the SRS (Software Requirement Specification) of client.Then plan how to facilitate the client requirement in the app.Afterwords, sketch the screen as per your understanding of project. SRS (Software Requirement Specification)It is a complete document which includes……
● The Company Portfolio
● The requirement
● All the related detail to describe about & for project.



Sketching & Wireframing

  • Wireframing, a step in design whereto start layout your screen.
  • Easiest and fastest way is to sketch.
  • After number of tries finalize the sketch.
  • Then make the Digital Wireframing for Adobe Illustrator, Abode Fireworks, BestInMind etc.


Prototype 


Prototype sample/model to test a concept learned from. It used in design, electronics & SP.

Often client at initial stage unable to describe complete application objectives and output etc.



Freelance Project SRS: elance link 

Search Mobile App Development throughout the world to work as freelance or for any organization.

One of the freelance weblink is…

https://www.elance.com/r/jobs/cat-itprogramming/sct-mobile-applications-11033






LESSON # 2


Digital Wireframing & App Structure


The Key Points….
First Understand High-Level Screen Hierarchy of The App.
Then Appropriate Forms for navigation.



Digital Wireframing / Prototype ...

JustInMind Prototype web link: Download App for Windows http://www.justinmind.com/
Other Wireframe/Prototype Website or App

http://balsamiq.com/download/
https://wireframe.cc/
http://pencil.evolus.vn/Default.html
http://www.uxpin.com/


Android Tutorial : App Designing
The link for understanding prototyping with Android Tutorial.
Topic Hierarchy: Develop-> Training ->Best Practice for Interaction & Engagement
http://developer.android.com/training/designnavigation/index.html





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.
●Set Environmental Variable from My Computer->Properties->Advance Settings ->Environmental Variable-> New System Variable: Set Name—JAVA_HOME and path of
JDK 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
● Click android-studio-bundle-135.1641136.exe, clicknext for simple installation.

➔Install Android Studio for Ubuntu
● 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







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:


  1.  Android folder --- SDK
  2.  Android-Studio folder (Android Studio Software)
  3.  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.





Android Studio Shortcuts You Need the Most


Navigation Shortcuts:

Shortcut Description Android Studio Shortcut

  • Go to class Ctrl + N
  • Go to file Ctrl + Shift + N
  • Navigate open tabs ALT + Left-Arrow; ALT + Right-Arrow
  • Lookup recent files CTRL + E
  • Go to line CTRL + G
  • Navigate to last edit location CTRL + SHIFT + BACKSPACE
  • Go to declaration CTRL + B
  • Go to implementation CTRL + ALT + B
  • Go to source F4
  • Go to super Class CTRL + U
  • Show Call hierarchy Ctrl + Alt + H
  • Search in path/project CTRL + SHIFT + F


Programming Shortcuts
Shortcut Description Android Studio Shortcut
  • Reformat code CTRL + ALT + L
  • Optimize imports CTRL + ALT + O
  • Code Completion CTRL + SPACE
  • Issue quick fix ALT + ENTER
  • Surround code block CTRL + ALT + T
  • Rename and refactor Shift + F6
  • Line Comment or Uncomment CTRL + /
  • Block Comment or Uncomment CTRL + SHIFT + /
  • Go to previous/next method ALT + UP/DOWN
  • Show parameters for method CTRL + P
  • Quick documentation lookup CTRL + Q


General Shortcuts
Shortcut Description Android Studio Shortcut
  • Delete line CTRL + Y
  • Safe Delete Alt + DELETE
  • Close Active Tab CTRL + F4
  • Build and run SHIFT + F10
  • Build CTRL + F9
  • All purpose (Meta)Shortcut CTRL + SHIFT + A  (javapapers.com)






http://androidappdevelop1.blogspot.com

Tuesday, 18 August 2015

MYSQL DATABASE

What is MySQL?

MySQL is a database system used on the web.MySQL is a database system that runs on a server
MySQL is ideal for both small and large applications.MySQL is very fast, reliable, and easy to use
MySQL uses standard SQL.MySQL compiles on a number of platforms.MySQL is free to download and use.MySQL is developed, distributed, and supported by Oracle Corporation.MySQL is named after co-founder Monty Widenius's daughter: My

The data in a MySQL database are stored in tables. A table is a collection of related data, and it consists of columns and rows.

Databases are useful for storing information categorically. A company may have a database with the following tables:

  1. Employees
  2. Products
  3. Customers
  4. Orders



PHP + MySQL Database System

PHP combined with MySQL are cross-platform (you can develop in Windows and serve on a Unix platform).

Database Queries:
A query is a question or a request.
We can query a database for specific information and have a record set returned.
Look at the following query (using standard SQL):

Example of Query:

SELECT LastName FROM Employees.


Note:
The query above selects all the data in the "LastName" column from the "Employees" table.

Monday, 17 August 2015

PHP CODING

What is Php?

PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

Example of Php:


<!DOCTYPE html>
<html>
<body>

       <?php
           echo "My first PHP script!";
       ?>

</body>
</html>


Php syntax

<?php
.
.
.
?>

Echo & Print Statement Example


<php

echo "Hello World!";
print "Hello World!";

?>



Variable Assign

<?php

//String data type
$name = "Asad";
$f_name = "Abdul ahad";
$email = "abc@gmail.com";
$age = "17";

echo "NAME:" . $name ."<br>F_NAME:" . $f_name . "<br>EMAIL:" . $email . "<br>AGE:" . $age;

?>


   Two Variable Add



<?php

//Integer data type $a = 5;
$b = 8;
$result = $a+$b;

echo $result; 

?>




Array


<?php

$fruits = Array ("APPLE" , "ORANGE" , "BANANA" , "PEACH" , "PINEAPPLE");


echo $fruits[0];

?>












CONNECTION OF DATABASE CODING



<?php
$con = mysql_connect {"localhost ","root",""};
$db = mysql_select_db{'registration_form',con};

 $first_name = $_POST{'first_name'};
 $last_name = $_POST{'last_name'};
 $father_name = $_POST{'father_name'};
 $address = $_POST{'address'};
 $age = $_POST{'age'};
 $email = $_POST{'email'};
 $contact = $_POST{'class'};
?>



NOTE:

FIRST WE CREEATE DATABASE ON APACHE SERVER WITH THE HELP OF XAMPP SOFTWARE :

NOW I DESCRIBE HOW WILL WE INSTALL XAMPP SOFTWARE  AND THEN HOW WILL CREATE DATABASE....










JAVASCRIPT CODING

What is javascript?

JavaScript is an interpreted programming or script language from Netscape. It is somewhat similar in capability to Microsoft'sVisual Basic, Sun's Tcl, the UNIX-derived Perl, and IBM's REXX. In general, script languages are easier and faster to code in than the more structured and compiled languages such as C and C++. Script languages generally take longer to process than compiled languages, but are very useful for shorter programs.

JavaScript is the programming language of HTML and the Web.Programming makes computers do what you want them to do.JavaScript is easy to learn.This tutorial will teach you JavaScript from basic to advanced.

Example of javascript:


<html>
<head>

<title>Javascript</title>


</head>


<body>

        <script type="text/javascript">
            //This for link

            function link(){
            window.open('http://www.google.com','_self');
            }

        </script>

<input type="button" value="Goto Google" onclick="link()">

</body>


</html>

HTML5 & CSS CODING

What is HTML?

HTML stands for Hyper Text Markup Language. Developed by scientist Tim Berners-Lee in 1990, HTML is the "hidden" code that helps us communicate with others on the World Wide Web (WWW).
When writing HTML, you add "tags" to the text in order to create the structure. These tags tell the browser how to display the text or graphics in the document.

HTML is a markup language for describing web documents (web pages).
  • HTML stands for Hyper Text Markup Language.
  • A markup language is a set of markup tags.
  • HTML documents are described by HTML tags.
  • Each HTML tag describes different document content.

Example of HTML coding:-

File save with Extension :abc.html    (Note: abc is html file name and .html is extension of html file).


<!DOCTYPE html>

<html>
<head>
<title>Programming Language</title>
</head>
 
<body>
      <h1>ABC</h1>
      <p> a to z </p>
</body>
</html>




Advanced coding:- HTML 5:-


<!DOCTYPE html>

<html>
<head>
<title>Programming Language</title>
</head>
 
<body>
           <header>This is Content Area</header>
   <nav>
<ul class="ul1">
<li><a href="#">HOME</a></li>
<li><a href="#">SERVICE</a></li>
<li><a href="#">PROJECTS</a></li>
<li><a href="#">ABOUT US</a></li>
<li><a href="#">CONTACT US</a></li>
</ul>
</nav>
     <section>
<article>
<h1>ABC</h1>
<p >a to z</p>
 </article>
<article>
</section>
        <aside>
<h2>Follow us</h2>
</aside>

      <footer>This is footer</footer>
</body>
</html>




What is Css?

Cascading Style Sheets, or CSS, allow you to specify things like the font you want on your page, the size of your text, whether the page is to have 2 columns, whether your text is to be in bold or italics, and so on. In other words, it is the part that lets you control the appearance of your web page.
You may be used to the Microsoft Word "doc" format, where everything from the text you type to the appearance of the document is specified in a single file, transparent to you. On the web, the raw information is specified in HTML and most of the appearance is determined by the CSS.

Example of Css:

File save======>index.html

<html>
<head>
<title>Html & Css</title>


<link rel="stylesheet" href="style.css">
     </head>
 
<body>
<header>this is header </header>
        <h1>ABC</h1>
         <p>A To Z</p>

</body>

</html>




File save=====> style.css

body {
    background-color: #d0e4fe;
}

h1 {
    color: orange;
    text-align: center;
}

p {
    font-family: "Times New Roman";
    font-size: 20px;

}






NOW WE CREATE FORM

(A simple registration form coding in html codes)


<html>
<head>
<title>Registration Form</title>
</head>

 <body>
   <form mrthod='post' action='registration_form.php'>
   <table width='' border='5' align='center'>
      <tr>
 <th bgcolor='green'colspan='7'><u>USER REGISTRATION FORM</u></th>
 </tr>
 
 <tr>
 <td bgcolor='sky blue' align='right'>FIRST NAME:</td>
 <td><input type='text' name='f_name'></td>
 </tr>
 
 <tr>
 <td bgcolor='sky blue' align='right'>LAST NAME:</td>
 <td><input type='text' name='l_name'></td>
 </tr>
 
 
 
 <tr>
 <td bgcolor='sky blue' align='right'>FATHER`S NAME:</td>
 <td><input type='text' name='fathr_name'></td>
 </tr>

 
 <tr>
 <td bgcolor='sky blue' align='right'>AGE:</td>
 <td><input type='text' name='age'></td>
 </tr>


 <tr>
 <td bgcolor='sky blue' align='right'>GENDER:</td>
 <td><select name='gender'>
 <option value='null'>SELECT GENDER</option>
 <option value='m'>MALE</option>
 <option value='f'>FEMALE</option>
 </td>
 </tr>
 
 <tr>
 <td bgcolor='sky blue' align='right'>ADDRESS:</td>
 <td><input type='text' name='address'></td>
 </tr>
 
 <tr>
 <td bgcolor='sky blue' align='right'>REGION:</td>
 <td><select name='region'>
 <option value='null'>SELECT RESION</option>
 <option value='s'>SINDH</option>
 <option value='b'>BALOCHISTAN</option>  
 <option value='p'>PUNJAB</option>
 <option value='k'>KPK</option>
 </td>
 </tr>
 
 <tr>
 <td bgcolor='sky blue' align='right'>COUNTRY:</td>
 <td><select name='country'>
 <option value='null'>SELECT COUNTRY</option>
 <option value='pk'>PAKISTAN</option>
 <option value='du'>DUBAI</option>  
 <option value='ir'>IRAN</option>
 <option value='tr'>TURKEY</option>
 </td>
 </tr>
 
 
 <tr>
 <td bgcolor='sky blue' align='right'>EMAIL:</td>
 <td><input type='text' name='email'></td>
 </tr>
 
 
 
 <tr>
 <td bgcolor='sky blue' align='right'>CONTACT #:</td>
 <td><input type='text' name='cntact'></td>
 </tr>
 
  </table>
   </form>
 </body>


</html>





RESULT