[INFO] Application exited from simulator

You must Login before you can answer or comment on any questions.

Hi All,

       I am developing a titanium mobile app for both android and ios.

I completed the development of android app with titanium successfully. But While I am implemented IOS app I stocked.I am developing a login page with username & password text fields , when ever I try to enter some thing in text fields the simulator suddenly and I got following error simply in console i.e . [INFO] Application Existed From Simulator.

   Please Help me in this issue urgent and Thanks In Advance.
— asked 11 months ago by Venkat Kayasiri
9 Comments
  • Hi Venkat,

    You have to post some block of code so we may help you better without showing code we can not find problem.

    — commented 11 months ago by Nitin Chavda

  • Thanks For Responding Nitin, And I paste the code below as you said.

    app.js

    // this sets the background color of the master UIView (when there are no windows/tab groups on it)  
    Titanium.UI.setBackgroundColor('#fff');  
    
    var homePage = Titanium.UI.createWindow(); //Used After suuceesful login.
    
    homePage.addEventListener('android:back',function(e) {
      // do nothing
    });
    
    var main = Titanium.UI.createWindow({  
        url:'main_windows/login.js',  
        height:Ti.Platform.displayCaps.platformHeight,  
        width:Ti.Platform.displayCaps.platformWidth,
        backgroundColor : '#125653',  
        fullscreen:true,  
        navBarHidden:true  
    }); 
    
    main.addEventListener('android:back',function(e) {
      // do nothing
    });
    
    main.open();  
    
    Ti.App.addEventListener('loginSuccess',function(loginHandlerEvent){
        homePage.url = 'main_windows/homePage.js';
        homePage.backgroundColor = '#125653';
        //homePage.backgroundColor = '#232323';
        homePage.firstName = loginHandlerEvent.firstName;
        homePage.lastName = loginHandlerEvent.lastName;
        homePage.fullscreen = true;
        homePage.navBarHidden = true;
        main.close();
        homePage.open();
    });
    

    login.js

    var win = Titanium.UI.currentWindow;     
    
    var username = Titanium.UI.createTextField({  
        color:'#336699',  
        top: ((Ti.Platform.displayCaps.platformHeight / 2) - 80), //160 
        left: ((Ti.Platform.displayCaps.platformWidth - 300) / 2), //10 
        width:300,  
        height:40,  
        hintText:'Username',  
        textAlign : 'left',
        keyboardType:Titanium.UI.KEYBOARD_DEFAULT,  
        returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,  
        borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
    });  
    
    win.add(username);  
    
    var password = Titanium.UI.createTextField({  
        color:'#336699',  
        top: ((Ti.Platform.displayCaps.platformHeight / 2) - 30), //210
        left:((Ti.Platform.displayCaps.platformWidth - 300) / 2),  //10
        width:300,  
        height:40,  
        hintText:'Password',
        textAlign : 'left',  
        passwordMask:true,  
        keyboardType:Titanium.UI.KEYBOARD_DEFAULT,  
        returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,  
        borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
    }); 
    
    win.add(password);  
    
    var loginBtn = Titanium.UI.createButton({  
        title:'Login', 
        top: ((Ti.Platform.displayCaps.platformHeight / 2) + 20), //260
        left: ((Ti.Platform.displayCaps.platformWidth / 2) - 90), //70
        width : 80, 
        height:35,  
        borderRadius:1,  
        font:{fontFamily:'Arial',fontWeight:'bold',fontSize:14},
        textAlign : 'center' 
    }); 
    
    win.add(loginBtn); 
    
    var clearBtn = Titanium.UI.createButton({  
        title:'Clear', 
        top: ((Ti.Platform.displayCaps.platformHeight / 2) + 20), //260
        left: ((Ti.Platform.displayCaps.platformWidth / 2) - 5), //155
        width:80,  
        height:35,  
        borderRadius:1,  
        font:{fontFamily:'Arial',fontWeight:'bold',fontSize:14},
        textAlign : 'center'  
    }); 
    
    win.add(clearBtn);  
    
    var errorMessageLabel = Titanium.UI.createLabel({
        top :  ((Ti.Platform.displayCaps.platformHeight / 2) - 110), //130 
        left : ((Ti.Platform.displayCaps.platformWidth - 300) / 2), //10
        color : 'red',
        font:{fontFamily:'Arial',fontWeight:'bold',fontSize:14} ,
        visible : false
    });
    
    win.add(errorMessageLabel);
    
    clearBtn.addEventListener('click',function(e)  
    {  
        username.value = '';
        password.value = '';
        username.focus();
    });
    
    
    var loginReq = Titanium.Network.createHTTPClient();  
    
    loginBtn.addEventListener('click',function(e)  
    {  
        if (username.value != '' && password.value != '')  
        {  
            loginReq.open("POST","http://10.10.73.70/HiisightMobile/mobile/loginValidate_Titanium.php");  
            var params = {  
                username: username.value,  
                password: password.value,
                isMobile: true  
            };  
            loginReq.send(params);  
        } else if (username.value == '') {  
            errorMessageLabel.visible = true;
            errorMessageLabel.text = 'Please enter username.';
            errorMessageLabel.opacity = 1;             
        } else if(password.value == '') {
            errorMessageLabel.visible = true;
            errorMessageLabel.text = 'Please enter password.';
            errorMessageLabel.opacity = 1;
        }
    });  
    
    loginReq.onload = function()  
    {  
        errorMessageLabel.visible = false;
    
        var json = this.responseText;  
        var response = JSON.parse(json);          
    
        if (response.loginStatus == "failure") {  
            errorMessageLabel.visible = true;
            errorMessageLabel.text = response.message;
            errorMessageLabel.opacity = 1;
        } else if(response.loginStatus == "error"){
            errorMessageLabel.visible = true;
            errorMessageLabel.text = response.message;
            errorMessageLabel.opacity = 1;
        } else {         
            username.blur();  
            password.blur(); 
            Titanium.App.fireEvent('loginSuccess',{
                firstName: response.FirstName,
                lastName : response.LastName
            });                         
        }
    };  
    
    loginReq.onerror = function()
    {
        alert("Network error");
    };
    
    I pasted the code above, in that first one is app.js and second one is login.js. And after successful login I want to navigate to the homePage.js
    

    — commented 11 months ago by Venkat Kayasiri

  • Hi, I don't find any error in your code but Try after comment below code

    homePage.addEventListener('android:back',function(e) {
      // do nothing
    });
     
    main.addEventListener('android:back',function(e) {
      // do nothing
    });

    — commented 11 months ago by Nitin Chavda

  • Show 6 more comments

Your Answer

Think you can help? Login to answer this question!