Using Google Places Web Service in an Android app - android

All of the Android APIs for Google Place searches return predictions, and these are not as accurate or as complete as the Place Search web service. Though predictions usually deliver the desired place, I've bumped into scenarios where they don't. I want to use the Android API as a primary search tool, but offer the user a search button that delivers more complete results (like those returned by the web service).
I've validated that I have a working web api-key with this url:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=47.725977,-122.047113&keyword=home%20depot&rankBy=distance&key=my-key
In a test app, I called this exact url using HttpURLConnection, and I also use an app-specific API key to validate that I can use GoogleApiClient to to get location information (lattitude and longitude). Here's a screen shot of the result:
I've been unable to successfully call a Google Place web service from my app, regardless of keys I provide (including an Unrestricted key). Google doesn't seem to want us to use web services from an app, though there are a couple of StackOverflow questions that imply it's possible.
My questions are (1) is it technically feasible to call Google Places WS from an app, and (2) if not, is there an alternative in the Android API that I'm overlooking that would achieve the detailed search results I need?

Related

Google Authenticator - User Registration withOUT Mobile App

We are developing Native Mobile Application : Android platform, Ios Platform (Swift).
Instead of asking user to download and install https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en_IN mobile app and then generate a QR code in our application to be scanned by this app, we are willing to do it api way. Means We want to call Google Authenticator API pass it QR image, secret and user is registered
Is this Ok and possible. Any one using it please suggest.
I'm not going to say that this is impossible, but integrating Google Authenticator would be a nightmare, and likely wouldn't do what you're expecting it to do. Allow me to explain.
Problem #1
For each instance of the app, you'll have to have a Unique Identifier to pair it to Google's Authenticator. In other words, you'll need to generate a new QR code for each device, pass that off to the system (Which doesn't exist without the app.) to pair the application. This is going to require a "Log-In" to properly store.
Check out this for a possible work-around to Problem #1: https://authenticatorapi.com/
Problem #2
If you're already logging in and the device is already being authenticated, what purpose does the Google Authenticator provide? Well, I'm assuming it allows you to prevent unauthorized access, possibly prevent more than one device. There are infinitely easier ways to manage this, location services are the first one that comes to mind for me.
Possible Solution (iOS)
This is absolutely my go-to method for handling authentication. Encourage or require your users to use 2FA (Two Factor Authentication) attached to SMS messaging. A simple line of code such as this will grab an SMS one-time code.
// Available as of iOS 12, make sure to check version.
self.verifyCodeTextField.textContentType = .oneTimeCode
Android SMS Retrieval
Android Auto-SMS-Retrieval https://developers.google.com/identity/sms-retriever/overview
I don't know it all, most certainly, but I hope this opens the floor for some discussion and brings forth a solution or explanation to your question.
Research Material
Google Authenticator available as a public service?
java API for google Authenticator

Safely Using a Browser Key for Google Places API Web Service on Android

I've been using the Google Places API for Android Autocomplete Widget by embedding the PlaceAutocompleteFragment into my activity. This works alright, but has several drawbacks for my implementation stemming from the widget's performance and the lack of the radius filter that is available in the full Google Places API Web Service.
I'd like to start moving off the Google Places API for Android and use the Google Places API Web Service instead to get access to the broader filtering options. However, the documentation states the following:
Note: The Google Places API Web Service does not work with an Android or iOS restricted API key.
This means, I assume, that I have to use either a Browser or Server restricted API Key in my application, but on Android, I understand these options to be less than ideal because it becomes possible to steal the API key.
How can I safely use a Browser API Key within my Android application?
The web service is supposed to be called from your backend server. The API keys for web services support IP address restriction. So, in order to protect an API key that you are going to use with web service requests you should create an intermediate server that will send requests to Google and pass responses back to your Android app. To protect an API key you should use an IP address of your intermediate server.

Google Place Search for Android using a radius

I'm currently getting nearby businesses according to a radius around a given position as well as the type of business using the Google WebApp, as shown here: https://developers.google.com/places/web-service/
However, I noticed this on Google documentation :
The Google Places API Web Service is for use in server applications. If you're building a client-side application, take a look at the Google Places API for Android and the Places Library in the Google Maps JavaScript API.
So, I tried to find an equivalent method using only the Android Api, without result. I know my question is a bit borderline, but what should I use in Android? Or is it okay to keep going with the Web Service?
Thank you,
Q
You can actually integrate Web service with Android. Here is a code sample that could help you do this.
The concept of Android web service is that you can store the response from the web service request in a json file then you can manipulate the file programmatically then use the data into your android application, but not restricted to it.
The Sample and Demo u refer as WebService is an Example of Google Places API [Nearby Search Requests]. That one way using the Places API u can search for Places.
Don't get confused Google Places API Web Service is a service that returns information about places and using the APIs u can access the Places data. Well here is the link that will help u to understand it better.

What is the best way to get all photos from a facebook page including the comments and likes using facebook sdk in android?

using the graph API, I can very well make a query like this :
{facebook-page-id}/photos?type=uploaded
This question has to be more on the theoretical side.
I'm working on an android application that has to show the images(uploaded photos) from a particular facebook page. Now, I can access all the pictures using the graph API and the queries.
My question is regarding the feasibility of this approach. Do I have any other method that is better than this, given the limit that facebook puts on requests generating from a single device with a single token.
Although Graph API can easily do that, is there any other approach to it ?
Your only option (on any platform) will be to use Graph API.
What you are describing sounds like a form of page management app, which is not necessarily something that makes a lot of sense on a mobile device. The reason is that the number of requests required to fetch the information you are requesting can easily become enormous.
When doing this in a web application, you can leverage a web server's virtually infinite storage capacity and bandwidth (compared to a mobile device), and you can even reduce the amount of Graph API requests by implementing RTUs. The latter is impossible on a mobile device, as you need a live web endpoint capable of receiving RTU callbacks from Facebook.

Get location of other people in Google Maps

I'm developing an Android app that tracks a number of people through GPS with their legal consents.
For some reason, I can't seem to find any related topics in Google or maybe I just can't construct the right words.
Google Maps and others are already setup. I only need the approximated LatLngs and some basic infos from those people in-track.
Where do I start? or any recommended links?
If you're tracking multiple people with their consent, then I'm assuming that your app is running for each of the users on their individual device(s). If that's the case, use the Android geolocation API to get the device's LatLong and publish it to a backend on the cloud periodically (say every minute or so to avoid too many writes to the backend). You can use a key/value storage to store the coordinates, where the keys are the user identifiers, and the value is the last lat/long (I'd also suggest storing a timestamp for the last update to allow for identifying stale data).
You can then query/subscribe to the backend to retrieve the last lat/long of (a) specific user(s), and then use it to create a custom marker on the GMap API.
We're working on a platform that uses a similar logic but for a different use-case, calculating proximity to specific locations and providing actions based on the proximity.
I hope this helps. We're using Ionic/Angular for our build platform so we're using PhoneGap API's to access the GeoLocation services of the device.
As far as I know you can do below things,
If the two uses have the same application, they should push their location (obtained from the Cell ID or GPS) to a Web Server (which you will handle). You can then exchange the location coordinates using your web-service.
For reference, have a look at this link :
http://msdn.microsoft.com/en-us/library/ms980225.aspx#v35go_topic2
Another the thing which I want to recommend you why don't you try to do this using google+ apis. Little googling will help you.

Categories

Resources