Searching stores in a city

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Searching stores in a city

Postby dengra23 » Mon Jan 14, 2008 12:15 pm

Hello everybody, I'd like to develop an application to search 'commerces' like in Google Maps but i have no ideas about the methods to use and format of the response. Please I need your help! :roll:
I'm sorry for my poor English.
dengra23
Freshman
Freshman
 
Posts: 5
Joined: Mon Nov 19, 2007 6:46 pm

Top

Postby plusminus » Mon Jan 14, 2008 6:25 pm

Hello dengra,

you do it like this (found at davanum.wordpress.com):
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.             // ...
  2.             // Create a MapPoint from the map's coordinates
  3.             MapPoint mapPoint = new MapPoint(mMapView.getMapCenter().getLatitudeE6(),
  4.                     mMapView.getMapCenter().getLongitudeE6());
  5.             // Create a dummy Map for use in Search
  6.             Map map = new Map(getDispatcher(), null, 0, 0, 0, mapPoint,
  7.                     Zoom.getZoom(mMapView.getZoomLevel()), 0);
  8.             // Search for Pizza near the specified coordinates
  9.             Search search = new Search("Pizza", map, 0);
  10.             // add the request the dispatcher
  11.             getDispatcher().addDataRequest(search);
  12.             // Wait for the search to complete, Should do this
  13.             // in another thread ideally, this is just for illustration here.
  14.             while (!search.isComplete()) {
  15.                 Log.i(LOG_TAG, ".");
  16.             }
  17.             // ...
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Thanks

Postby dengra23 » Mon Jan 14, 2008 10:59 pm

Thanks so much plusminus, I'll tell you how it is going. Congratulations for the web, I think is the best I've visited about Android. Thanks again.
dengra23
Freshman
Freshman
 
Posts: 5
Joined: Mon Nov 19, 2007 6:46 pm

Postby plusminus » Mon Jan 14, 2008 11:07 pm

:) Feel free to contribute a final solution, so others can learn form it.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Log INFO

Postby dengra23 » Mon Jan 28, 2008 11:33 pm

Hello everybody again, Can anybody help me? I need to know how to manipulate/manage the INFO of de object Log when I search... sth like this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. while (!mSearch.isComplete()) {
  2.  
  3.                     Log.i(LOG_TAG, ".");
  4.  
  5.                 }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


or

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. NotificationManager nm = (NotificationManager)
  2.  
  3.                         getSystemService(NOTIFICATION_SERVICE);
  4.  
  5.                 nm.notifyWithText(999,
  6.  
  7.                         miBusqueda.getPlacemark(item).getDetailsDescriptor(),
  8.  
  9.                         NotificationManager.LENGTH_LONG, null);
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


I don't understand how to show the results of my search. Thanks !!! I'd like to show the info in order...
dengra23
Freshman
Freshman
 
Posts: 5
Joined: Mon Nov 19, 2007 6:46 pm

Postby plusminus » Tue Jan 29, 2008 1:02 am

Hello dengra,

something like this:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.             // Print the details.
  2.  
  3.             Log.i(LOG_TAG, "Done - " + search.numPlacemarks());
  4.  
  5.  
  6.  
  7.             for (int i = 0; i < search.numPlacemarks(); i++) {
  8.  
  9.                 Placemark placemark = search.getPlacemark(i);
  10.  
  11.  
  12.  
  13.                 Log.i(LOG_TAG, " - i : " + Integer.toString(i));
  14.  
  15.                 Log.i(LOG_TAG, "- Bubble : " + placemark.getBubbleDescriptor());
  16.  
  17.                 Log.i(LOG_TAG, "- Detail : " + placemark.getDetailsDescriptor());
  18.  
  19.                 Log.i(LOG_TAG, "- Title : " + placemark.getTitle());
  20.  
  21.                 Log.i(LOG_TAG, "- Location : " + placemark.getLocation().toString());
  22.  
  23.                 Log.i(LOG_TAG, "- routable : " + placemark.routableString());
  24.  
  25.             }
Parsed in 0.038 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

hi....

Postby gunaztar » Tue Mar 11, 2008 7:22 am

Hi plusminus..,
whether now in m5, placemark is available or not...
I am getting error in the import itself for placemark class...
Any other thing for getting latitude and longitude from a location place name..
Thanks.......
gunaztar
Junior Developer
Junior Developer
 
Posts: 18
Joined: Wed Feb 20, 2008 12:40 pm

Postby res » Sat Mar 15, 2008 10:58 pm

m5 SDK has many changes from m3 with one of them being Placemarks, Geocoder is what you need to use in m5 onwards
http://code.google.com/android/referenc ... coder.html
res
Senior Developer
Senior Developer
 
Posts: 146
Joined: Tue Nov 20, 2007 8:14 pm
Location: United States

Postby com2usprav » Tue Apr 22, 2008 8:49 am

I want to Know How the GeoCoder API works in M5 SDK . Can any one Post A tutorial On Geocoder API for M5 SDK

regards
Pravin
User avatar
com2usprav
Developer
Developer
 
Posts: 26
Joined: Sat Mar 29, 2008 3:28 pm
Location: Bangalore

Top

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests