I'm relatively new to Phonegap and I would like to know if there is a way to mock gps location on a android device using it or if using the Location class in android is the only way to do it?
Check the link below:
http://www.cs.nott.ac.uk/~cmg/G54UBI/coursework2/GPS_and_Maps.html
Getting GPS position
Using the location sensor in AppInventor:
http://www.cs.usfca.edu/~wolber/appinventor/locationsensor.html
Using GPS in JavaScript, including PhoneGap:
http://docs.phonegap.com/phonegap_geolocation_geolocation.md.html#Geolocation
Note the "quirk" at the bottom, i.e. to get mock GPS on the emulator you must set the option
"enableHighAccuracy" to "true".
It appears that there is a problem with mock locations on the Android 2.3.3 emulator (it seems to
crash/reboot the emulator). Please avoid using this version of the emulator; try Android 2.2 instead.
Related
I'm using React-Native to create a native application for Android platforms. I want to get the coordinates from Global navigation satellite systems(GNSS) like GPS, GLONASS, Compass, IRNSS, QZSS, Galileo. For GPS I can use react-native geolocation but for others, I don't know what I should do.
Can someone help me?
I found my answer.
Not only it is not possible on react-native but also it is relate to version of Android that the phone is using.
Acording to this link https://stackoverflow.com/a/41095702/6771718
"With the andvent of Android 7.1, the raw data from GPS chips will be available to developers."
I want to compute coordinate separately. So i need to get raw data from GNSS sensor. For react-native in the time of writing this answer there was no module to get raw data for new Android phones. but it is possible by means of Android native programming with Java.
I'm using the Genymotion emulator to test my android application that needs location with GPS.
When I launch the Google Maps application, it gives me an incorrect location. Anyone have any idea about that?
There is several solutions for your problem:
You can choose the GPS position of a Genymotion emulator thanks to the GPS widget on the right side of the screen.
You can also do it by shell commmand, look at the documentation here
Or, if you have a pro license, you can do it by the Java API (for unit test for example).
You need both the GPS on in Genymotion (where you can set the location it reports to the device as above) PLUS you need to turn on location services on the virtual device itself (under Settings/Location Services for 4.1.1 - may vary a little depending on which version of Android you are emulating).
I have a android device without GPS, but i want to run apps that need GPS.
For example i want to make an app like these to use bluetooth gps but instead of using BT im using Android Open Accesory to make an USB GPS, so my problem is not how to comunicate the GPS to Android, my problem is how to make a service/provider that is recognised by android an the rest of the apps could use.
it could be made?
Everything is possible, but maybe not worth:
write a driver to your usb gps and map it at android os level. JNI level and core OS.
use it in your app.
probably it worth to buy a new phone with GPS instead.
Im trying to test my phonegap gps location application on Android Emulator.
I need to simulate W3C gps speed and heading on Android Emulator http://dev.w3.org/geo/api/spec-source.html.
Using DDMS i was able to setup kml path. However navigation.watchPosition only see latitude and longitude changes, heading and speed parameters are undefined.
Any ideas how to solve it?
Instead of using the android emulator, I use the ripple extension in chrome as the emulator. You can change everything you need for geolocation with it.
I am using SonyEricsson X10i phone. I have developend an application that just shows the current location of a user. Now the problem is When i turn on my application it just keep searching. It is not showing anything. Even if i try to use built in navigation system it does not work. I have turned on GPS receiver. My firmware version is 1.6 and kernel version is 2.6. I am not sure but i came to know from some resource that 1.6 firmware does not support GPS. Let me know if someone knows the solution.
Are you indoor or outdoor? GPS
usually only works well outdoor.
Do you
have turned 'network' as a data
source on in your location settings?
Allowing triangulation/cell
towers/wifi networks to get the
location if GPS/satellite is not
available.