2014년 12월 12일 금요일

Re: Location question

if you  don't understand me its because of my english knowlegde i dont' come from england or other english speaking counties



App Inventor can figure out where it is by using the LocationSensor.   If you program the information about Berlin, the app can find what you programmed.  Look at this demonstration called Map Tour   http://www.appinventor.org/Chapter6   , it may contain the information you require. and you can link that to information from the LocationSensor coordinates

You could also use the LocationSensor in conjunction with a Web search.   AI2's ActivityStarter can do a Web search,   search on  LocationSensor.CurrentAddress.
To do the web search, you would do something like this:

Launch a Web search

To launch a Web search for a particular query, such as "Homer Simpson", use an activity starter with these properties:
Action: android.intent.action.WEB_SEARCH 
ExtraKey: query 
ExtraValue: Homer Simpson 
ActivityPackage: com.google.android.providers.enhancedgooglesearch 
ActivityClass: com.google.android.providers.enhancedgooglesearch.Launcher

Where the LocationSensor.CurrentAddress   replaces Homer Simpson


Also you can    also

Show a map for a location

If you know the latitude and a longitude of a location, you can show a map using an activity starter with these properties to show a map of the area:
Action: android.intent.action.VIEW 
DataUri: geo:37.8,-122.23?z=23
The format of the DataURI is specific to the app. In this example, the URI specifies a z (zoom) of 23, which is the largest zoom value. Zoom value is optional and ranges from 1 (the entire Earth) to 23.
If you know the zip code, you can set the activity starter properties as follows:
Action: android.intent.action.VIEW 
DataUri: geo:0,0&q=94043
If you have a street address, you can use a DataUri that encodes the address with a scheme called URL encoding :
Action: android.intent.action.VIEW 
DataUri: geo:0,0&q=5000% 20MacArthurBlvd%20Oakland%2CCA
Generally in URI encoding the only characters you have to replace are space

with the ActivityStarter.

There are other things you can do using the Google Business Maps API  .

What have you tried?


댓글 없음:

댓글 쓰기