Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Enable gps device

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Enable gps device

    HI,
    there is away to set on the device gps in mobile device using phonegap ????


    Thanks

    #2
    Re: Enable gps device

    I have not used the Geolocation plugin yet, but as I understand it the user must turn Location Services on before you can get the device coordinates. Geolocation data is generally considered sensitive because it can reveal a user's whereabouts, and if stored, the history of their travels. If Location Services is turned off when your app attempts to get the device's coordinates, a message should appear asking the user if it is okay to turn on Location Services.

    Comment


      #3
      Re: Enable gps device

      I used it using phoneGap - works fine. Here is the example

      1)select the Geolocation - phonegap core plugins or add the following in the config.xml
      <feature name="http://api.phonegap.com/1.0/geolocation" />
      <gap:plugin name="org.apache.cordova.geolocation" />

      2) Create a button with the following code
      // onSuccess Callback
      // This method accepts a Position object, which contains the
      // current GPS coordinates
      //
      var onSuccess = function(position) {
      alert('Latitude: ' + position.coords.latitude + '\n' +
      'Longitude: ' + position.coords.longitude + '\n' +
      'Altitude: ' + position.coords.altitude + '\n' +
      'Accuracy: ' + position.coords.accuracy + '\n' +
      'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' +
      'Heading: ' + position.coords.heading + '\n' +
      'Speed: ' + position.coords.speed + '\n' +
      'Timestamp: ' + position.timestamp + '\n');
      };

      // onError Callback receives a PositionError object
      //
      function onError(error) {
      alert('code: ' + error.code + '\n' +
      'message: ' + error.message + '\n');
      }

      navigator.geolocation.getCurrentPosition(onSuccess, onError);

      Comment


        #4
        Re: Enable gps device

        HI JPMPA ,
        thanks for the answer ...
        I want to test if the gps device to mobile phone is active or not ....
        If not active , I set active with code....

        Comment


          #5
          Re: Enable gps device

          Copy and paste from the Geolocation documentation "WARNING: Collection and use of geolocation data raises important privacy issues. Your app's privacy policy should discuss how the app uses geolocation data, whether it is shared with any other parties, and the level of precision of the data (for example, coarse, fine, ZIP code level, etc.). Geolocation data is generally considered sensitive because it can reveal user's whereabouts and, if stored, the history of their travels. Therefore, in addition to the app's privacy policy, you should strongly consider providing a just-in-time notice before the app accesses geolocation data (if the device operating system doesn't do so already). That notice should provide the same information noted above, as well as obtaining the user's permission (e.g., by presenting choices for OK and No Thanks). For more information, please see the Privacy Guide."

          Phonegap developers privacy guide - http://docs.phonegap.com/en/3.4.0/gu...rivacy%20Guide

          I've no idea if it is possible to circumvent the user to turn on GPS, but am pretty sure your app would be rejected by any distributor if they were aware of it.

          Comment


            #6
            Re: Enable gps device

            Thanks so much for this Information


            George

            Comment


              #7
              Re: Enable gps device

              iOS will prompt for the user's permission when an app asks for geolocation information. There is no way to get around that. Nor should there be.

              Comment


                #8
                Re: Enable gps device

                Originally posted by JPMPA View Post
                I used it using phoneGap - works fine. Here is the example

                1)select the Geolocation - phonegap core plugins or add the following in the config.xml
                <feature name="http://api.phonegap.com/1.0/geolocation" />
                <gap:plugin name="org.apache.cordova.geolocation" />

                2) Create a button with the following code
                // onSuccess Callback
                // This method accepts a Position object, which contains the
                // current GPS coordinates
                //
                var onSuccess = function(position) {
                alert('Latitude: ' + position.coords.latitude + '\n' +
                'Longitude: ' + position.coords.longitude + '\n' +
                'Altitude: ' + position.coords.altitude + '\n' +
                'Accuracy: ' + position.coords.accuracy + '\n' +
                'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' +
                'Heading: ' + position.coords.heading + '\n' +
                'Speed: ' + position.coords.speed + '\n' +
                'Timestamp: ' + position.timestamp + '\n');
                };

                // onError Callback receives a PositionError object
                //
                function onError(error) {
                alert('code: ' + error.code + '\n' +
                'message: ' + error.message + '\n');
                }

                navigator.geolocation.getCurrentPosition(onSuccess, onError);

                When your GPS is off, does this http://i.stack.imgur.com/bDIgF.png, dialog prompts to you? Or this prompt doesn't prompt at all at Phonegaps builds? I noticed some apps have this promt. BU I can't find any doc that says this prompt is not possible in Phonegap. Also, Im building a Phonegap app intended for IOS.

                Comment


                  #9
                  Re: Enable gps device

                  No, not every time I use gps. It asked/asks permission when I install the application on the device- one time - and I gave all the permissions it need. [Including permission to use the camera, etc - this is on iOS iphone/iPad.]

                  Thanks.

                  Comment


                    #10
                    Re: Enable gps device

                    Thanks for all...


                    GT

                    Comment


                      #11
                      Re: Enable gps device

                      Originally posted by JPMPA View Post
                      No, not every time I use gps. It asked/asks permission when I install the application on the device- one time - and I gave all the permissions it need. [Including permission to use the camera, etc - this is on iOS iphone/iPad.]

                      Thanks.
                      I see. But I'm getting confused why other apps have this prompt http://i.stack.imgur.com/bDIgF.png on turning on location access (given that their location access is off before opening an app that uses geolplugin). Have you tried turning off your location access and open your phonegap app that uses geolocation? Does this prompt shows up?
                      Last edited by enafleurence; 11-09-2014, 09:46 PM.

                      Comment


                        #12
                        Re: Enable gps device

                        Under iOS 8 Location Services does not prompt for Approval during install. The Approval Prompt is only issued when GeoLocation services are requested the first time. If an app is run but GeoLocation services are not requested during startup then Approval is not requested. If, for example, a button requests a current GeoLocation, then Approval is requested... and only the first time... only once.

                        Comment


                          #13
                          Re: Enable gps device

                          Originally posted by Davidk View Post
                          Under iOS 8 Location Services does not prompt for Approval during install. The Approval Prompt is only issued when GeoLocation services are requested the first time. If an app is run but GeoLocation services are not requested during startup then Approval is not requested. If, for example, a button requests a current GeoLocation, then Approval is requested... and only the first time... only once.
                          Yes, permissions are displaying to me but this alert/prompt http://i.stack.imgur.com/bDIgF.png, does not appear though. Given my app is requesting for geolocation services and my Location access is off. I want the users to see this prompt so when they click the Settings button, they could be redirected to the Location Access, instead of just prompting them a customize alert that says "Please go to Settings -> Privacy -> Location -> Location Services and turn it on so tha app can access your location".

                          Comment


                            #14
                            Re: Enable gps device

                            I think we have to break this down a bit...

                            A GeoLocation app only asks for permission one time... when Location Services are requested.
                            Permission is only requested if Location Services are turned ON.
                            If Location Services are OFF then the error message is : "Location services are disabled." This error is captured in your routine.
                            I don't think you can automatically re-direct to Location Services - at least I hope not. Is that what you're asking?
                            If Location Services are ON but Services have been set to Never for the app then an error is thrown, but no specific message is available.

                            So... although it's tough to say what's going on with your app... in my app... if Location Services are OFF there is no prompt to turn on Services... rather an error message. You say you're getting a request when Location Services are off... but I don't think so.

                            EDIT: I think wording is getting in the way here. You say your app is requesting for geolocation services... but that's YOU pushing out the request... not iOS... right? You've already determined that Location Services are OFF.
                            Last edited by Davidk; 11-10-2014, 11:29 AM.

                            Comment

                            Working...
                            X