Tuesday, August 6, 2013

iOS Login Apllication

Add following code in .h file


#import <UIKit/UIKit.h>


@interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
{
    

    IBOutlet UITextField *txtname;
    
    IBOutlet UITextField *txtpassword;
    
}

@property (nonatomic, retain) IBOutlet UITextField *txtname;
@property (nonatomic, retain) IBOutlet UITextField *txtpassword;

-(IBAction) mylogin;

-(IBAction) makeKeyBoardGoAway;

@end




Add following code in .m file

- (IBAction) mylogin
{
    
    if ([txtname.text isEqualToString:duName]  && [txtpassword.text isEqualToString:dpassword])
    {
        
        UIAlertView *alert = [[UIAlertView allocinitWithTitle:@"Suucessfull Logi...."
                                                        message:@"Welcome.!"
                                                       delegate:nil
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitlesnil];
        [alert show];
                            
       }
    
    else{
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Login Fail...."
                                                        message:@"Username OR Password Incorrect.!"
                                                       delegate:nil
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitles: nil];
        [alert show];
                
    
    }

}


-(IBAction) makeKeyBoardGoAway{
    
    [txtpassword resignFirstResponder];
}


Aslo want create UI and match the components with File Owner......

How to set "back" button in iOS application



1. Add following method in .m file


-(void)backToMain:(id)sender

{
    ViewController *toHome =[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
    [self presentModalViewController:toHome animated:YES];         

}

2. Add following code in .m file  (void)viewDidLoad method



    UINavigationBar *naviBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0,           [UIScreen mainScreen].bounds.size.width, 44)];
    naviBar.delegate = self;
    naviBar.tintColor = [UIColor blueColor];
    
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:@"Back"  style:UIBarButtonItemStyleBordered target:self action:@selector(backToMain:)];
    
    UINavigationItem *naviItem = [[UINavigationItem alloc] init];
    naviItem.leftBarButtonItem = backItem;
    naviBar.items = [NSArray arrayWithObjects:naviItem, nil];
    [self.view addSubview:naviBar];


1. Add following method in .h file

-(IBAction) backToMain:(id)sender;

Wednesday, April 17, 2013

How to run iOS Apps on an actual device.


Simple and Easy..

U hv to follow 3 steps to run iOS Apps on an actual device

1. make Certificate,
2. make App ID,
3. make Provisinal Profile

All explain in following video
https://www.youtube.com/watch?v=I6wHeh0f5vQ

Monday, April 8, 2013

Java Session Data

Application app = welcomePage.getCallingWindow().getApplication();
                WebApplicationContext ctx = (WebApplicationContext) app
                        .getContext();
                HttpSession session = ctx.getHttpSession();
                int userId = (Integer) session.getAttribute("userID");
                rp.setUser(userId);

Run SSH coomand using Putty

login as: fishostj
fishostj@204.93.211.117's password:
Last login: Thu Mar  7 04:32:41 2013 from 175.157.176.212
ALERT! You are entering a secured area! Your IP and login information
have been recorded. System administration has been notified.

This system is restricted to authorized access only. All activities on
this system are recorded and logged. Unauthorized access will be fully
investigated and reported to the appropriate law enforcement agencies.
fishostj@fis.hostjava.net [~]# cd jakarta-tomcat/bin
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# exe startup.sh
-bash: exe: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# -bash
-bash: -bash: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# cmd
-bash: cmd: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]#
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]#
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# run/shutdown.sh
-bash: run/shutdown.sh: No such file or directory
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# /shutdown.sh
-bash: /shutdown.sh: No such file or directory
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# ./shutdown.sh
Using CATALINA_BASE:   /home/fishostj/jakarta-tomcat
Using CATALINA_HOME:   /home/fishostj/jakarta-tomcat
Using CATALINA_TMPDIR: /home/fishostj/jakarta-tomcat/temp
Using JRE_HOME:       /usr/local/jdk1.5.0
Mar 11, 2013 5:22:34 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:367)
        at java.net.Socket.connect(Socket.java:524)
        at java.net.Socket.connect(Socket.java:474)
        at java.net.Socket.<init>(Socket.java:371)
        at java.net.Socket.<init>(Socket.java:184)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:592)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:344)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# ./startup.sh
Using CATALINA_BASE:   /home/fishostj/jakarta-tomcat
Using CATALINA_HOME:   /home/fishostj/jakarta-tomcat
Using CATALINA_TMPDIR: /home/fishostj/jakarta-tomcat/temp
Using JRE_HOME:       /usr/local/jdk1.5.0
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]#

Android Web Browser

 Use this method and add WebView to the XML file. It will good..Enjoy..

public void loadBrowser(){       
               
        myWebView = (WebView) findViewById(R.id.webView1);
        myWebView.setBackgroundColor(Color.parseColor("#000000"));
       
        WebSettings webSettings = myWebView.getSettings();
        myWebView.getSettings().setJavaScriptEnabled(true);
        myWebView.getSettings().setSupportZoom(true);
        myWebView.setWebViewClient(new WebViewClient());
        myWebView.getSettings().setUseWideViewPort(true);
        myWebView.getSettings().setLoadWithOverviewMode(true);
       
        try{
        myWebView.loadUrl("http://www.newmultimedia.com.au/clients/melbourne_blinds/");   
        }
        catch(Exception e){
            e.printStackTrace();
        }
               
    }

Monday, March 11, 2013

Run SSH coomand using Putty

login as: fishostj
fishostj@204.93.211.117's password:

ALERT! You are entering a secured area! Your IP and login information
have been recorded. System administration has been notified.

This system is restricted to authorized access only. All activities on
this system are recorded and logged. Unauthorized access will be fully
investigated and reported to the appropriate law enforcement agencies.

fishostj@fis.hostjava.net [~]# cd jakarta-tomcat/bin
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# exe startup.sh
-bash: exe: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# -bash
-bash: -bash: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# cmd
-bash: cmd: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]#
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
-bash: startup.sh: command not found
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]#
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# startup.sh
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# run/shutdown.sh
-bash: run/shutdown.sh: No such file or directory
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# /shutdown.sh
-bash: /shutdown.sh: No such file or directory
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# ./shutdown.sh
Using CATALINA_BASE:   /home/fishostj/jakarta-tomcat
Using CATALINA_HOME:   /home/fishostj/jakarta-tomcat
Using CATALINA_TMPDIR: /home/fishostj/jakarta-tomcat/temp
Using JRE_HOME:       /usr/local/jdk1.5.0
Mar 11, 2013 5:22:34 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:367)
        at java.net.Socket.connect(Socket.java:524)
        at java.net.Socket.connect(Socket.java:474)
        at java.net.Socket.<init>(Socket.java:371)
        at java.net.Socket.<init>(Socket.java:184)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:592)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:344)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]# ./startup.sh
Using CATALINA_BASE:   /home/fishostj/jakarta-tomcat
Using CATALINA_HOME:   /home/fishostj/jakarta-tomcat
Using CATALINA_TMPDIR: /home/fishostj/jakarta-tomcat/temp
Using JRE_HOME:       /usr/local/jdk1.5.0
fishostj@fis.hostjava.net [~/jakarta-tomcat/bin]#

Monday, March 4, 2013

Get Session Data in Java

Application app = welcomePage.getCallingWindow().getApplication();
                WebApplicationContext ctx = (WebApplicationContext) app
                        .getContext();
                HttpSession session = ctx.getHttpSession();
                int userId = (Integer) session.getAttribute("userID");
                rp.setUser(userId);

Monday, February 4, 2013

How to rename a vaadin project

create new workspace
go project  ->clear
right click on project explore area
import ur project
set the server
open web xml n edit name
right click on project and select refacto
edit name and put new name
refresh and run...