Showing posts with label Windows mobile developement. Show all posts
Showing posts with label Windows mobile developement. Show all posts

Monday, February 28, 2011

how can pl/sql execute php ?

>Is there a way to execute PL/SQL scripts from PHP? I have PL/SQL scripts
>that utilizes the DBMS_xxx packages. Is it possible to shell out a command
>that will run the PL/SQL? You'll have to define what you mean by 'PL/SQL script'.

Do you mean a PL/SQL block? Just use OCIParse/OCIExecute. There's an example
in the PHP manual.

Or do you mean you have a file containing one or more SQL and/or anonymous
PL/SQL blocks, which you'd normally run with SQL*Plus? And in particular, does
it use any SQL*Plus commands? (e.g. SET, or COLUMN). If so, shell out to
SQL*Plus with system() or exec() or backticks etc.

check if an object has been instantiated in php?

You have to check a variable to see whether it contains an object of the
right type

Thus
-------------------------------------------------------------
Dim X as clsContract

If X is nothing then
MessageBox.Show("There is No Object here")
Endif
X = New clsContract

If Not (X is nothing) then
MessageBox.Show("There is an Object here")
Endif
-------------------------------------------------------------


However the variable you test can be a shared variable within the class.
This is an example of the 'singleton' pattern.

Thus
-------------------------------------------------------------
Public Class clsContract
Private Sub New()
End Sub
Private Shared mSingleton as clsClass
Public Shared Function GetSingleton as clsContract
If mSingleton is nothing then
mSingleton = New clsContract
Endif
return mSingleton
End function
Public Shared function Exists() as boolean
return not (mSingleton is nothing)
End function
End Class
-------------------------------------------------------------

Your button code might then use this
-------------------------------------------------------------
Dim x as clsContract = clsContract.GetSingleton()
-------------------------------------------------------------

This may or may not be what you mean.

Friday, February 25, 2011

what is php file?

* PHP files can contain text, HTML tags and scripts
* PHP files are returned to the browser as plain HTML
* PHP files have a file extension of ".php", ".php3", or ".phtml"

what is phases of php programming?

We specialize in PHP programming and MySQL databases. We write custom PHP programs and customize PHP/MySQL-based packages like open source software products: WordPress® blogs, osCommerce (open source eCommerce solution), and OpenX, formerly known as phpAdsNew (open source Ad Management solution). We have interfaced osCommerce and custom-developed order forms with payment gateways like AuthorizeNet®.

Sampling of Custom PHP Programming

* Blog Preview Window
* Dynamic Selection Fields
* Content Maintenance Module
* PHP Dynamic Site Plan
* Search Within Radius

Blog Preview Window
Blog Preview WindowChris Ploof Studio of Pawtucket RI creates custom, one-of-a-kind jewelry for clients worldwide.

hired Adventures Online to install and customize a blog for his website. At the same time, he wanted to add a blog preview window on the Home page to let people know that he is blogging about all the exciting news about his business.

Solution
Adventures Online installed and customized a WordPress® blog, then wrote a custom PHP program that reads the latest post in the blog and displays the first 25 words of the post in the preview window on the Home page (circled, left). Included in the blog preview is a link to the full post. When the link is clicked, the blog displays with the full post at the top

Dynamic Selection Fields
Vehicle Selection FormThe Lube Dudes of Marlborough MA provides on-site vehicle maintenance to fleets and corporate employees throughout Eastern Massachusetts.

The Lube Dudes hired Adventures Online to design and develop a website for them. In addition to the brochure-type portion of the website, The Lube Dudes wanted a Customers-Only section where new customers could sign up online, create a personal profile and build a portfolio of their verhicles, and, existing customers could login, manage their vehicle portfolio and schedule maintenance for their vehicles.

The Lube Dudes had a special requirement for the Add a Vehicle process, and that was that the choices displayed in the Year, Make, and Model selection pull-down lists be “valid”choices; meaning that the list of Years could only include the list of years that the The Lube Dudes would service, and the list of Makes could only include the Makes that existed in the Year the customer had just selected, and that the list of Models could only include models available in the year:make combination that the customer had just selected. Because each customer would choose different year-make-model combinations and those combination were impossible to predict, the selection fields needed to be dynamically-generated based on the current customer’s selections.

Solution
When the website was launched, there were nearly 12,000 Year-Make-Model combinations that The Lube Dudes were interested in servicing.

1. A custom PHP program was written to insert the initial ~12,000 year-make-model combinations into the online database.
2. An online module was created so that The Lube Dudes could maintain (add, change and delete) year-make-model combinations.
3. Custom PHP programs were written to extract Year-Make-Model combinations to text files. (The text files are used to load the Year, Make, Model selection fields.)
4. JavaScript programs were written to determine which text files to use to load the correct selections in the Year, Make and Model fields.

Adventures Online used a combination of PHP and JavaScript to develop the programming and a MySQL database to store the data.



Custom Content Maintenance Module
PHP programming example Hudson MAReal estate investment manager, Calare Properties of Hudson MA hired Adventures Online to redesign its website. In addition to the redesign, Calare Properties wanted to add functionality – to display its portfolio of properties. They also wanted the ability for staff to maintain the portfolio and have the updates be immediately visible on the website.

Solution
Adventures Online redesigned the website and added menu items for viewing the portfolio of properties. Display pages were created for each individual property, each state and the United States (shown above). The content on those pages changes dynamically according to what the staff enters in the online database. An online maintenance module was created to enable staff to keep the list of properties and descriptions of individual properties up to date. The updates (adds, deletes, changes) are immediately visible on the website.

PHP programs were used to develop the custom content maintenance module. JavaScript was used to validate the information on the data entry forms in the maintenance module, and, a MySQL database stores the portfolio and information about the individual properties. View the portfolio of properties. [US Map creation by MannisMacNeil Design Group.]



PHP Radius Search
Website for Non-Profit AssociationThe American Society of Home Inspectors, New England Chapter (ASHINE), hired Adventures Online to redesign its website. In addition to the website redesign, the association wanted to add the ability for visitors to find home inspectors (ASHI New England members) in their own geographical area.

Business Requirements

1. Allow visitors to search by three different criteria on the Home page; by zip code, city & state, and state alone
2. Include home inspectors within a 10-mile radius of the zip code or city-state in the search results.
3. Include all home inspectors in the state in the search results of a state search.
4. Provide an Advanced Search page on which visitors are able to search by inspector’s business name or last name, and can change the radius (number of miles to include) in order to manipulate the search results.

Solution
A MySQL database was created to store ASHINE’s membership information. Multiple custom PHP programs were written to interface ASHINE’s membership database with a commercially-available US zip code database in order to return the correct results. Try out the Advanced Search!



PHP Dynamic Site Plan
PHP Dynamic Site PlanSteve McKenna & The Home Advantage Team, Arlington MA, the exclusive real estate sales team for Prescott Farms in Bedford MA, hired Adventures Online to bring life to the online Prescott Farms site plan. Although the plan is a simple drawing, there are highly complex, multi-tiered PHP programs running behind the scenes that make the site plan respond differently depending on the phase of the build, the clicking actions of the current viewer and the status of the lot that is clicked.

Business Requirements

1. Website visitors should be able to:
* Quickly understand which lots are available with just a glance at the plan
* Click on each lot and learn the details about it, like the size of the lot, the home styles that can be built on it and the asking price for each home style
* Click on each home style to see the details of the home style, like see a rendering of the floor plan, a written description of the style and the parameters for customization.
2. Staff should be able to:
* Change the status of a lot at any time
* Update information about each lot – like the size and the styles of homes that can be built on the lot
* Open and close phases of the build
* Add and remove lots from phases
3. Updates should be immediately visible on the website.

Solution

1. Assign colors to the different statuses that a lot can have. Add a legend to the site plan. *
2. Create four graphics for each lot, one in each color (status) . *
3. Create an online MySQL database to store the status and other information about each lot
4. Write custom spreadsheet-like PHP programs to enable staff to update (add, change, delete) the status of the lots, the detailed information about each lot, the phase of the build, and the lots included in each phase.
5. Write JavaScript scripts and PHP programs to determine which colored graphic of a lot to display on the site plan
6. Write custom PHP programs to dynamically display a lot’s details (lot size, house styles available for this lot, and pricing for each house style on the lot) -depending on its status
7. Write custom PHP programs to dynamically display information about each house style (like a rendering of the floor plan, a written description of the style, and customization parameters).

This is an ideal application for high-end real estate agents with exclusive agreements on new home developments!

* Graphic design by Circle Graphics, Hingham MA

[In February 2009 all the lots were sold and the website was removed.]

Other PHP Programming Efforts

Personal Best Personal Training, Marlborough MA
Besides being an attractive and informative website, this website has a very robust backend that helps the owner communicate with her clients and manage her business. There is a password-protected Administration Module that the owner uses to monitor clients’ progress, manage health forms processing, and produce reports. Also in the backend, there is a password-protected Members-Only section where members enter food and exercise logs, have access to special fitness articles and the online encyclopedia of exercises, download fitness programs, enter the comprehensive intake forms, and more.

Over 30 PHP programs and two MySQL databases were used to create the Adminsitrative and Members-Only modules.

Regional Chamber of Commerce, Marlborough MA
The Chamber wanted to display the membership list in small, discrete packages. Adventures Online used PHP to interface with a MySQL database to group, retrieve and display information about Chamber members. Try it out!

In the backend, there is a Maintenance Module which the Chamber uses to maintain its Calendars of Events and lists of Directors and Officers. As soon as updates are made to either of these, they are visible on the website, and, since the maintenance module is at the website, staff can make updates any time they want from wherever they are. The Calendars and lists of Directors and Officers are dynamically generated from the MySQL database each time they are viewed.

PHP Online Schedule Maintenance
Turfbuilder Marketing hired Adventures Online to work with Marita Froimson Design to bring life to a website re-design project for its client WAC Consulting in Northborough MA.

php tutorial how to get the array number of an array item?

PHP Tutorials : Arrays
In this PHP Tutorial you will learn about Array basics, Creating an array, Creating a numeric array and Finding the Size of an Array.
Array basics:
An array is made up of elements. Each element has a key and a value. An array holding information about the GPAs of a student has courses names for keys and GPAs for values:

Course GPA
Introduction to computer A
Introduction to programming B+
Discrete structure B
Computer organization A-
An array can only have one element with a given key. In the GPA array, there can't be another element with the key Discrete structure even if its value is B. However, the same value can appear many times in one array.

Creating an array:
To create an array, assign a value to a particular array key. Array keys are denoted with square brackets.

Example:

// An array called $fruits with string keys
$fruits[‘Apple’] = ‘red’;
$fruits[‘Banana’] = ‘yellow’;
$fruits[‘orange’] = ‘orange’;

You can also create an array using the array( ) language construct.

Example:

$fruits = array(‘Apple’ => ‘red’,
‘Banana’=> ‘yellow’,
‘orange’=> ‘orange’);

With array( ), you specify a comma-delimited list of key/value pairs.
The key and the value are separated by =>.
The square bracket syntax is better when you are adding elements one by one.

Creating a numeric array:
PHP provides some shortcuts for working with arrays that have only numbers as keys.
If you create an array with array( ) by specifying only a list of values instead of key/value pairs, the PHP interpreter automatically assigns a numeric key to each value.
The keys start at 0 and increase by 1 for each element.

Example:

$fruits = array(‘apple’, ‘banana’, ‘orange’);
print “I want an $fruits[0].";

This will print ‘I want an apple.’

PHP automatically uses incrementing numbers for array keys when you create an array or add elements to an array with the empty brackets syntax.

Example:

// This sets $fruits[0]
$fruits[] = ‘apple’;

// This sets $fruits [1]
$fruits[] = ‘banana’;

// Create $fruits with three elements
$fruits = array(‘apple’, ‘banana’, ‘orange’);

// Add an element to the end of $fruits
// This sets $fruits[3]
$fruits[] = ‘pineapple’;

The empty brackets add an element to the array.

The element has a numeric key that's one more than the biggest numeric key already in the array.
If the array doesn't exist yet, the empty brackets add an element with a key of 0.

Finding the Size of an Array:
To find the size of an array, use the function count().
count() takes one argument, which is the array, and returns an integer represents the number of the elements of this array.

how to php code a list from a csv file?

CSV is a type of file. It means Comma Separated Values. Spreadsheets software like Excel will offer you the opportunity to save files with the CSV extension. We'll see how to work with these types of files now.
The image below shows an Excel spreadsheets. It's just a simple price list:

The next image shows the spreadsheet being saved as a CSV file:

And here's what the data looks like in a text editor:

The above CSV file is the one we want to work with. It shows each line separated by commas.
PHP has a function that allows you to work with CSV file. It's called fgetcsv( ). It's just like the fgets function you used earlier. The difference is that fgetcsv( ) separates each line on the commas, and puts each part into an array. Before trying the next code, make sure you copy the widgets.csv file, from the ones you downloaded, over to the same folder where your script is. The widgets.csv file is in the scripts folder. Here's the code:

";
}
fclose($file_handle);
?>
When you run the script, you should see all the lines of text printed out. Here's how it works.
The first two lines you've already met: get a handle to the file you want to open, then create a while loop to loop round it.
$file_handle = fopen("widgets.csv", "r");
while (!feof($file_handle) ) {
}
Inside the while loop, though, we have our fgetcsv line:
$line_of_text = fgetcsv($file_handle, 1024);
In between the round brackets of fgetcsv, we've typed to things: our file handle, and the size of the line to read. The size, in this case, is 1024 - 1 kilobyte. You can change this value. When the function gets the line of text, it puts it into the variable we've called $line_of_text.
But $line_of_text will now be an array. Each line of our text file looks like this:
Widget1, blue, £10
The fgetcsv function will split this line when it sees the comma. It then creates a position in the array to hold each part of the line. So it will set up an array with three positions, in our case. Those positions will be as follows:
$line_of_text[0]
$line_of_text[1]
$line_of_text[2]
To print it all out, we had a this line:
print $line_of_text[0] . $line_of_text[1]. $line_of_text[2] . "
";
All we're doing here is to print out what is in each position of the array. We've then added a HTML line break, just for display purposes.
If you have CSV files from a spreadsheet that you need to display on a web page, the fgetcsv function can come in quite handy!

how to php ?

PHP is a simple, object-oriented, interpreted, robust, secure, very high-performance, architecture neutral, portable, dynamic scripting language. PHP has "class" keyword similar to Java's "class" keyword. And PHP is designed such that it is 5 times faster than Java, since there is no virtual machine. PHP is very fast becoming a standard, general purpose, object oriented scripting language. PHP is not only meant for web applications but also can be used for developing general applications.

PHP is the next big thing after HTML because today nobody writes static HTML but uses PHP (generate on the fly, embedded dynamic HTML). PHP 'kind-of' supercedes "static HTML". PHP is a very powerful scripting language. PHP will overtake PERL/Python and will replace PERL/Python. PHP is the next-generation PERL/Python scripting. PHP can do whatever PERL or Python does and actually does much more, much better and much, much cleaner.

PHP stands for 'Hypertext Pre-Processor' and is a server side HTML scripting/programming language. PHP is C-like Web scripting language runs on Apache, Netscape/iPlanet, and Microsoft IIS Web servers. PHP is a tool that lets you create dynamic web pages. PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages. PHP lets you write simple scripts right in your HTML files much like JavaScript does, except, unlike JavaScript PHP is not browser-dependant. JavaScript is a client-side html-embedded language while PHP is a server-side language. PHP is similar in concept to Netscape's LiveWire Pro product and Microsoft's ASP and Sun Microsystem's JSP.

PHP is not only used for creating web applications, but also for creating general standalone applications.

PHP's strength are :

* PHP is the most superior technology. Other technologies PERL, Python, Tcl, VB script, ASP are older and inferior technologies. Even Java/JSP is inferior to PHP.
* Open source
* Easily learned syntax
* Broad database connectivity
* Massive library of contributed extensions
* General purpose scripting language much superior to PERL, VB script, ASP, JSP.

Thursday, February 24, 2011

php help broderbund?

PHP, which stands for \"Hypertext Preprocessor\", is a server-side, HTML embedded scripting language used to create dynamic Web pages. Much of its syntax is borrowed from C, Java and Perl with some unique features thrown in. The goal of the language is to allow Web developers to write dynamically generated pages quickly. In an HTML page, php code is enclosed within special php tags.

Read more: http://business.ezinemark.com/a/broderbund-support-in-php/#ixzz1EssJ8hOw
Under Creative Commons License: Attribution No Derivatives

how to use php ?

Taken directly from PHP's home, PHP.net, "PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly."

This is generally a good definition of PHP. However, it does contain a lot of terms you may not be used to. Another way to think of PHP is a powerful, behind the scenes scripting language that your visitors won't see!

When someone visits your PHP webpage, your web server processes the PHP code. It then sees which parts it needs to show to visitors(content and pictures) and hides the other stuff(file operations, math calculations, etc.) then translates your PHP into HTML. After the translation into HTML, it sends the webpage to your visitor's web browser.

how to install php?

This tutorial discusses the setup of Apache, PHP and MySQL for both Windows and Red Hat Linux. Because the install for Windows is straightforward, the discussion for Windows is an overview. The tutorial and how to for Red Had Linux is much more detailed and covers both downloading and installing packages as well as using Apache's DSO Module. Overall, more people ask about installing Apache, PHP and MySQL on their local Windows computer because their web hosting company takes care of the install on their web server. A common set-up for web site programmers is their localhost environment is Windows and the web server is Linux. This is an effective set-up. Installing Apache, PHP, MySQL on Windows Computers Installation of Apache, PHP and MySQL is straightforward for Windows computers. Go to each of the Apache, PHP and MySQL sites to download the software. Select the appropriate ZIP file. Pick the versions that match your web server. You will have to modify your ini and configuration files as described in the install READMEs, but you do not have to worry about DSO modules, compiling, etc. as discussed for Linux below. I have omitted detailed discussion of changes to local files because different versions of PHP, MySQL and Apache have different requirements. Most web sites are hosted on a web server that hosts many sites. In most cases your site will be hosted with standard PHP, MySQL, Apache configurations. On your localhost (your own computer), you should not deviate too far from the configuration of your web hosting server. Otherwise, you will find yourself in the common programmer situation of saying ”well it works on my machine.” (More help about this subject is in my web hosting for developers article.) One of the great things about PHP and MySQL is many web hosting companies provide them at reasonable prices. So, install Apache, PHP and MySQL on your machine, write some code test it and upload it to a real web server for all the world to see. Installing Apache, PHP, MySQL for Red Hat Linux Installation is similar on other Linux distributions. The tutorial below covers two approaches. The first discussed is downloading and installing packages. How to use Apache's DSO Module is discussed second. The following tutorial was written for then current (year 2000) versions. For complete information regarding installation, especially if there are new versions released, you should read the install notes for each of the packages. This tutorial assumes you are running Linux and it is installed properly. For help with installing and configuring Linux check out some of the related links at the bottom of this page. Download the Packages First download the required packages to a directory. If you are running a different platform be sure to download the appropiate files for your platform: * Apache download * PHP download * MySQL download Extract the Apache and PHP package into that directory using # tar xfz apache_1.3.14.tar.gz # tar xfz php_4.0.3pl1.tar.gz Note: The pound sign # is the system prompt. You type in only what is after it . Installing MySQL MySQL is easiest to install on Red Hat systems using the RPM packages. To install MySQL in the same directory as the RPM packages use the command: # rpm -Uvh *.rpm Note: You most likely need to do this as the root user. Either log in or su to root. After MySQL is installed you need to set the root password. To do this use the following commanding changing my_password to the password you want for the root user to access MySQL. # mysqladmin -u root password 'my_password' Note: If the MySQL service is not running, you may have to start it by hand before trying to set the password. It should start automatically when the computer boots. The command to start MySQL is: # /etc/rc.d/init.d/mysqld start You can test the MySQL installation by doing the following: # mysql mysql (connect to mysql database) Enter Password: mysql> SELECT * FROM user; (grab some data out of user table) This should return the data in the user table. Type exit to leave. Installing Apache with PHP Apache with PHP can be installed a few different ways. One way is to statically embed the PHP binary into the Apache binary. This is probably the fastest and best way to run PHP. You can also install PHP as a DSO module (see below) Here are the step by step directions to install Apache and PHP in the directory /usr/local/apache In Apache src directory (apache_1.3.14/) # ./configure --prefix=/usr/local/apache In PHP src directory (php-4.0.3pl1/) # ./configure --with-mysql \ --with-xml \ --enable-track-vars \ --with-apache=../apache_1.3.14 \ # make # make install In Apache src directory (apache_1.3.14) # ./configure --prefix=/usr/local/apache \ --enable-module=rewrite \ --activate-module=src/modules/php4/libphp4.a # make # make install This will install Apache in the /usr/local/apache directory. The only thing left to do is to configure them. Configuring Apache and PHP To configure PHP copy php.ini-dist which is in the PHP src directory to /usr/local/lib/php.ini Edit this file setting the options you wish, generally nothing needs to be edited. However, you can set various options such as a default MySQL username and password. To configure Apache edit /usr/local/apache/conf/httpd.conf and set the your document directory and any other Apache settings you may want. To enable Apache and PHP to work together the following line needs to be added: AddType application/x-httpd-php .php Look for this line or something similar already in the httpd.conf file and replace it with the above. Make sure to remove the # comment mark. After editing the config file you need to restart Apache. The command to restart Apache is: /etc/rc.d/init.d/httpd restart To test that Apache and PHP work together, create a PHP file. Name it test.php. The entire contents of the file are: Copy this file to the document directory, if you did not change the document directory in the config file (httpd.conf) then the default document directory is /usr/local/apache/htdocs/ Load this page in your browser by using the following URL: http://localhost/test.php You should now have Apache, PHP and MySQL all installed and working nicely together. To see how to write a web application using this setup check out my Web Database Tutorial. Installing Apache and PHP Using Apache's DSO Module Another way to install Apache and PHP is by using Apache's DSO module. Apache supports adding modules on instead of embedding them in the httpd binary. This works well when you don't want to re-compile Apache each time a module is updated, or if you want to add on numerous modules for development purposes. Compile Apache with DSO support In Apache src directory (apache_1.3.14) # ./configure --prefix=/usr/local/apache \ --enable-module=so --enable-module=rewrite $ make $ make install Install PHP as a Module In PHP src directory (php_4.0.3pl1) # ./configure --with-mysql \ --with-xml \ --enable-track-vars \ --with-apxs=/usr/local/apache/bin/apxs # make # make install This will install Apache and then install the PHP module into the appropiate Apache directories. The only difference in configuration from above is the module needs to be added in the Apache httpd.conf file. To add a module in Apache add the following line in the httpd.conf file (if it is not already there, sometimes the install script adds it for you) LoadModule php4_module libexec/libphp4.so Be sure to following the rest of the configuration instructions above

Wednesday, February 23, 2011

php crash when 2 clients at same time ?

Having an issue that is specific to PHP compiled with PGSQL support
with versions noted in subject line. I understand that there are many
variables to consider here but believe I have narrowed down the Apache
Client Cert failures to my PHP/PGSQL build.

1. Apache PHP without PGSQL works as expected using client certificates

2. Apache PHP with PGSQL works fine with standard SSL connections

3 Apache PHP with PGSQL fails with client certificates - no output

other than Segmentation faults in the apache error logs as follows:

[Wed Nov 30 23:26:57 2005] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec2)....

I also performed same tests on another instance of Apache/PHP/PGSQL
which was version 2.0.54 of apache and PHP/PGSQL versions same as
subject line with same exact results.

Any ideas as to the source of this problem and suggestions for
tests/fixes are greatly appreciated. There are no errors in any of the
logs other than what I have included so it's very difficult to see what
is wrong. All I know for sure is that I am able to reproduce the
results on more than one machine.

Wednesday, February 2, 2011

How to install Window mobile phone development?


Window phone developer tools

·        Visual Studio 2010 Express For windows phone
·        Windows  Phone Emulator Resources
·        Silver Light tools for Visual studio
·        XNA Game Studio 4.0
·        Microsoft Expression Blend for Windows Phone

System Requirements

·        Supported Operating system : Windows 7;Windows Vista

·        Windows® Vista® (x86 and x64) with Service Pack 2 – all editions except Starter Edition

·        Windows 7 (x86 and x64) – all editions except Starter Edition

·        Installation requires 3 GB of free disk space on the system

·        2 GB RAM

·        Windows Phone Emulator requires a DirectX 10 capable graphics card with a WDDM 1.1 driver

Installation and Setup

·        When you install Windows Phone Developer Tools, you install Visual Studio 2010 Express for Windows Phone, Windows Phone Emulator, Expression Blend, XNA Game Studio, samples, and other SDK components.

Using the Visual Studio IDE for Windows Phone Projects

·        In the IDE that are unique to Visual Studio 2010 Express for Windows Phone and to the Visual Studio add-in that is included with Windows Phone Developer Tools.

Using Application Project Templates for Windows Phone

·        Visual Studio 2010 Express for Windows Phone and the Windows Phone Developer Tools add-in for Visual Studio includes project templates created specifically for application development on Windows Phone. After you create a Windows Phone project, you can open the project in Visual Studio or in Expression Blend for Windows Phone.

·        To open a project template, on the File menu, point to NewProject.

 

·        An application template that can be used as a starting point for any project based on Silverlight for Windows Phone. This template provides a simple one-page application that uses Page and Frame elements.

Debugging Windows Phone Applications

·        Visual Studio 2010 Express for Windows Phone and the Windows Phone Developer Tools add-in for Visual Studio include support for debugging Windows Phone applications. Visual Studio 2010 Express for Windows Phone and the add-in support most managed debugging features.

How to: Deploy a Windows Phone Application Using Visual Studio

·        You can use the Device Toolbar to specify either the Windows Phone Emulator or a Windows Phone device as the target for application deployment.

·        The Windows Phone OS 7.0 device must be registered and unlocked. For more information, see How to: Use the Developer Registration Tool for Windows Phone.

·        The device must be connected to the host computer.

·        The Zune client must be installed on the host computer.

·        The Zune client must recognize the connected device. When you connect a Windows Phone device to the host computer, Zune automatically starts. If it does not start, then start Zune manually. Zune must be running and the device must be recognized when deploying to a Windows Phone device.

To select the target device for deployment

·         Select either Windows Phone 7 Emulator or Windows Phone 7 Device on the Device Toolbar.
Device Toolbar

To deploy the application

·         To deploy the application to the selected device, select the Start Debugging (F5) icon in the Device Toolbar or Start without Debugging (Ctrl + F5) from the Debug menu.
·         If the emulator is the target device, it will launch automatically. For more information on starting the emulator, see How to: Start Windows Phone Emulator.
·         If you cannot connect to a Windows Phone OS 7.0 device, verify that you have met the prerequisities described above. Open Zune and verify that the Zune software recognizes your device.

Create Your First Silverlight Application for Windows Phone


Creating a New Project

  • Launch Visual Studio 2010 Express for Windows Phone from the Windows Start menu. If the Registration window appears, you can register or temporarily dismiss it.
  • Create a new project by selecting the File | New Project menu command.
  • The New Project window will be displayed. Expand the Visual C# templates, and then select the Silverlight for Windows Phone templates.
  • Select the Windows Phone Application template. Fill in the project Name as desired.
·        Click OK. A new project will be created and MainPage.xaml will be opened in the Visual Studio designer window.



Adding Controls



To add the controls of the application

Rename the application window title. Right-click the MY APPLICATION text in the Visual Studio designer and select Properties. The Properties window appears in the lower right hand corner.




  • In the Text property, change the name to My First Application.

  • Add support for both portrait and landscape orientations. Click the first line of the XAML code so that the PhoneApplicationPage properties are displayed in the Properties windows. Change the SupportedOrientation property to PortraitOrLandscape.

  • Open the Toolbox in Visual Studio, if it is not already open, by selecting the View | Other Windows | Toolbox menu command.

From the Windows Phone Controls, add a TextBox control to the designer surface by dragging and dropping from the Toolbox onto the designer surface. Place the TextBox just below the Mini Browser text. Use the mouse to size the control to the approximate width shown in the layout image above. You can leave the default name of the textbox as textBox1 in the Properties window. Change the Text property of textBox1 to http://www.xbox.com.
Set the Height and Width properties to Auto by typing the word Auto in the property value. Set the HorizontalAlignment property to Stretch. Set the Vertical Alignment property to Top. These properties will allow the control to size and position itself correctly in both Portrait and Landscape modes. Use the mouse to reposition your control relative to the margin so there is room for the Go button.
Add a WebBrowser Control for Windows Phone to your application by dragging and dropping it from the Toolbox. Place it below the two controls you added in the previous steps. The control will be named webBrowser1 by default. For more information about the Web Browser Control, see WebBrowser Control Overview for Windows Phone and WebBrowser Control Security Best Practices for Windows Phone.
Size the control to fill the remaining space.
Set the Height and Width properties to Auto. Set the Horizontal Alignment and Vertical Alignment properties to Stretch. These properties will allow the control to size and position itself correctly in both Portrait and Landscape modes.
Your layout should now be complete. In the XAML code in MainPage .xaml, look for the grid containing your controls. . If a Height or Width property of a control is not in the XAML, it will default to Auto.
Adding Code

 This step will add the code to implement the Go button.


Building and Debugging the Application

The application is now complete. This step will let you build, run, and debug the application.

To build and debug the application

1.      Build the solution by selecting the Debug | Build Solution menu command. The project should build without any errors in the Error List window. You can open the Error List window, if it is not already open, by selecting the View | Other Windows | Error List menu command. If there are errors, review the steps above, correct any errors, and then build the solution again.
2.      Run the application by selecting the Debug | Start Debugging menu command. This will open the emulator window and launch the application. Make sure that your desktop computer has Internet access. Then you can test your application by clicking on the Go button and verifying that the browser window navigates to the given web site. Press one of the rotation controls on the emulator: 






The emulator will rotate into Landscape mode. The controls will resize themselves to fit the Landscape screen format.