Facebook Friends Mapper Android |link| May 2026
private void showFriendDetailsDialog(FriendLocation friend) { new AlertDialog.Builder(this) .setTitle(friend.name) .setMessage("Location: " + friend.location + "\n" + "Coordinates: " + friend.latitude + ", " + friend.longitude) .setPositiveButton("Close", null) .setNeutralButton("Show on Map", (dialog, which) -> { LatLng position = new LatLng(friend.latitude, friend.longitude); googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(position, 12)); }) .show(); }
private void filterFriendsByName() { String query = searchFilter.getText().toString().toLowerCase(); if (query.isEmpty()) { // Show all markers for (FriendLocation friend : allFriends) { addMarkerToMap(friend); } } else { // Clear all markers googleMap.clear(); friendMarkers.clear(); // Add only matching friends for (FriendLocation friend : allFriends) { if (friend.name.toLowerCase().contains(query)) { addMarkerToMap(friend); } } Toast.makeText(this, "Showing " + friendMarkers.size() + " matching friends", Toast.LENGTH_SHORT).show(); } } facebook friends mapper android
</LinearLayout> </androidx.cardview.widget.CardView> " + friend.longitude) .setPositiveButton("Close"
private void setupMap() { SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(this); } null) .setNeutralButton("Show on Map"
private Map<String, FriendLocation> friendMarkers = new HashMap<>(); private List<FriendLocation> allFriends = new ArrayList<>();
private void fetchFriendLocation(String friendId, String friendName) { GraphRequest request = GraphRequest.newGraphPathRequest( AccessToken.getCurrentAccessToken(), friendId, response -> { try { JSONObject friendData = response.getJSONObject(); if (friendData.has("location")) { JSONObject location = friendData.getJSONObject("location"); String locationName = location.getString("name"); // Geocode location name to coordinates geocodeLocation(locationName, friendName); } } catch (Exception e) { // No location available for this friend } } ); Bundle params = new Bundle(); params.putString("fields", "location"); request.setParameters(params); request.executeAsync(); }