Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

probleme au geocodage

Featured Replies

Posté(e)

bonjour tout le monde,j'ai cree une application android qui est en faite la geolocalisation. j'ai un probleme au geocodage ,en faite j'ai cree un bouton de recherche lorsque l'utilisateur saisi un endroit dans un editText et appuie sur ce bouton le resultat sera la position de cet endroid dans le map , bref voici mon code et j'espere que vous m'aidiez.:

RechercheListener=new View.onclickListener() {

public void onclick(View v) {

String a=Recherche1.getText().toString();

MotionEvent event;

String staddress = a;

ProgressDialog dialog ;

/* dialog = ProgressDialog.show(MenuActivity.this, "",

"la valeur de a est: "+a, true);*/

try {

List<Address> loc = geocoder.getFromLocationName(staddress, 5);

dialog = ProgressDialog.show(MenuActivity.this, "",

"size est : "+loc.size(), true);

if (loc.size()==0) {

Toast.makeText(MenuActivity.this,

"Dsl, Saisir Un Endroit.",Toast.LENGTH_LONG).show();

/*ProgressDialog dialog

dialog = ProgressDialog.show(MenuActivity.this, "",

"Loading. Please wait...", true);*/

}

else if (loc.size()>0) {

// Address addr = loc.get(0);

// ((Address) loc).setLatitude(addr.getLatitude());

// ((Address) loc).setLongitude(addr.getLongitude());

Geocoder gc = new Geocoder(context);

//ProgressDialog dialog ;

dialog = ProgressDialog.show(MenuActivity.this, "",

"Loading. Please wait...", true);

//if(gc.isPresent()){

List<Address> list = gc.getFromLocationName(a, 1);

Address address = list.get(0);

double lat = address.getLatitude();

double lng = address.getLongitude();

// ProgressDialog dialog ;

Toast.makeText(getBaseContext(),"Latitude = " + lat + " Longitude = " + lng, Toast.LENGTH_SHORT).show();

Intent intent = new Intent(MenuActivity.this, GoogleMapActivity.class);

intent.putExtra("longitude", lng);

intent.putExtra("latitude", lat);

startActivity(intent);

}

}

// }

catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

};

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.