Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6001455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:50:14+00:00 2026-05-23T00:50:14+00:00

I am coding a login page with Titanium framework and using Android simulator. I

  • 0

I am coding a login page with Titanium framework and using Android simulator.
I need to authenticate user. I am using below mentioned code, but i get “Error” alert.

var loginWindow = Titanium.UI.createWindow({
            backgroundColor: '#CCD0D3',
            title: L('Login'),
            fullscreen: false,
            activity : {
                onCreateOptionsMenu : function(e) {
                    var menu = e.menu;
                    var cancel = menu.add({ title : L('Cancel') });
                    cancel.addEventListener('click', function(e) {
                        var alertDialog = Titanium.UI.createAlertDialog({
                            title: 'Clicked',
                            message: 'Cancel was clicked',
                            buttonNames: ['OK']
                        });
                        alertDialog.show();
                    });

                    var login = menu.add({ title : L('Login') });

                    login.addEventListener('click',function(e)
                    {
                        alert("Click");
                        if (txtUsername.value != '' && txtPassword.value != '')
                        {
                            var loginReq = Titanium.Network.createHTTPClient();
                            loginReq.onreadystatechange = function(){
                                alert('onreadystatechange');
                            };
                            loginReq.onload = function()
                            {
                                alert("load");
                                var json = this.responseText;
                                var response = JSON.parse(json);
                                if (response.logged == true)
                                {
                                    alert("Welcome " + response.name + ". Your email is: " + response.email);
                                }
                                else
                                {
                                    alert(response.message);
                                }
                            };
                            loginReq.onerror = function(){
                                alert("Error");
                            };
                            loginReq.open("GET","http://localhost/iMessage/Authenticate.svc/CheckLogin/praveen/matoria");
                            // var params = {
                                // username: txtUsername.value,
                                // password: Ti.Utils.md5HexDigest(txtPassword.value)
                            // };
                            //loginReq.send(params);


                            loginReq.send(null);
                        }
                        else
                        {
                            alert("Username/Password are required");
                        }
                    });
                }
            },
            exitOnClose:true
        });

If i use browser and send the same request than it sends me following response:

{"email":"myEmail@gmail.com","logged":true,"name":"Praveen Matoria"}

FYI: For reference i am using following link:

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:50:14+00:00Added an answer on May 23, 2026 at 12:50 am

    I found the way finally to use localhost for android.
    it clicked to my brains when i was accessing my virtual machine.

    Solution: Every machine has atleast 3 IP addresses:

    1. localhost
    2. 127.0.0.1
    3. Some internet IP addres through which you access internet. Go to command prompt and type “ipconfig”. In my case, 192.168.1.6 was the IP address.

    Use this and your requests would go to router first and than come back and forth.

    May be i am wrong at some facts, but overall idea is same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The coding is done using VS2008 There are two divs in my page namely
There is a login page in aspx.net that asks the user to enter in
I am coding a simple login UserControl with two TextBoxes (Username and Password) and
I've got a small login control on my master page. On the login control,
As a programmer my first instinct is to start coding, but then again chapter
I've been working with the .net login for a long time now, but my
I have some includes on a login page, a css file and a js
In my ASP .NET web application, when I first navigate to the login page,
I'm using PHP 4.3.9, Apache/2.0.52 I'm trying to get a login system working that
I have a user input form here: http://www.7bks.com/create (Google login required) When you first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.