I'm porting android to Devkit8000 which is a BeagleBoard clone. I have a GPS module connected on /dev/ttyS0. I could successfully get NMEA output when writing "cat /dev/ttyS0" in the terminal emulator.
I want to know how to let android know that there is a GPS module on /dev/ttyS0 and it is outputting NMEA standard? To be able to use the android.location class with it! or test it with any GPS app in the store!
Is there something to edit in the android's source? adding driver for example, writing a code with android-ndk or what?
The interface you must implement is described in the Platform Development Kit and you may want to use the source for the emulated GPS as a reference.
Related
I am trying to get the location of the user's computer, however this computer doesn't have any built-in GPS. Is this possible? I am using a Mac.
You can use the Google maps Geolocation API. However, the client browser/device must support it.
Here's the link to the standards documentation - http://dev.w3.org/geo/api/spec-source.html
Example code from Google: https://developers.google.com/maps/documentation/javascript/examples/map-geolocation
I am creating a app for android using Kivy (python) that will send my location to a email. But kivy is not able to do this as GPS is not directly supported. This is what I have thought as my next step, but I need help.
Is there any CLI command that can give me my location. I will run that command using os.system(commad), the basic method for running commands in python.
Is there any executable available, like a jar file, or a javascript file, that I can run from my code and that gives me my current position using GPS.
Any readymade code of Kivy or Java, that I can test on my Phone.
Kivy uses python-for-android to compile APKs for you. It also provides pyjnius to wrap Android/Java API calls. This lets you access things like the Location API. The Plyer project is a cross platform layer that uses pyjnius for the Android part. There is a GPS example in Plyer which you can compile and use on Android if you have Kivy and Buildozer set up properly. Or you can read the source code of the GPS for Android part of Plyer to make your calls via pyjnius.
I'm happily developing GPS aware apps using LocationManager and NmeaListener, so I am not asking about how to use the Android SDK, but how the Android SDK talks to the internal GPS SDK
I'm trying to understand how Android interacts with the GPS SDK to deliver, for example, the speed and direction values in the GPRMC sentence. Do they come directly from the chip SDK or are they calculatedd by Android?
I'm looking at Android source in LocationManager.java, but I can't find where it interacts with the GPS SDK.
Can anyone point me in the right direction please?
I expect the GPS is a separate sub system which reports data to the system over a serial NMEA connection. If so then the GPS module will calculate Speed (SOG) and Course (COG) using internal methods. For low cost GPS modules they typically have a filtered position difference method. Higher end GPS receivers use carrier phase measurements to get instant results.
I'm guessing that you are noticing a lag in the COG and SOG values and hoping that knowing more about how they are derived will help you correct the lag...
I was wondering if it was possible to make an android app (that does not require root) that could enable and disable the use of mobile data for other apps? I know there's a function to toggle background services per app inside the native Android settings, so maybe there's some public methods for me to do so with my own app.
Basically, I want my app to control whether other apps could access data via mobile data or WiFi only.
Pointing me to the right direction would be greatly appreciated as well.
Theoretically, yes.
See: https://github.com/android/platform_frameworks_base/blob/dbc51de44fe4f9a7f81528204250de32ec405d39/cmds/svc/src/com/android/commands/svc/DataCommand.java
This is the svc tool that can be launched via adb shell. It did error out with code 137 for me (unrooted Nexus 5), though. But from the code you see how this should theoretically work.
You retrieve the TelephonyManager and enableDataConnectivity, which is, of course, a hidden API (see: https://github.com/android/platform_frameworks_base/blob/6b8a3a52acf1c2722551f1ea1ce47831f87939cd/telephony/java/com/android/internal/telephony/ITelephony.aidl). Accessing hidden APIs is possible by recompiling the android.jar that you build against, or by using reflection (see: How do I build the Android SDK with hidden and internal APIs available?).
Hope this helps.
I am trying to test a Location aware application on Android and iPhone in which I need to go to different locations.
Is it possible to mask/change the GPS location of the smart phone in which the GPS app is running using some code in.Net /Java? This is to make testing easier...
Pretty sure something like that would require hacking the onboard GPS chip. The easiest solution here would be to actually have your app mock the GPS coordinates instead.
I use a free 'Fake GPS' application from the Google Play Store for that purpose. I'm sure there are several available on both your target platforms