Locating Without WiFi/Celluar API - android

I know it sounds weird. It happens that those Locating APIs regarding WiFi/celluar assistance are disabled in most Android handsets in China. That is, I could hear the callbacks of GPS_PROVIDER when I was out of the building. But if I was in the building, I would never hear the callbacks of NETWORK_PROVIDER. As a result, my app won't be able to locate if put indoor. (I did some experiments with handsets shipped from the states. My app located perfectly well with the NETWORK_PROVIDER if put indoor.)
My guess is that those Chinese Android handsets have sort of castrated the Android OS so that any API related to WiFi/celluar assistance locating has been removed.
But my app still needs to locate. A city-level accuracy will do.
So my question is, is there any possible solution for my situation. Right now I'm considering:
IP address reverse-lookup. But the accuracy is far worse than city-level.
Let my app collect any necessary information (such as router MAC address, celluar tower info) and send them to a third-party server. That server would locate and send back location info to me.
Find (magically) a third-party SDK and hopefully that SDK would do the trick.
Thanks in advance!

IP lookup is fine. You can also try skyhook wireless's location SDK: here
iOS in the early days are using them, and they are actually better/more accurate than Google's location service.

It is definetly possible. You look at the services of Imere's ULaP.

Related

How can I receive a network location without Gapps or root access?

I have to get the location of a device, as accurately as possible. Since GPS doesn't work well in areas with lots of high buildings, I'll have to use the network location sometimes. The device doesn't come with Gapps, and I tried installing them myself, which also doesn't seem to work.
This device comes with its own special OS, so I can't flash custom ROMs or anything like that. I've tried to install MicroG as a replacement for all Gapps features, but it seems I need root access for that, which I also can't acquire.
I'd also prefer to not use a paid API, as I don't know exactly how many times this is going to be used, but it could be a lot.
Not sure if you need this, but the Android version is 4.4.4, API 19, Codename KitKat.
Does anyone know a solution to this? Please also let me know if paid API is the only solution.

Android Detect Nearby Device (Covid-19 app)

The covid-19 app is capable of detecting who came into contact with who, how do they do it? I am trying to make something similar but I am unsure how they managed to get that information from the phones. I don't need the information to be private (like phone number), it could be something that only the government can make use of (like sim card number or MAC address. Is that possible?
I looked into Google Nearby and Wifi Direct... But as far as I understand it, it requires a handshake (covid19 app doesn't). I also looked into potentially making your phone into a hotspot and capturing wifi requests but I am not sure which library / API lets me do that.
Does anyone have know how this is done? I can't find a concrete answer anywhere, this seems to be actually impossible until I realized that the covid-19 app is doing it.
As Morrison Chang and ArtHare have commented already, Google and Apple have implemented this on an OS level:
In the coming months, Apple and Google will work to enable a broader Bluetooth-based contact tracing platform by building this functionality into the underlying platforms. (source)
If you want the specs they're using, Apple and Google have pages on how contact tracing is implemented, but it would be hard (if not impossible) for an app to implement this.

What are the best ways to get a User's Country in Android?

I am working on an application which has to expose certain functionality only in certain countries. To enable this I need to find the country of the User. What are the ways I could do this? I can add server support if needed.
What I have looked at so far.
1) Ip geolocation - Should work in most cases, reasonably fast, but not sure how accurate. I have noticed some applications listing some of my colleagues in SG as being in china..
2) Location + reverse Geocoding - Seems more reliable, but requests location services on the device (does it work on wifi only tablets) and for it to be enabled, and requires time to a) fetch location b) server call to reverse geocode
3) Just discovered TelephonyManager and its calls getNetworkCountryIso and getSimCountryIso, not sure how these two are different.. This should be very fast, but again only on devices with a SIM.
Timezone and locale based solutions are not feasible since the user might change the locale(by changing the device language) and several countries share timezones.
Are there any other solutions? If none of these are very satisfactory, we might go with multiple APKs, but want to consider all options first
The devices we need to support are 4.1+ Android phones (and soon tablets), particularly Samsung.
There are quite a few related posts for this topic, but most of them focus more on how to achieve one of the solutions, rather than compare and contrast all options. I have also looked at Android Location Strategies, but that again focuses just on how to get the location for #2.
Edit: Just came across LocationProvider.getLastKnownLocation which should be fast, and the likelyhood of inaccuracy probably not too important for me.
Google Play Services has a similar API as well.

Simulate cellular network's behaviour on Eclipse emulator

Is there any way to simulate the behaviour of a cellular mobile network (GSM/UMTS) in the Eclipse Android emulator?
More specifically: I want to develop an app to show information about the network, such as coverage level, parameters of neighbouring cells etc, as provided by the TelephonyManager and other related classes. I would like to do as much debugging as possible with the emulator, before testing in an actual phone.
For that I would need the emulated phone to "see" a functioning cellular network, with its protocols and parameters. Is that possible?
Emulator doesn't give you the option of setting that things. I have developed a toy app for showing network parameters and the only way I found was using a real phone.
By the way, not all phones implement all methods of Android's API, so you will find that some parameters will not be shown. And also many parameters are not available from API and you will need to get them throw AT commands (you will need a rooted device)
Note: I realize this question is two years old, but since this question received a slight edit from its original author 5 minutes ago and so got bumped back up to the front of the site, I am assuming that he may still be looking for an answer.
Yes, AT&T provides such a free tool to simulate and analyze different network conditions to a certain extent. And it can be used in conjunction with Eclipse ADT, Android Studio, or something else entirely. So it's not tied to any particular IDE.
http://developer.att.com/application-resource-optimizer
That being said, I have no idea if it will give you any cell tower related meta data.

Get mobile cell tower timing advance on Android 2.3

I need to get the mobile cell tower timing advance.
Is it possible on Android 2.3+ ?
[edit]
It seems that it's not possible to retreive the timing advance...
Is it possible to know the distance between the mobile and the cell and the bearing otherwise ? I suppose I can't use the Google hidden geolocation api in commercial application ;-)
[/edit]
Thanks
For LTE technology there is already an access to Timing Advance values: see http://developer.android.com/reference/android/telephony/CellSignalStrengthLte.html#getTimingAdvance()
This is currently not implemented, and it will be a hard task because it is device-dependent.
The actual timing advance is only known by the modem, also called the baseband processor (BP). The modem is coded by the device's constructor and thus cannot be modified, and can differ between constructors and devices.
Android runs on the application processor (AP) and uses AT commands to communicate with the BP (modem). For example, Android internally sends AT commands to the modem to send SMS, receive calls, ...
The only way to get the actual timing advance would be to query the BP (with an AT command), but whether the constructors implement a specific AT command to get it is up to them. Unfortunately almost no devices implement it (only very old ones), so there is no way to get this information.
I don't think it's a good idea to use timing advance for geolocation, since it is only relevant on GSM networks. Once the device hands over to UMTS networks, no more timing advance.
Why not use http://developer.android.com/guide/topics/location/obtaining-user-location.html ?
If you need Antenna location you don't need Timing Advance. Then you need LAC, CID etc. which are all part of the public AOS API, and then you can query some public database for the location of these. There are dozens of Android apps that already does this. Perhaps even as an example app for Android developers. Google it.
However, GSM Timing Advance (TA) knowledge is definitely still of interest for several other reasons. So if someone know how to extract this info from the Android vendor RIL, please let us know.

Categories

Resources