31 March 2014

How to install Java on windows

How to Install Java in Windows 7

Java

1. First check whether Java is installed or not in your system.
  • Open MyComputer > Local Disk C: > Program Files > Common Files  and see if a folder named "Java" is present.
  • If the "Java" folder is present then you need to check if "environment variables path" is set or not
  •  If java dose not exist then you need to download  java jdk from Oracle website. Accept license agreement before downloading. Select your os(32 or 64-bit) and download. 
  • Java is open source software. It provides free download to the users and developers.
  • There are two kinds of java packages, one is jdk :- Java Development Kit, and other is jre:- Java Runtime Envirement
  • JDK:- It is used by developers to develop java based programmes like standalone(Disktop) and server applications.
  • JRE:- Is used to by the operating system to run java applications in the local computer.
  • JRE will convert java bite code instructions to system understandable Machine code which is executed by the system.
  • To download java for free click below link

Download and install java jdk. 
  • Install Java from the download.
  • Now Installation is successfull but its not yet over,  you need to set environment variables
  • Open command prompt and type javac in command line.
  • Then it shows 'Javac' is not recognized as an internal or external command.checking-for-java
  • You need to set environment variable path to avoid this java error.
  • In order to set path right click on Computer and click properties there you can find advanced system settings on left side pannel of the window.
    MyComputer-propertiesAdvanced-System-Settings

  • Now click on Advanced tab.
  • Under Advanced tab click environment variables button as shown below.



System-Properties

  • On clicking the button you find a Environment Variable popup.
  •  Now under User variables click "New" and set 
  • variable name : PATH and variable value : C:\Program Files\Java\jdk1.7.0\bin .
  • Then click OK.
  • Now again open command prompt to check if java is installed or not.
  • To do this you need to type javac on the command line It will show all java commands as shown in below image.It means that java has been successfully installed on your computer.


check-for-java

  • Now you can use notepad to write the code or download any IDE(Integrated Development Environment) and start programming(Starting with eclipse).
       Check this: Java programmes for beginners

14 March 2014

Change Background Image on pressed ListBox

<Grid x:Name="LayoutRoot" Background="Transparent">
        <!--toolkit:TiltEffect.IsTiltEnabled="True"-->
        <ListBox x:Name="Channel_List" SelectionChanged="Listbox1_SelectionChanged" >
         
            <ListBox.ItemTemplate>
                <DataTemplate>
                 
                    <ListBoxItem >
                        <StackPanel Width="490" MouseLeave="StackPanel_MouseLeave"  MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" MouseLeftButtonUp="StackPanel_MouseLeftButtonUp">
                            <StackPanel.Background>
                                <ImageBrush ImageSource="/Assets/Images/channel-bg-unsel.png"/>
                            </StackPanel.Background>
                            <Image Source="{Binding Image}" />
                            <TextBlock Text="{Binding StationName}" FontFamily="Segoe Print" />
                        </StackPanel>
                    </ListBoxItem>
                 
                </DataTemplate>
            </ListBox.ItemTemplate>
         
        </ListBox>

     
     
    </Grid>


/////handle click events in code behind..



private void StackPanel_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            var obj = (sender as StackPanel);
            ImageSource img = new BitmapImage(new Uri("/Assets/Images/channel-bg-sel.png", UriKind.Relative));
           ImageBrush ig = new ImageBrush();
           ig.ImageSource = img;
           obj.Background = ig;
            //obj.Background =
        }

        private void StackPanel_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            var obj = (sender as StackPanel);
            ImageSource img = new BitmapImage(new Uri("/Assets/Images/channel-bg-unsel.png", UriKind.Relative));
            ImageBrush ig = new ImageBrush();
            ig.ImageSource = img;
            obj.Background = ig;
        }

        private void StackPanel_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            var obj = (sender as StackPanel);
            ImageSource img = new BitmapImage(new Uri("/Assets/Images/channel-bg-unsel.png", UriKind.Relative));
            ImageBrush ig = new ImageBrush();
            ig.ImageSource = img;
            obj.Background = ig;
        }









selectedSelected-background-image

unselectedSelected-background-image

12 March 2014

WP7 Identity of the caller.

unable to determine application identity of the caller. settings class

or


Exception while using IsolatedStorageSettings:
System.IO.IsolatedStorage.IsolatedStorageException: Unable to determine
application Identity of the caller.
 at System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedScope
scope,Type appEvidenceType)
 at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedScope
scope,Type applicationEvidenceType)
 at System.Io.IsolatedStorage.IsolatedStorageSettings..ctor(boolean
useSiteSettings)
 at System.IO.IsolatedStorage.IsolatedStorageSettings.get_ApplicationSettings()
 at ManasutoApp.AppSettings..ctor() in


Try this code in your settings class.

if (!System.ComponentModel.DesignerProperties.IsInDesignTool)
                {
                    settings = IsolatedStorageSettings.ApplicationSettings;
                }


"check if the code is running in (visual studio or blend) using DesignerProperties.IsInDesignTool since accessing IsolatedStorageSettings in Visual Studio or Expression Blend is invalid."

I found this from StackOverFlow ..





Specified argument was out of the range of valid values. wp7.

for this you need to lode the settings class in Loded event.
public partial class Page2 : UserControl
public Page2(){
  Loaded += ChannelsPage_Loaded;
         
        }

        void ChannelsPage_Loaded(object sender, RoutedEventArgs e)
        {
            appSettings = new AppSettings();
            this.isolatedSettings(); // here you are calling method that uses isolated class

            var deviceId = DeviceExtendedProperties.GetValue("DeviceUniqueId"); // devide id of your Wp7
            byte[] bID = (byte[])deviceId;
            string deviceID = Convert.ToBase64String(bID);
        }


if possible instantiate "settings" Class as


if (!System.ComponentModel.DesignerProperties.IsInDesignTool)
                {
                    settings = AppSettings();// where you lode entire data from isolated storage
                }

Contact Form

Name

Email *

Message *

Smooth Graphics Java

// Arrange Bricks in Game //java brick breaker game code without flickering // added game levels 1,2,3 in the game //java paddle ball ga...