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 8284995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:18:47+00:00 2026-06-08T11:18:47+00:00

This is my code on Titanium Appcelerator: function ApplicationWindow(title) { var self = Ti.UI.createWindow({

  • 0

This is my code on Titanium Appcelerator:

  function ApplicationWindow(title) {
    var self = Ti.UI.createWindow({
        title:title,
        backgroundColor:'white'
    });

        var button = Ti.UI.createButton({
        height:44,
        width:200,
        title:L('openWindow'),
        top:200
    });


    self.add(button);

    function getPosition() {
        alert("In the Function");
        Titanium.Geolocation.getCurrentPosition(function(e) {
                    Titanium.Geolocation.distanceFilter = 10;
                    Ti.Geolocation.preferredProvider = "gps";

                    if (e.error) {
                        Ti.UI.createAlertDialog({
                            title: L('geolocate_failure'),
                            message: e.error
                        }).show();
                        return;
                    }
                    var found = new Object();
                    locateIndicator.show();
                    found.longitude = e.coords.longitude;
                    found.latitude = e.coords.latitude;
                    found.altitude = e.coords.altitude;
                    found.heading = e.coords.heading;
                    found.accuracy = e.coords.accuracy;
                    found.speed = e.coords.speed;
                    found.timestamp = e.coords.timestamp;
                    found.altitudeAccuracy = e.coords.altitudeAccuracy;
                    return found
                });
    }

 button.addEventListener('click', function() {
        alert("button click");
        getPosition();
    });
    return self;
};

module.exports = ApplicationWindow;

When I am Running this code in Android Emulator it is giving a pop up reading “Location is currently unavailable.”
Does this mean until I run this code on a mobile(GPS Enabled) It wont give me any GPS Related output ? or it is something with my code ?
Thank you.

  • 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-06-08T11:18:48+00:00Added an answer on June 8, 2026 at 11:18 am

    If you want to run geo location service in your emulator then you have to set latitude and longitude in ddms.

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

Sidebar

Related Questions

I have this code in app.js : var login = Ti.UI.createWindow({ url: 'controllers/loginController.js' });
This code disabled mouse scroll functionality, when i click on the document. $(document).on(click, function
I am new to Titanium studio. I was working in X-code before this. I
Below is the code for titanium: var request = Titanium.Network.createHTTPClient(); request.open(POST, bh.serverAddress + MyCareer.svc/PostMessage/+
I am using the following code in Titanium Appcelerator to connect with remote Host:
I am using Appcelerator Titanium for an Android app and the code below generates
This code always works, even in different browsers: function fooCheck() { alert(internalFoo()); // We
I'm building code for a web view in Appcelerator Titanium. Because of the massive
This code doesn't work: var number = $(this).find('.number').text(); var current = 600; if (current
This code below allows me to find the word error in all my files

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.