I am new to google apis and iphone LBS related apps. I need to know how to use a google api and get the list of hotels around my GPS location.
Here the same functionality is achieved through javascript. how to do this on iphone application ?
http://code.google.com/apis/ajax/playground/#localsearch_with_markers
Did you try - http://code.google.com/apis/maps/documentation/places/#PlaceSearches ?
It looks like a normal webservice, you can just post a request and it should give you an XML / JSON list of all the hotels around you ..
From the website -
Request = http://maps.google.com/maps/api/place/search/json?location=40.717859,-73.957790&radius=1600&client=clientId&sensor=true_or_false&signature=SIGNATURE
Response =
{
"status": "OK",
"results": [ {
"name": "Williamsburg",
"types": [ "locality", "political" ],
"icon": "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
"reference": "ClRBAAAAXP...lHAPyHom2aG"
}, {
"name": "Greenpoint",
"vicinity": "New York",
"types": [ "neighborhood", "political" ],
"icon": "http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
"reference": "CkQ_AAAAhd...MF45fwr44Ek"
}, {
"name": "Peter Luger Steakhouse",
"vicinity": "Broadway, Brooklyn",
"types": [ "restaurant", "food", "establishment" ],
"icon": "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"reference": "ClRCAAAAt3...6Nt7k11iQdT"
}, {
"name": "Music Hall of Williamsburg",
"vicinity": "North 6th Street, Brooklyn",
"types": [ "establishment" ],
"icon": "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"reference": "ClRFAAAAN...6UOKCbjv7Sxy"
},
...additional results ...
],
"html_attributions": [ ]
}
Related
I am trying to display the custom modes in my google home app. But the mode are not displaying.
Below are the traits which are used in the sync intent.
{
"response": {
"requestId": "3824625397483970421",
"payload": {
"agentUserId": "be855ca8-7be8-4e4c",
"devices": [
{
"id": "device--92ada020-074a-11ed",
"type": [
"action.devices.types.VACUUM"
],
"traits": [
"action.devices.traits.StartStop",
"action.devices.traits.Modes"
],
"name": {
"defaultNames": [
"Vacuum Cleaner 2"
],
"name": "Vacuum Cleaner 2",
"nicknames": [
"Vacuum Cleaner 2"
]
},
"willReportState": true,
"roomHint": "",
"structureHint": "",
"attributes": {
"availableModes": [
{
"name": "suction",
"name_values": [
{
"name_synonym": [
"suction"
],
"lang": "en"
}
],
"settings": [
{
"setting_name": "Storm",
"setting_values": [
{
"setting_synonym": [
"Storm"
],
"lang": "en"
}
]
},
{
"setting_name": "Gust",
"setting_values": [
{
"setting_synonym": [
"Gust"
],
"lang": "en"
}
]
},
{
"setting_name": "Breeze",
"setting_values": [
{
"setting_synonym": [
"Breeze"
],
"lang": "en"
}
]
},
{
"setting_name": "Eco",
"setting_values": [
{
"setting_synonym": [
"Eco"
],
"lang": "en"
}
]
}
],
"ordered": false
}
]
},
"otherDeviceIds": [
]
}
]
}
}
}
I cannot figure out what am I doing wrong. I read the documentation but looks fine to me but still it not displaying in the google home app
Our teams are constantly working to improve Google Home App and the controls available in the UI. Right now for certain traits the touch controls are not available in the UI. For these controls you can always initiate them through voice.
Your Sync response looks right for Vacuum . If you need touch controls for modes on a vacuum device on Google Home App, you can create a feature request in Public Issue Tracker. This will help us with the prioritization in our roadmap.
What I have observed is there is a difference in terms of touch controls modes that are not available in google smart home app but can be controlled via the voice commands. Modes can only be displayed for now in the nest display.
Reference
https://developers.google.com/assistant/smarthome/develop/touch-controls
I am trying to get the distance matrix for my desired locations. As mentioned in the OSRM-Table Service docs, I have tried modifying the same as http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219&annotations=distance.
Response is showing error as:
{
"message": "Coordinate is invalid: 13.397634,52.529407&annotations=distance,duration",
"code": "InvalidInput"
}
but, when I run it without annotations, then I am able to get the proper response.
{
"durations": [
[
0,
723.9,
711
],
[
419.8,
0,
541.6
],
[
565,
416,
0
]
],
"destinations": [
{
"hint": "g5HFiBCSxYgiAAAA6gIAAAAAAAAAAAAASjFaQU1xpUEAAAAAAAAAACIAAADqAgAAAAAAAAAAAADppQAA_kvMAKlYIQM8TMwArVghAwAA7wqVP7a9",
"distance": 4.231665624816857,
"name": "Friedrichstraße",
"location": [
13.388798,
52.517033
]
},
{
"hint": "0BgegNQVzIgMAAAADAAAAAAAAAACAQAAW7-PQOKcyEAAAAAApq6DQgwAAAAMAAAAAAAAAIoAAADppQAAf27MABiJIQOCbswA_4ghAwAAXwWVP7a9",
"distance": 2.7893928415656375,
"name": "Torstraße",
"location": [
13.397631,
52.529432
]
},
{
"hint": "xRcegP___38kAAAAyAAAAC0AAABKAAAAsowKQkpQX0Lx6yZCvsQGQiQAAABkAAAALQAAACUAAADppQAASufMAOdwIQNL58wA03AhAwMAvxCVP7a9",
"distance": 2.2265954222656257,
"name": "Platz der Vereinten Nationen",
"location": [
13.428554,
52.523239
]
}
],
"sources": [
{
"hint": "g5HFiBCSxYgiAAAA6gIAAAAAAAAAAAAASjFaQU1xpUEAAAAAAAAAACIAAADqAgAAAAAAAAAAAADppQAA_kvMAKlYIQM8TMwArVghAwAA7wqVP7a9",
"distance": 4.231665624816857,
"name": "Friedrichstraße",
"location": [
13.388798,
52.517033
]
},
{
"hint": "0BgegNQVzIgMAAAADAAAAAAAAAACAQAAW7-PQOKcyEAAAAAApq6DQgwAAAAMAAAAAAAAAIoAAADppQAAf27MABiJIQOCbswA_4ghAwAAXwWVP7a9",
"distance": 2.7893928415656375,
"name": "Torstraße",
"location": [
13.397631,
52.529432
]
},
{
"hint": "xRcegP___38kAAAAyAAAAC0AAABKAAAAsowKQkpQX0Lx6yZCvsQGQiQAAABkAAAALQAAACUAAADppQAASufMAOdwIQNL58wA03AhAwMAvxCVP7a9",
"distance": 2.2265954222656257,
"name": "Platz der Vereinten Nationen",
"location": [
13.428554,
52.523239
]
}
],
"code": "Ok"
}
The problem here is I don't have distance matrix in it. Can anyone please suggest the cause or how to solve it?
It seems there is currently a problem with the osrm demo service. Check the issues below:
OSRM Github issue #5541
OSRM Github issue #5517
Request
"https://www.googleapis.com/adsense/v1.4/accounts/pub-XXXXXXXXXXXXX/reports?endDate=2019-01-01&startDate=2014-01-01&dimension=APP_ID&metric=INDIVIDUAL_AD_IMPRESSIONS&fields=headers%2C%20rows
Response
{ "headers": [ { "name": "APP_ID", "type": "DIMENSION" }, { "name": "APP_NAME", "type": "DIMENSION" }, { "name": "INDIVIDUAL_AD_IMPRESSIONS", "type": "METRIC_TALLY" } ], "rows": [ [ "0:", "abcdAndroidDemo_P1V1", "375" ], [ "0:", "abcdDemo", "13" ], [ "0:", "abcdiOSDemo", "34" ] ] }
How to get the APP_IDs of all the apps of publisher?
I am getting APP_ID after publishing the app in the app store.
I am working on mongoDB with Laravel using jenssegers . and i am trying to get
documents on sorting based on layout.price.
Is this possible in mongodb with laravel. ?
I am using limit and skip for pagination , so i have to get orderBy or sort direct from Database.
[{
"title": "I am first document",
"design": "mango",
"description": "Loremipsum",
"dimension": [
{
"id": "542549383d1784901000002c"
}
],
"layout": [
{
"id": "542411813d17849810000029",
"price": NumberInt(69000)
}, {
"id": "542411813d17849810000030",
"price": NumberInt(2000)
}
],
"images": [
"uploads/sofa/QRSTU695a6_0.png"
],
"product_type": NumberInt(1),
"updated_at": ISODate("2014-10-08T08:47:26.0Z"),
"created_at": ISODate("2014-09-29T11:13:52.0Z")
},
{
"title": "I am second document",
"design": "mango2",
"description": "Loremipsum",
"dimension": [
{
"id": "542549383d1784901000002d"
}
],
"layout": [
{
"id": "542411813d17849810000031",
"price": NumberInt(80000)
}, {
"id": "542411813d17849810000032",
"price": NumberInt(27000)
}
],
"images": [
"uploads/sofa/QRSTU695a6_0.png"
],
"product_type": NumberInt(1),
"updated_at": ISODate("2014-10-08T08:47:26.0Z"),
"created_at": ISODate("2014-09-29T11:13:52.0Z")
}]
I'm currently using json-framework and need some help though parsing some JSON i'm getting from my server. Here is how the JSON looks:
Like I said I already have the json-framework installed but I can't figure out how to actually parse it. Can someone please show me? Thanks!
[
{
"id":"0",
"name":"name",
"info":"This is info",
"tags":
[
{
"id":"36",
"tag":"test tag",
},
{
"id":"37",
"tag":" tag 2",
}
],
"other":"nil"
},
{
"id":"1",
"name":"name",
"info":"This is info",
"tags":
[
{
"id":"36",
"tag":"test tag",
},
{
"id":"37",
"tag":" tag 2",
}
],
"other":"nil"
}
]
jsonlint.com will help you as far as validation, I don't believe you want the trailing commas. json-framework implements a strict parser.
[
{
"id": "0",
"name": "name",
"info": "This is info",
"tags": [
{
"id": "36",
"tag": "test tag"
},
{
"id": "37",
"tag": " tag 2"
}
],
"other": "nil"
},
{
"id": "1",
"name": "name",
"info": "This is info",
"tags": [
{
"id": "36",
"tag": "test tag"
},
{
"id": "37",
"tag": " tag 2"
}
],
"other": "nil"
}
]
Have a look at the Examples.m file in your json-framework download. Also available here.
The API is available here.
You will probably end up using the NSString and NSObject categories when doing your parsing.