Hi was going to use Geofire for this but as its not compatiable with the latest version of Firebase yet I will hold off using it for now.
I have a simple database entry that looks like this...
author: "Aidan Mack"
lat: 58.9551641
long: -1.1091357
title: "hello"
userID: "userid"
I want to send a lat/long and distance radius and get back db entrys like the above within the given radius... any ideas how I would go about it with out using geofire?
Thanks
Aidan
Related
I have such information for saving to ES in my json:
{
"geolocation": {
"latitude": 50.443278299999996,
"longitude": 30.5075698,
"accuracy": 3966
}
}
geolocation in my Java object is GeoPoint (private GeoPoint geolocation). How I can pass an accuracy to GeoPoint? Or maybe there is another type for saving location with lat, lon and accuracy?
P.S. For parsing I use:
public GenericResponse<?> addUserInfo(#RequestBody UserInformation userInformation) {
}
And geolocation is one of the fields in UserInformation class.
I believe you are missing something. Accuracy or distance, it's something that you specify when querying, not when saving something. For example:
You have one entry in your elasticsearch. This entry has a geo_point field that includes lat and lon.
When you search for this profile you have a geo point, which represents a location and you want, based on this location (let's name it query location) to find all entries in elasticsearch that have a distance of X meters from you.
Basically there is no distance/accuracy to save. Given a geo query, elasticsearch will calculate the distance between these two points and it will check if it is smaller than the distance/accuracy you provided (during query), if it is, it will include the entry.
I am new to Firebase Database, I am making an android app in which the structure of the data is like this :
{
posts={
-Ks4AoL7F-oKtwd3M8Ao={
address=Address of mine,
title=Title ,
subcategory=E-waste, category=Garbage,
time=21-08-2017 07:54 p.m.,
mobileNumber=some mobile number,
comment=hhdhdehsbsbhs,
statusText=Pending,
imagePath=https://firebasestorage.googleapis.com/v0/b/path-to-image
},...
}
So in this structure i want to query the posts on the basis of the mobile number i.e., if the mobile number matches than the current post will be retrieved else skip this post and check for next post and so on...
you can get all the list of data from post object with the help of simple queries which you can find in documentation part of firebase, where you can check for each object's mobile no, accordingly apply the conditions to keep or discard the object.
for more info please look into the link:-
sample to retrieve the data from firebase
You can refer this post and
This
From this following sensor:
http://www.banggood.com/A17-Realtag-BLE-Sensor-Wearable-CC2541-MPU6050-BMP180-iBeacon-p-954754.html
How do you get the temperature from the sensor using Android via bluetooth on its advertisement data?
In the advertisement data, look for parameters 0xFFA0 -> 0xFFB6 and 0xFFA0 -> 0xFFB7 which contain raw sensor data for MPU6050 and BMP180 respectively. Temperature data can be extracted from any of those values. Refer this link for details.
I have an app, In this signIn through the dropbox and after the signIn I got the vale of below I declared:
DropboxAPI<AndroidAuthSession> mDBApi;
What I want is :
I want to use this value(get this value) after my Phone Reboot.
Or
I want to store this Value Permanent.
For better understand have a look on this Link : DROPBOX_REFERENCE_LINK
For this WHAT I tried :
I did static but it's working fine till Phone is Switch on. Does not mean !
Use SharedPrefrence but I have to put this value into the String but In the time of typeCast , I am not able to convert this String value into the DropboxAPI Generic Type.
LIKE :
String s = mDBApi_From_Prefrence;
DropboxAPI<AndroidAuthSession> mDBApi = `TypeCast From String s to DropboxAPI<AndroidAuthSession>`
What Should I do store this mBDApi value PERMANENT ?
You can store this value to a SQLite Database as a BLOB type and fetch it again. Databases remain persistent for the app even after reboot.
Here - > https://maps.google.com/
I queried for parameters
A : antim chauraha, Indore, Madhya Pradesh, India
B : India Collection, Indore, Madhya Pradesh, India
And using the webservice to get as XML, same response from Direction API
http://maps.googleapis.com/maps/api/directions/xml?origin=ANTIM%20CHAURAHA,Indore,Madhya%20Pradesh,India&destination=INDIA%20COLLECTION,PALSIKAR,Indore,Madhya%20Pradesh,India&sensor=false
Those responses do not match at all. You see the distance, direction or anything.
Am I doing something wrong?
Google Maps uses additional information to locate your "query string". The directions API uses postal addresses (for the most part).
Neither of these looks like a particularly good "address"
A : antim chauraha, Indore, Madhya Pradesh, India
B : India Collection, Indore, Madhya Pradesh, India
Run them through the Google Maps API v3 geocoder, they both resolve to the same place (Indore, Madhya Pradesh, India)
If you need to resolve "places" like that, use the Places API to get coordinates, then use the directions service to get directions between the coordinates.
Basically there is a difference in name and address. Google database can have other symbols for the same location. You can read my answer here: http://www.stackoverflow.com/questions/12788664/google-maps-api-geocode-returns-different-co-ordinates-then-google-maps/12790012#12790012. In the google response the name is what you are looking for and in the placemark object the list of address and location in the google database. You need to loop through the placemark object to find the most similar location.