how to invoke gps to find my location in blackberry via simulator ?
Unless you have a physical GPS receiver attached to the machine on which the simulator is running, you will not be able to obtain GPS coordinates. What you can do is to make a dummy class that acts as the GPS device itself. This should allow you more control on how, when and what data do you supply to your program.
Related
There are a few desktop softwares(like itools) out there that can be used to virtually set the location of the phone anywhere in the world.
I'm very confused on how is this possible? How can your cheat the GPS into making it thinks it's somewhere else?
With a gpx file, you can simulate your location anywhere you like (for testing purposes). You can do this with Xcode when your phone is connected. But there is a bug and it's keep you in that fake location if you pull off the cable without selecting Don't Simulate Location before.
I am working on an application that needs the location of where the user is entering information. This iOS application may run on iPhone and iPad. Given that iPhone typically come with cellular service and thus a GPS chip I don't think this will be an issue. However what about iPad? If I am developing for iPad (that will not have cellular service) how will I be able to retrieve the user's current GPS location. This would be easy to do with the CoreLocation framework if I knew I had that capability, but on iPad I can't always be certain it will be there.
How would I get around this to get the GPS coordinates, or some other way of getting the user's relative location?
Location services are available even on iPad, using WiFi.
Take a look at this Article from Apple:
https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html
Specifically, you can set up your app to require either location services, or to require a GPS:
Requiring the Presence of Location Services in an iOS App
If your iOS app requires location services to function properly,
include the UIRequiredDeviceCapabilities key in the app’s Info.plist
file. The App Store uses the information in this key to prevent users
from downloading apps to devices that don’t contain the listed
features.
The value for the UIRequiredDeviceCapabilities is an array of strings
indicating the features that your app requires. Two strings are
relevant to location services:
Include the location-services string if you require location
services in general.
Include the gps string if your app requires
the accuracy offered only by GPS hardware.
There are two sources in IOS devices to get user location, one is through "GPS" and the other one is "WIFI". Your must be having one of them to retrieve user's location. If your IPad is connected to a "WIFI network" even if it doesn't have a cellular connection, then it's not an issue.
I have created an app that I want to know the magneticHeading. I have coded it in every way possible that I thought it would work. From there I have been testing my app on the simulator but it wont give me the magneticHeading Value.
I have looked for this before and I believe the answer is that the simulator will not give you this value. I haven't found anything that flat out said it so I just want to check with the community for my exact situation:
Will the iPhone simulator give you the magneticHeading Data.
Would it with a gpx file?
Your assumptions are correct because the simulator does not have the required hardware, which in this case is the magnetometer. You can determine way points, routes etc with a .gpx file but as far as orienting the display to correlate with the direction the user is facing, you'll need a compass. Testing on an actual device with the required hardware would therefor be preferable.
The use of location services requires user authorization. In addition, some location services require the presence of specific hardware on the given device. For example, heading information is available only on devices that contain a hardware compass.
This is taken from CLLocationManager Class Reference
For a list of devices that have the magnetometer hardware have a look at iOS Device Compatibility Reference
Sometimes I need to demo some apps that are location based. I like using my laptop and want to use if for the demo. I know I can change the location of simulator to not point to California, but is there a way to have cllocationmanager pickup actual location of the laptop?
It's not a matter of having GPS.
You need to look at the iOS Simulator as a virtual machine within osx. Like every virtual machine it has limited capabilities.
So in the current version it's simply not possible - sorry.
To change locations for the debugger, take a look at location debugger:
http://socialbit.de/location-debugger
(Note that I haven't tested this app)
Dont think mac has GPS , like iphone/ipad.
What you could do is harcode the location to ur desired location.
For an iPad, or iPod touch, is there a way to find out if the device has GPS?
Extra Credit: What if the iPad itself does not, but it is connected to a third-party GPS unit? Can I determine this?
Apple does not provide a function to directly query the device if it has GPS capabilities or not. There are two possible solutions to your problem:
Query the device type and determine if it has GPS based on that. This is described here.
The way Apple recommends: have a look at their documentation here (Section "Determining the available Hardware Support"). Basically you create an instance of CLLocationManager and set the desired accuracy to the highest level, after that you can query its accuracy; if it's not very accurate, it's likely that the device does not have GPS.
Hope this helps. :)
For iOS 6 or higher, you might want to try
+ (BOOL)[CLLocationManager deferredLocationUpdatesAvailable]
According to the documentation:
Deferred location updates require the presence of GPS hardware and may not be supported on all iOS devices.
Only GPS can deliver the location attributes: course and speed.
And as a general rule, you need GPS for precise location, a device whitout GPS will deliver a location.getHoricontalAccuracy() higher than 30- 40m. (Using accuracy setting of CLLLocationAccuracyBest)
So In that case you dont have an accurate position and can ignore that always. (Independnet if the device has GPS or not)
Download altimeter or similar app. Turn off cell data and wifi before you ever use the downloaded app. Then launch the app and see if it will give you Your current altitude. If it works you have GPS if it doesn't then you don't