Setup for Android Development

Hello everyone if you want to start Android Development on windows then you need following steps to setup an environment for android development-
Install required Eclipse IDE version [Version: 4.1.2]
Download ADT Plugin [Android Development Toolkit]

Open Eclipse IDE, Go to ‘Help’ menu and select option ‘Install New Software’
Click on ‘Add’ button placed after ‘work with’ textbox.
In Name field give ‘ADT Plugin’
Then click ‘Archive’ button and select the ADT Plugin zip file downloaded earlier.
Then click ‘Select all’ button and click on ‘Next ‘ and follow instructions.

OR
Alternately You can use http://dl-ssl.google.com/android/eclipse to download required SDK tools.

Download Android SDK Tools from Android website and install them
After Installation, Run SDK Manager.
In this screen you can download and install all versions of Android Platform and all other custom APIs [like Google API for maps] [Max used version of Android SDK in mobiles is Android 2.3.3 – API 10]

Android Virtual Device
Open AVD manager from Android SDK Tools
Click on new Button on right side of opened dialog
Give a name to virtual device and select a target android version
Next add required values for SD card, snapshot and skin.
Then click on new button in Hardware section of dialog
Select one by one hardware support property to add to virtual device [Support properties that are being used by your app or you are going to test your android app with.]

Increase Decrease Web Page Size based on window size

Hello Everybody, Today i will show simple jquery code to adjust the contents div size according to window size.
Both right and left side bars will remain at their actual size but the width and height of contents will adjust
accordingly. Jquery Code for width handling is given below and you can download full demo by click on Download Demo-

<code>
$(document).ready(function(){
var leftBarWidth = $(‘#leftsidebar’).width();
var rightBarWidth = $(‘#rightsidebar’).width();
$(‘#contents’).width($(window).width()-(leftBarWidth+rightBarWidth));
$(window).resize(function() {

$(‘#contents’).width($(window).width()-(leftBarWidth+rightBarWidth));

});
});
</code>

Create a new domain in Direct Admin

Steps to create a new domain at web server-

  1. Open “Direct Admin” login page in a web browser and enter username & password.
  2. Login and click on “User Level” in right bar under “Access Level”.
  3. It will show all the existing domains hosted on web server in main content area under “Domain”.
  4. Click on Domain Administration Button.
  5. Click on “Add another domain” link located below the icons bar at top.
  6. It will show “Create Domain” form.
  7. Type the domain name in the “domain.com” field. [Do not use CAPS, www, or http:// in your domain name.]
  8. After that click on Logout link at top right corner in contents area.

Upload website from FileZilla

Steps to upload a website to a web server-

  1. Following steps will be according to FileZilla_3.3.2 software. Steps may vary for other ftp softwares.
  2. You can download free FileZilla from http://filezilla-project.org/download.php
  3. Install FileZilla and run it.
  4. Click on “Site Manager” option under “File” menu. (Alternatively you can use “Ctrl+s” to open Site Manager.)
  5. Click on “New Site” button in Site Manager dialog box.
  6. Type domain name “example.com” in “Host” field on the right side panel.
  7. Type “21” in port field.
  8. Select “Normal” from “Logontype” combo list box.
  9. Type ftp username & password in “User” and “password” field.
  10. Now click on “Connect” button near the bottom of site manager dialog box.
  11. It will start connecting to server and will show all files & folders in the root of our server in “Remote Site” box located in middle of window.
  12. Open the location of wordpress website folder in “Local Site” field located at left-middle of window.
  13. Open the domains folder of “Remote Site” box. (Double click on it).
  14. It will show a list of domains hosted on server in the “Remote Site” middle box.
  15. Double click on newly created domain name folder to open it in “Remote Site” middle box.
  16. Double click on “public_html” folder to open it. (It will have a folder(cgi-bin) and some files. Delete “index.html” file only. Remaining files and folder will remain as such.)
  17. Now open the local website folder located in the “Local Site” middle box.
  18. It will show folders and files. Select these all folders & files by “Ctrl + A” or “Shift+click”.
  19. Drag these selected folders & files to the right middle box of “Remote Site” in “public_html” folder.
  20. It will start uploading all the files & folders and will show transfers in the bottom panel “Queued files”.
  21. If any file is shown in failed transfers tab, right click on this file and select “Reset & Requeue selected files” to retransfer it.

Run wordpress site on a web server online

Steps to run a wordpress site online on a web server –

  1. Download wordpress from http://wordpress.org/download/ as a zip file.
  2. Extract all files from zip file and upload all the files & folders to the “public_html” of your domain on hosting server.
  3. Open your domain in a web browser.
  4. It will show “Create a Configuration File” button page.
  5. Click on “Create a Configuration File” button. It will show a wordpress page with some info.
  6. Click on “Let’s Go!” button. It will show database details form.
  7. Type database name in first text field.
  8. Type username and password of database server.
  9. Type “127.0.0.1” or “localhost” in “Database Host” field.
  10. Click on Submit.
  11. It will show a page containing a text area. Select all the text in text area. Copy it and paste in a empty notepad (or any other text editor) file.
  12. Save this file named as “wp-config.php”.
  13. Open FileZilla and transfer this file to root folder ([newdomain.com]/public_html) of your domain. (Refer to Steps to upload a website to web server)
  14. Close FileZilla and go to browser where we have opened new domain previously.
  15. Click on “Run the Install” button. Type “Blog-Title” & “Email” in appropriate fields.
  16. Click on “Install WordPress” Button. Note down admin username and password. Click login button.
  17. You can change password by clicking on “Yes, Take me to my profile page” in red color at top.
  18. It will open profile page, type your new password twice in both password fields.
  19. If you do not want to change it now leave password fields blank.

Install wordpress site on local server like apache

Install a wordpress site on local web server –
1. Download wordpress from http://wordpress.org/download/ as a zip file.
2. Extract all files from zip file and upload all the files & folders to the www/website folder of your web server.
3. Open your website in a web browser (for example – http://localhost/website).
4. It will show “Create a Configuration File” button page.
5. Click on “Create a Configuration File” button. It will show a wordpress page with some info.
6. Click on “Let’s Go!” button. It will show database details form.
7. Type database name in first text field.
8. Type username and password of database server.
9. Type “127.0.0.1” or “localhost” in “Database Host” field.
10. Click on Submit.
11. Click on “Run the Install” button. Type “Blog-Title” & “Email” in appropriate fields.
12. Click on “Install WordPress” Button. Note down admin username and password. Click login button.
13. You can change password by clicking on “Yes, Take me to my profile page” in red color at top.
14. It will open profile page, type your new password twice in both password fields.
15. If you do not want to change it now leave password fields blank.

Add a class to html in jquery

here i am going to show you how we can add a class of css to html elements like a,p,h3 etc. You can see demo by copy Below given code and paste in text editor and save as html file and open in a web browser. you can download latest version of jquery from here [download jquery]-
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Attach Class Jquery</title>
<style>
.links{
color:#F39;
font-family:”Trebuchet MS”, Arial, Helvetica, sans-serif;
font-size:14px;
}
.paragraphs{
color:#36F;
font-family:Georgia, “Times New Roman”, Times, serif;
font-size:12px;
}
.headings{
color:#0F0;
font-family:”Times New Roman”, Times, serif;
font-size:18px;
}
.hlists{
display:inline;
}
</style>
<script src=”jquery-1.4.2.js” language=”javascript” type=”text/javascript”></script>
<script>

$(function(){
$(“a”).addClass(‘links’);
$(“p”).addClass(‘paragraphs’);
$(“h3”).addClass(‘headings’);
$(“#nav ul li”).addClass(‘hlists’);
});
</script>
</head>
<body>
<!– wrap starts here –>
<div id=”wrap”>
<!–header –>
<div id=”header”>
<h1><a href=”http://www.amandip.com/” title=””>Aman Dhaliwal</a></h1>
<p>Everyday Is A Gift That’s Why It Is Called The Present</p>
<div>
<p>
<a href=”http://www.amandip.com/”>Home</a> |
<a href=”http://www.amandip.com/contact”>Contact</a> |
<a href=”http://www.amandip.com/sitemap”>Site Map</a>
</p>
</div>
<!–header ends–>
</div>
<!– navigation starts–>
<div id=”nav”>
<ul>
<li id=”current”><a href=”http://www.amandip.com/”>Home</a></li>
<li><a href=”http://www.amandip.com/projects”>Projects</a></li>
<li><a href=”http://www.amandip.com/codesamples”>Code Samples</a></li>
<li><a href=”http://www.amandip.com/about”>About Me</a></li>
<li><a href=”http://www.amandip.com/contact”>Contact Me</a></li>
</ul>
<!– navigation ends–>
</div>
<!– content-wrap starts –>
<div id=”content-wrap”>
<div id=”main”>
<h2><a href=”http://www.amandip.com/”>Welcome</a></h2>
<p>Welcome to my personal website…</p>
<p>Within you will find my recent and past web design projects, as well as my online resume and contact information.</p>
<p>Personal Info</p>
<p>Growing up online, I became fascinated with almost everything digital. I consider myself a self-taught web designer and an avid web coder. Designing websites has been a long passion of mine. To get in touch with me, please use contact form. You can also view my e-mail address and contact information.</p>

<!– main ends –>
</div>
<div id=”sidebar”>
<h3>Menu</h3>
<ul>
<li><a href=”index.html”>Home</a></li>
<li><a href=”#”>Java</a></li>
<li><a href=”#”>C</a></li>
<li><a href=”#”>C++</a></li>
<li><a href=”#”>PHP/MySQL</a></li>
</ul>
<h3>Wise Words</h3>
<p>”Trials teach us what we are; they dig up the soil,
and let us see what we are made of.” </p>
<p>- Charles Haddon Spurgeon</p>
<!– sidebar ends –>
</div><!– content-wrap ends–>
</div><!– footer starts –>
<div id=”footer-wrap”>
<div id=”footer-columns”>
<div>
<h3>My Websites</h3>
<ul>
<li><a href=”http://amandip.brinkster.net/”>http://amandip.brinkster.net/</a></li>
<li><a href=”http://amandip.web.officelive.com”>http://amandip.web.officelive.com</a></li>
<li><a href=”http://aman.coolpage.biz/”>http://aman.coolpage.biz/</a></li>
<li><a href=”http://amandhaliwalzblog.blogspot.com/”>http://amandhaliwalzblog.blogspot.com/</a></li>
<li><a href=”http://sites.google.com/site/amandipclub”>http://sites.google.com/site/amandipclub</a></li>
</ul>
</div>
<div>
<h3>My Projects</h3>
<ul>
<li><a href=”http://www.vancouver-seo.net/”>Vancouver SEO</a></li>
<li><a href=”http://www.indiaseocompany.net/”>India SEO</a></li>
<li><a href=”http://www.princessweddingphotography.ca”>Princess Wedding Photography</a></li>
<li><a href=”http://www.thetechnocare.com/”>Technocare Nursery</a></li>
<li><a href=”http://www.cyberstarinfotech.com/index1.php”>Cyberstar Infotech</a></li>
</ul>
</div>
<!– footer-columns ends –>
</div>
<!– footer ends–>
</div>
<!– wrap ends here –>
</div>
</body></html>

Google Maps with JQuery

Here i am going to write a small code of javascript and jquery to show a google map on webpage. Before trying this you should have Google Maps API Key and latitude and longitude of place you want to show at the center of map. By the way here i have given a sample latitude & longitude values, which gives the location of Ludhiana City, Punjab in India. You can download your Google Maps API Key here. Get a Google Maps API Key



Demo –

 

enable disable in jquery

Hello Everybody, here i am going to show, how you can enable or disable a combobox with jquery. you can download latest version of jquery from here [download jquery]. In this code i used two functions of jquery for adding and removing a attribute(disabled).
Jquery function attr(‘name’,’value’) is used to add an attribute to an html element. Function removeAttr(‘name’) is used to remove a attribute of html element by using jquery.
Insert a combobox using following code :
<select id=”mycombo” style=”width:200px;”>
<option>one</option>
<option>two</option>
</select>

Insert two buttons containg jquery code in click event, using following code :
<input type=”button” value=”Disable” onclick=”$(‘#mycombo’).attr(‘disabled’,’disabled’)”/>
<input type=”button” value=”Enable” onclick=”$(‘#mycombo’).removeAttr(‘disabled’)”/>

Check Uncheck checkbox in jquery

Hello Everybody, here i am going to show, how you can check or uncheck a checkbox with jquery. you can download latest version of jquery from here [download jquery]. In this code i used two functions of jquery for adding and removing a attribute(disabled).
Jquery function attr(‘name’,’value’) is used to add an attribute to an html element. Function removeAttr(‘name’) is used to remove a attribute of html element by using jquery.
Insert a checkbox using following code :
<input type=”checkbox” id=”mycbox”/>Click on buttons to check/uncheck.

Insert buttons using the following code :
<input type=”button” value=”Check” onclick=’$(“#mycbox”).attr(“checked”,”checked”)’/>
<input type=”button” value=”Uncheck” onclick=’$(“#mycbox”).removeAttr(“checked”)’/>