My Blog

Hello World WP 7 Version 

Tuesday, January 17, 2012 11:28:55 PM

 So this evening I finally took some time to roll up sleeves and delve into developing my first WP7 Application.

I followed the tutorial from Jesse Liberty's MSDN Magazine article, which was pretty straight forward.

However I will note that the following function EmailComposeTask()  does not work on the emulator, or at least I could not get it work, probably because I`m not running an "unlocked version".

So here we go : 

As stated in the article(link above) make sure you mock the XAML in expression blend.

So here is what my UI looks like

 Next is the XAML source:

which is nothing more than a couple of stack panel controls, label, and 2 textbox controls.

<phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" x:Class="NOTE_TO_ME.MainPage" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" shell:SystemTray.IsVisible="True"> <!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="1*"/>  <RowDefinition Height="9*"/> </Grid.RowDefinitions> <!--TitlePanel contains the name of the application and page title--> <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> <TextBlock x:Name="ApplicationTitle" Style="{StaticResource PhoneTextNormalStyle}"><Run Text="NOTE TO ME"/><LineBreak/><Run/></TextBlock> <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> </StackPanel> <StackPanel Margin="0,-24,0,0" Orientation="Horizontal" Height="77" Grid.Row="1" VerticalAlignment="Top"> <TextBlock Margin="0.8"  TextWrapping="Wrap"  Text="To:"  Width="42"  HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="32"/> <TextBox x:Name="Addy" TextWrapping="Wrap" Text="kp@mydomain.com" Width="280" /> <Button x:Name="Send" Content="Send" Margin="0,4,0,0" Width="132" Click="Send_Click"/> </StackPanel> <TextBox x:Name="msgbody" TextWrapping="Wrap" Text="Hello World!" Width="400" Margin="0,53,56,0" Grid.Row="1" Height="244" VerticalAlignment="Top" /><!--ContentPanel - place additional content here--> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"/> </Grid></phone:PhoneApplicationPage>Next is the code behind for the XAML or MainPage.xaml.cs this is best edited in VS

using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using Microsoft.Phone.Controls;using System.IO.IsolatedStorage;
namespace NOTE_TO_ME{    public partial class MainPage : PhoneApplicationPage    { private IsolatedStorageSettings isoSettings; //System.Windows.Controls.TextBox msgbody;
const string IsoKey = "EmailAddress"; //Initialize the isoSettings member in the constructor //isoSettings=IsolatedStorageSettings.ApplicationSettings; const string StateKey = "MessageState"; bool isNew = false;         public MainPage()        {            InitializeComponent(); isNew=true;         }
        private void Send_Click(object sender, System.Windows.RoutedEventArgs e)        {        // TODO: Add event handler implementation here. //EmailComposeTask emailComposeTask= new EmailComposeTask(); // emailComposeTask.Subject = "Send To Me";  //emailComposeTask.To = this.Addy.Text;  //emailComposeTask.Body = this.msgbody.Text;   //msgbody.Text = String.Empty;  //emailComposeTask.Show(); this.msgbody.Text= msgbody.Text +"  Message Button was clicked";         } protected override void OnNavigatedFrom(  System.Windows.Navigation.NavigationEventArgs e ) { if (isNew)  {    if (State.ContainsKey( StateKey ))    {      msgbody.Text = State[StateKey].ToString();    }  }  isNew = false;  base.OnNavigatedTo( e ); isoSettings[IsoKey] = Addy.Text; //  State[StateKey] = msgbodyText; OnNavigatedFrom(e); } private void RestoreEmailAddress() { if(isoSettings.Contains(IsoKey)) Addy.Text = isoSettings[IsoKey].ToString(); }     }}

 

Conclusion: This is a good starter application. I definitely am looking forward to more info from Jesse Liberty regarding the further development of this application..

 

Happy Coding!!!

by Keidrick Pettaway

WP7 Tips: Add to dictionary 

Thursday, January 05, 2012 10:53:33 PM

Have an often typed word, that's not currently in your dictionary?

To add it follow these simple steps:

 

After typing a word that is not in the auto predict dictionary, simply tap the word to highlight it and it should appear in the words list with a + next to it, simply tap the + and it’s been added to you list of words.

Preview of The Windows Store 

Thursday, December 08, 2011 12:31:55 AM

Black In America 4 Preview 

Friday, November 11, 2011 9:43:33 AM

LANUG November Meeting 

Thursday, November 10, 2011 9:21:32 AM

 

Thursday November 10th Meeting

About the Speaker: Chris Gardner is the Senior Software Engineer and Architect for T & W
Operations, L.L.C. Tortured by years of contracts that valued
buzzwords over results, Chris has developed a true passion for finding
solutions that fit the problem, not the status quo. Chris received his
B.S. in Mathematics and B.A. in Philosophy from the University of
Alabama in Huntsville and is currently a Microsoft Certified
Professional Developer, Information Technology Professional and
Trainer. You can reach Chris by email at 
freestylecoding@gmail.com,
follow his exploits in Game and Application development at his blog
(
http://geekswithblogs.net/freestylecoding), or pester him through
social networking sites Twitter (@freestylecoder) and Google+ (+Chris 
Gardner).

Session Abstract: Introduction to XNA: Game Development for Fun and Profit
While many of us dream of jobs in game development, XNA Game Studio
and Microsoft's AppHub give you the tools necessary to make and
publish your own games for the Windows, Xbox Live Indie Games and
Windows Phone 7 Marketplace. Chris will begin by giving a brief
overview game development and using XNA Game Studio. From there, he
will progress into the some of the tools necessary for all game
development, such as the game loop, collision detection, and
processing inputs from analog devices.

From there, Chris will present some issues that are specific to the
individual platform. This will include handling the wild west of the
PC, dealing with the confined environment of the Xbox 360, and scaling
to the minimalistic Windows Phone 7 environment. There will also be a
overview of the new Mixed Silverlight and XNA projects available in
Window Phone 7.5.

When

Thur, November 10, 6pm – 8pm CST

Where

ITT Technical institute - 3100 Cottage Hill Rd, Mobile, AL 36608

Up For Grabs - T-Shirts, Books, Software with Licenses, etc.

"Icon file not found" 

Tuesday, November 01, 2011 10:52:54 PM

WP7 Image

 I have noticed that whenever you change, or update an Image File you need to make sure you reference the "Build Action" as content, or you will get the dreaded error.

by Keidrick Pettaway

BarCamp Mobile 2011 

Wednesday, October 26, 2011 8:49:30 AM

 Barcamp 2011 will be held at the University of South Alabama CIS Building on Saturday, November 12th from 8am-5pm. Pre-event mixer the night of November 11th, location TBA.

Registration is strongly required as space is limited. Breakfast and lunch will be provided.

 Click to Download Flyer

 

by Keidrick Pettaway

aspnet_wp.exe could not not be started 

Thursday, October 20, 2011 11:22:23 AM

After several hours of troubleshooting this solved the issue

To work around this problem, use one of the following methods:

  • Create a weak account that has the correct permissions, and then configure the <processModel> section of the Machine.config file to use that account.
  • Set the userName attribute to SYSTEM in the <processModel> section of the Machine.config file.
  • Configure the <processModel> section of the Machine.config file to use an administrator account.

Note Allowing ASP.NET applications to run as SYSTEM or an administrator account has serious security implications. If you use either of these workarounds, code that is run in the Aspnet_wp.exe process will have access to the domain controller and the domain settings. Executable files that are started from the Aspnet_wp.exe process run in the same context and also have access to the domain controller.

Therefore, Microsoft recommends that you use the first workaround. To use the first workaround, follow these steps:

  1. Create a user account on the computer named ASPUSER, and then add this account to the Users group.

    Note You can also use the ASPNET account that the .NET Framework created if you change the password on this account. You must know the password on this account because you add the password to the <processModel> section later in these steps.
  2. Grant the ASPUSER or the ASPNET account the Log on as a batch job user right. Make sure that this change appears in the Local Security Policy settings.

    Note To grant the Log on as a batch job user right on this account, you may have to grant this user right in each of the following security policies (From the Control Panel/Administrative Tools): 

    • Domain Controller Security Policy
    • Domain Security Policy
    • Local Security Policy

    Note You may have to reboot the server for these changes to take effect.
  3. Make sure that the ASPUSER or the ASPNET account has permission to access all of the necessary directories and files to start the Aspnet_wp.exe process and to serve the ASP.NET pages. For additional information about what permissions you must grant to this account, click the following article number to view the article in the Microsoft Knowledge Base:
    317012  Process and request identity in ASP.NET
  4. Open the Machine.config file. The path to the file is: %Systemroot%\Microsoft.NET\Framework\v1.0.3705\CONFIG.
  5. In the <processModel> section of the Machine.config file, change the userName and the passwordattributes to the name and the password of the account that you created in step 1. For example:
    userName="DomainName\ASPUSER" password="ASPUSERpassword"
  6. Save the changes to the Machine.config file.

 *taken directly from MSFT*

support.microsoft.com/default.aspx

by Keidrick Pettaway

Coding for fun with Scott Hanselman 

Wednesday, September 07, 2011 12:26:16 PM

Must have apps for HP Touch Pad 

Sunday, September 04, 2011 4:08:44 PM

Due to the fire sale by HP on touch pad tablets, the number of new device owners has increased almost over night. That being said I've decided to compile a list of "must have" apps for the Web Os enabled device. If I have missed any or, you feel there are more that need to be added to the list feel free to leave me a comment.

1.) Angry Birds HD (Free)

2.)Facebook (Free)

3.) Spaz HD (Beta) *very good app for twitter*

4.) Camera for Touch Pad

5.) Amazon Kindle (Free)

6.) Tune in Radio

7.)Typewriter Beta

8.)Groupon

9.)Pandora 

10.) Box.net Free * (free upgrade to 50 gig once you activate your account) *

11.) Ever note

12.) Translator HD 

13.) NPR Reader 

by Keidrick Pettaway

Copyright 2008-2009 Keidrick Pettaway