Java 类com.parse.ParseGeoPoint 实例源码

项目:ActivityMapper    文件:LocationManager.java   
public void onLocationEvent(Location location) {
    if (location.getAccuracy() < LOCATION_ACCURACY_THRESHOLD) {
        if (_locationCache.size() == 10) {
            _locationCache.remove(0);
        }
        _locationCache.add(location);

        if (isActive()) {
            Record record = new Record();
            int lastDetectedActivity = getLastDetectedActivityType();
            if (lastDetectedActivity == ON_FOOT) {
                lastDetectedActivity = WALKING;
            }
            record.setActivityType(lastDetectedActivity);
            record.setUser(ParseUser.getCurrentUser());
            record.setLocation(new ParseGeoPoint(location.getLatitude(),
                                                 location.getLongitude()));
            Account.get()
                   .addRecord(record);
        }
    }
}
项目:libertacao-android    文件:ParserDtoManager.java   
public static Event getEventFromParseObject(@NonNull ParseObject parseObject){
    ParseGeoPoint location = parseObject.getParseGeoPoint(Event.LOCATION);
    ParseFile parseFile = parseObject.getParseFile(Event.IMAGE);
    return new Event(parseObject.getObjectId(),
            parseObject.getString(Event.TITLE),
            parseObject.getString(Event.DESCRIPTION),
            location != null? location.getLatitude() : Event.INVALID_LOCATION,
            location != null? location.getLongitude() : Event.INVALID_LOCATION,
            parseObject.getString(Event.LOCATION_SUMMARY),
            parseObject.getString(Event.LOCATION_DESCRIPTION),
            parseFile != null? parseFile.getUrl() : null,
            parseObject.getDate(Event.INITIAL_DATE),
            // If end date is null, set it as initial date, so we can use it in our order by
            parseObject.getDate(Event.END_DATE) != null? parseObject.getDate(Event.END_DATE) : parseObject.getDate(Event.INITIAL_DATE),
            parseObject.getInt(Event.TYPE),
            parseObject.getBoolean(Event.ENABLED),
            (parseObject.getNumber(Event.GOING) != null)? parseObject.getNumber(Event.GOING).longValue() : 0,
            parseObject.getString(Event.LINK_URL),
            parseObject.getString(Event.LINK_TEXT),
            parseObject.getUpdatedAt()
    );
}
项目:RadarApp    文件:RoomActivity.java   
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    ParseGeoPoint userLocation = mUsers.get(position)
            .getUserDetail()
            .getLocation();

    LatLng latLng = new LatLng(userLocation.getLatitude(),
            userLocation.getLongitude());

    mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));

    Marker userMarker = mMarkers.get(mUsers.get(position).getObjectId());

    if (userMarker != null) {
        userMarker.showInfoWindow();
    }
}
项目:androidClient    文件:RestaurantAdapter.java   
public void bindRestaurantViewHolder() {
    if (restaurantHolder != null && restaurant != null) {
        activity.setTitle(restaurant.getName());

        restaurantHolder.address.setText(restaurant.getAddressLine());

        parseLocation = restaurant.getLocation();
        if (parseLocation != null) {
            LatLng deviceLoc = LocationService.pollDeviceLocation(activity);
            restaurantHolder.proximity.setText(restaurant.getDistanceFromString(new ParseGeoPoint(deviceLoc.latitude,deviceLoc.longitude)));

            LatLng resLoc = new LatLng(parseLocation.getLatitude(), parseLocation.getLongitude());
            restaurantHolder.updateMap(resLoc, restaurant.getName());
        }
    }
}
项目:androidClient    文件:QueryParameters.java   
public ParseGeoPoint getLocation(Context context) {
    // Geisel Library - Default Location
    double latitude = 32.881122;
    double longitude = -117.237631;
    LocationService userLocation;
    if (!Build.FINGERPRINT.startsWith("generic")) {
        userLocation = new LocationService(context);
        // Is user location available and are we not running in an emulator
        if (userLocation.canGetLocation()) {
            latitude = userLocation.getLatitude();
            longitude = userLocation.getLongitude();
        } else {
            userLocation.showSettingsAlert();
        }
    }
    return new ParseGeoPoint(latitude,longitude);
}
项目:MentorMe    文件:ViewProfileActivity.java   
private void populateMap() {
    final GoogleMap map = fragment.getMap();
    map.setMyLocationEnabled(false);
    fragment.getView().post(new Runnable() {
        @Override
        public void run() {
            LatLngBounds.Builder builder = new LatLngBounds.Builder();

            final ParseGeoPoint pt = user.getLocation();
            final LatLng latlng = new LatLng(pt.getLatitude(), pt
                    .getLongitude());
            map.addMarker(new MarkerOptions()
                    .icon(BitmapDescriptorFactory
                            .defaultMarker(BitmapDescriptorFactory.HUE_CYAN))
                    .position(latlng));
            builder.include(latlng);            

            map.moveCamera(CameraUpdateFactory.newLatLngZoom(latlng, 13));
        }
    });

}
项目:MentorMe    文件:MentorListActivity.java   
private void loadMentors(final ParseGeoPoint geoPoint) {
    Double distance = 50.0;
    getProgressBar().setVisibility(View.VISIBLE);
    DataService.getMentors(MentorListActivity.this, geoPoint, distance, mSkill, new FindCallback<User>() {
        @Override
        public void done(final List<User> users, ParseException e) {
            if (e == null) {
                User.saveAllUsers(users);
                DataService.getMentees(User.getUserFacebookIds(users), new Runnable() {
                    @Override
                    public void run() {
                        mentorListAdapter.addAll(User.sortedByMenteeCount(users));
                        getProgressBar().setVisibility(View.INVISIBLE);
                    }
                });
            } else {
                e.printStackTrace();
            }
            setupDrawer();
        }
    });
}
项目:Wabbit-Messenger---android-client    文件:LocationUtils.java   
public static String getDistanceFrom(ParseUser otherUser){
    //Location
    ParseGeoPoint myLocation = ParseUser.getCurrentUser().getParseGeoPoint(Enums.ParseKey.USER_LOCATION);
    ParseGeoPoint otherLocation = null;
    if(otherUser != null)
        otherLocation = otherUser.getParseGeoPoint(Enums.ParseKey.USER_LOCATION);

    //Calculate distance
    double km = 0;
    if(otherUser != null && otherLocation != null)
        km = myLocation.distanceInKilometersTo(otherLocation);
    else
        km = Math.random() * 4;
    //Update ui
    if(km < 0.5){
        int m = (int)(km * 100);
        m = Math.max(m, 10);    //10 meters at least
        return String.format("within %d m from you", m);
    }
    else{
        return String.format("within %.1f km from you", km);
    }
}
项目:Wabbit-Messenger---android-client    文件:LocationReceiver.java   
@Override
public void onReceive(Context context, Intent intent) {
    try {
        final LocationInfo locationInfo = (LocationInfo) intent.getSerializableExtra(LocationLibraryConstants.LOCATION_BROADCAST_EXTRA_LOCATIONINFO);
        ParseUser.getCurrentUser().put(Enums.ParseKey.USER_LOCATION,
                new ParseGeoPoint(locationInfo.lastLat, locationInfo.lastLong));
        Log.d("Location my", locationInfo.lastLat + " " + locationInfo.lastLong);
        ParseUser.getCurrentUser().saveInBackground();
    }
    catch (Exception e){
        Log.e("location error:", e.getMessage());
    }

    if(MainActivity.gi() != null)
        MainActivity.gi().onLocationUpdate();
}
项目:warsjawa2013-android-squared-googled-preparation    文件:ParseClient.java   
public void retrieveLocations(final Callback<List<LatLng>> locationsCallback) {
    ParseQuery<ParseObject> query = ParseQuery.getQuery("Location");
    query.findInBackground(new FindCallback<ParseObject>() {
        @Override
        public void done(List<ParseObject> parseObjects, ParseException e) {
            if (e == null) {
                ArrayList<LatLng> locations = new ArrayList<LatLng>();
                for (ParseObject object : parseObjects) {
                    ParseGeoPoint geo = object.getParseGeoPoint("geo");
                    locations.add(new LatLng(geo.getLatitude(), geo.getLongitude()));
                }
                locationsCallback.got(locations);
            }
        }
    });
}
项目:Madad_SOS    文件:NetworkLocationService.java   
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    super.onStartCommand(intent, flags, startId);

    Log.e("Network Loc Service", "Service running");
    AlarmManager am = (AlarmManager)getSystemService(Context.ALARM_SERVICE);


    Calendar timeOff9 = Calendar.getInstance();

    Intent intent2 = new Intent(this,MyReceiver.class);

    PendingIntent sender = PendingIntent.getBroadcast(this, 0, intent2,
            PendingIntent.FLAG_UPDATE_CURRENT);

    am.set(AlarmManager.RTC_WAKEUP, timeOff9.getTimeInMillis() + 55000, sender);
    ParseGeoPoint pt = new ParseGeoPoint(getLocation().getLatitude(),getLocation().getLongitude());
    ParseUser person = ParseUser.getCurrentUser();
    if(person==null)
    {
        stopSelf();
        return 0;
    }
    person.put("Geolocation",pt);
    person.saveInBackground();
    return START_STICKY;
}
项目:RadarApp    文件:ServiceLocationListener.java   
@Override
public void onLocationChanged(Location location) {
    Log.d(ServiceLocationListener.class.getSimpleName(),
            "Provider: " +location.getProvider() + "|" +
            "Lat/Lng: " + location.getLatitude() + "/" + location.getLongitude());

    if (LocalDb.getInstance() != null) {
        mCurrentUser = LocalDb.getInstance().getCurrentUser();

        UserDetail userDetail = mCurrentUser.getUserDetail();

        userDetail.setLocation(
                new ParseGeoPoint(
                        location.getLatitude(),
                        location.getLongitude()));

        userDetail.setProvider(location.getProvider());

        userDetail.setActive(true);
        try {
            userDetail.save();
        } catch (ParseException e) {
            Log.d(ServiceLocationListener.class.getSimpleName(),
                            e.getMessage());
        }
    }

}
项目:androidClient    文件:RestaurantModel.java   
public double getDistanceFrom(ParseGeoPoint location) {
    ParseGeoPoint restaurant = getParseGeoPoint("location");

    if (restaurant == null) {
        return 0.0;
    }
    return location.distanceInMilesTo(restaurant);
}
项目:MentorMe    文件:UIUtils.java   
public static void viewUserProfile(final Context context, final long userId, final ParseGeoPoint geoPoint) {
    final Intent intent = new Intent(context, ViewProfileActivity.class);
    intent.putExtra(ViewProfileActivity.USER_ID_KEY, userId);
    intent.putExtra(ViewProfileActivity.LATITUDE_KEY, geoPoint.getLatitude());
    intent.putExtra(ViewProfileActivity.LONGITUDE_KEY, geoPoint.getLongitude());
    context.startActivity(intent);
}
项目:MentorMe    文件:EditProfileLocationFragment.java   
@Override
protected void updateProfile(final User profileUser) {
    if (etAddress.getText() != null) {
        profileUser.setAddress(etAddress.getText().toString().trim());
        profileUser.setAboutMe(etAboutme.getText().toString().trim());
        Utils.geocode(getActivity(), new Utils.LocationParams(etAddress.getText().toString()), new Async.Block<Address>() {
            @Override
            public void call(final Address address) {
                if (address != null) {
                    profileUser.setLocation(new ParseGeoPoint(address.getLatitude(), address.getLongitude()));
                }
            }
        });
    }
}
项目:MentorMe    文件:DataService.java   
public static void getMentors(Context context, ParseGeoPoint geoPoint, Double distance, String skill, FindCallback<User> callback) {
    ParseQuery<User> query = User.getQuery();       
    query.whereEqualTo(User.IS_MENTOR_KEY, true);
    if(geoPoint != null) {
        query.whereWithinMiles(User.LOCATION_KEY, geoPoint, distance);
    }
    if(skill != null) {
        ArrayList<String> names = new ArrayList<String>();
        if(!skill.equals("All")){
            names.add(skill);
            query.whereContainsAll(User.MENTOR_SKILLS_KEY, names);
        }           
    }
    query.findInBackground(callback);
}
项目:MentorMe    文件:MentorListAdapter.java   
public MentorListAdapter(Context context, ParseGeoPoint geoPoint, final Persona persona, final UserDisplayMode mode) {
    super(context, 0);
    currentGeoPoint = geoPoint;
    this.persona = persona;
    this.userDisplayMode = mode;
    if (!sImageLoaderInitialized) {
        sImageLoaderInitialized = true;
        final ImageLoader imageLoader = ImageLoader.getInstance();
        imageLoader.init(ImageLoaderConfiguration.createDefault(getContext()));
    }
}
项目:Wabbit-Messenger---android-client    文件:PeopleNearbyFragment.java   
private boolean isInLocations(List<ParseObject> parseObjects) {
    if(parseObjects == null)
        return false;
    Log.d("locations", "Retrieved " + parseObjects.size() + " locations");
    boolean isReleasedAtLocation = false;
    for(ParseObject po : parseObjects){
        if(po.getBoolean(Enums.ParseKey.PLACE_RELEASED)) {
            ParseGeoPoint point = po.getParseGeoPoint(Enums.ParseKey.USER_LOCATION);
            double radius = po.getDouble(Enums.ParseKey.PLACE_RADIUS); //KM
            float[] results = new float[3];
            Location.distanceBetween(point.getLatitude(), point.getLongitude(),
                    locationInfo.lastLat, locationInfo.lastLong, results);
            Log.d("distance", Float.toString(results[0]));

            if(results[0] <= radius * 1000) {
                isReleasedAtLocation = true;
                break;
            }
        }
    }
    if(!isReleasedAtLocation) {
        showNotReleasedAtLocationDialog();
        dismissDialog();
        return false;
    }
    else
        return true;
}
项目:Wabbit-Messenger---android-client    文件:LocationUtils.java   
public static int getDistanceInMeters(ParseUser otherUser){
    //Location
    ParseGeoPoint myLocation = ParseUser.getCurrentUser().getParseGeoPoint(Enums.ParseKey.USER_LOCATION);
    ParseGeoPoint otherLocation = null;
    if(otherUser != null)
        otherLocation = otherUser.getParseGeoPoint(Enums.ParseKey.USER_LOCATION);

    //Calculate distance
    double km = 0;
    if(otherUser != null && otherLocation != null)
        km = myLocation.distanceInKilometersTo(otherLocation);
    return (int)(km * 1000);
}
项目:HereAStory-Android    文件:ParseDatabaseServiceImpl.java   
@Override
public void readAllInArea(final double latitude, final double longitude, final double maxDistance, final PointOfInterestReadHandler handler) {
    ParseGeoPoint userLocation = new ParseGeoPoint(latitude, longitude);
    ParseQuery<ParseObject> query = ParseQuery.getQuery(POI_TABLE); 
    query.whereEqualTo(DELETED, false);
    query.whereWithinKilometers(LOCATION, userLocation, maxDistance);
    query.setLimit(POINTS_AMOUNT_LOMIT);

    query.findInBackground(new FindCallback<ParseObject>() {

        @Override
        public void done(List<ParseObject> objects, ParseException e) {
            if (e == null) {
                List<PointLocation> points = new ArrayList<PointLocation>();
                for (ParseObject object : objects) {
                    points.add(getLocation(object));
                }
                handler.readAllInAreaCompleted(points);
            } else {
                String errorMessage = String.format(Locale.US, "readAllInArea failed with parameters: (latitude=%f, longitude=%f, maxDistance=%f)", 
                        latitude, longitude, maxDistance);
                Log.e(LOG_TAG, errorMessage, e);
                handler.readAllInAreaFailed(latitude, longitude, maxDistance, e);
            }
        }
    });
}
项目:stepout    文件:Event.java   
public Event(String message, ParseGeoPoint coordinates, String category, String authorHash, Date date, List<String> respondentsHash) {
    this.message = message;
    this.coordinates = coordinates;
    this.category = category;
    this.authorHash = authorHash;
    this.date = date;
    this.respondentsHash = respondentsHash;
}
项目:stepout    文件:DataExchange.java   
public static void getEventsInRadius(double lan, double lng) {
    final ArrayList<Event> events = new ArrayList<Event>();

    ParseQuery<ParseObject> query = ParseQuery.getQuery(EVENT_TABLE_NAME);
    query.whereWithinMiles(COORDINATES_COL_NAME, new ParseGeoPoint(lan, lng), EVENTS_VISIBILITY_RADIUS_IN_MILES);

    query.findInBackground(new FindCallback<ParseObject>() {
        @Override
        public void done(List<ParseObject> parseObjects, ParseException e) {
            if (e == null) {
                for (int i = 0; i < parseObjects.size(); i++) {
                    ParseObject po = parseObjects.get(i);
                    Event ev = new Event(
                            po.getString(MESSAGE_COL_NAME),
                            po.getParseGeoPoint(COORDINATES_COL_NAME),
                            po.getString(CATEGORY_COL_NAME),
                            po.getString(AUTHOR_HASH_COL_NAME),
                            po.getDate(DATE_COL_NAME),
                            po.<String>getList(RESPONDENTS_HASH_COL_NAME)
                    );

                    ev.setHash(po.getObjectId());
                    events.add(ev);
                }

                bus.post(events);
            }
        }
    });
}
项目:stepout    文件:DataExchange.java   
public static void searchEventsInRadius(String key, Double lan, Double lng) {
    final ArrayList<Event> events = new ArrayList<Event>();

    ParseQuery<ParseObject> query = ParseQuery.getQuery(EVENT_TABLE_NAME);
    query.whereWithinMiles(COORDINATES_COL_NAME, new ParseGeoPoint(lan, lng), EVENTS_VISIBILITY_RADIUS_IN_MILES);
    query.whereContains(MESSAGE_COL_NAME, key);

    query.findInBackground(new FindCallback<ParseObject>() {
        @Override
        public void done(List<ParseObject> parseObjects, ParseException e) {
            if (e == null) {
                for (int i = 0; i < parseObjects.size(); i++) {
                    ParseObject po = parseObjects.get(i);

                    Event ev = new Event(
                            po.getString(MESSAGE_COL_NAME),
                            po.getParseGeoPoint(COORDINATES_COL_NAME),
                            po.getString(CATEGORY_COL_NAME),
                            po.getString(AUTHOR_HASH_COL_NAME),
                            po.getDate(DATE_COL_NAME),
                            po.<String>getList(RESPONDENTS_HASH_COL_NAME)
                    );

                    ev.setHash(po.getObjectId());
                    events.add(ev);

                }

                searchEventResult.clear();
                searchEventResult.addAll(events);
                bus.post(STATUS_SEARCH_SUCCESS);
            } else {
                bus.post(STATUS_SEARCH_FAIL);
            }
        }
    });
}
项目:hacktoolkit-android_lib    文件:HTKUser.java   
/**
 * updateLocation
 * 
 * @param latitude
 * @param longitude
 * @param forceUpdate whether we should force an update
 * @return true if location was updated, false otherwise
 */
public boolean updateLocation(double latitude, double longitude, boolean forceUpdate) {
    boolean updated = false;
    if (forceUpdate || shouldUpdateLocation(latitude, longitude)) {
        ParseGeoPoint geoPoint = new ParseGeoPoint(latitude, longitude);
        parseUser.put("location", geoPoint);
        parseUser.put("locationLastUpdatedAt", new Date());
        parseUser.saveEventually();
        updated = true;
    }
    return updated;
}
项目:ISawABird    文件:Sighting.java   
public Sighting(Species speciesName){
    this.species = speciesName;
    this.date = new Date();
    ParseGeoPoint myDot = ParseUtils.getLastKnownLocation(); 
    this.latitude = myDot.getLatitude() ; 
    this.longitude = myDot.getLongitude();
}
项目:UCOmove    文件:ParseLocation.java   
public void setGeolocation(Location location) {
    put("geolocation",
            new ParseGeoPoint(
                    location.getLatitude(),
                    location.getLongitude()));
}
项目:UCOmove    文件:Schedule.java   
public ParseGeoPoint getOriginLocation() {
    return getParseGeoPoint("date");
}
项目:Mediator_Android    文件:LobbyEventCard.java   
@Override
public ParseGeoPoint getGeoPoint() {
    return getParseGeoPoint("placedAt");
}
项目:Mediator_Android    文件:RealmLobbyEvent.java   
@Override
public ParseGeoPoint getGeoPoint() {
    return new ParseGeoPoint(lat, lon);
}
项目:hack2help    文件:LocationUtils.java   
public static LatLng geoPointToLatLng(ParseGeoPoint geoPoint)
{
    return new LatLng(geoPoint.getLatitude(), geoPoint.getLongitude());
}
项目:hack2help    文件:LocationUtils.java   
public static ParseGeoPoint latLngToParseGeo(LatLng latLng)
{
    return new ParseGeoPoint(latLng.latitude, latLng.longitude);
}
项目:hack2help    文件:Tour.java   
public ParseGeoPoint getLocation()
{
    return getParseGeoPoint(KEY_START_POINT);
}
项目:hack2help    文件:Node.java   
public ParseGeoPoint getLocation()
{
    return getParseGeoPoint(KEY_LOCATION);
}
项目:ActivityMapper    文件:Record.java   
public ParseGeoPoint getLocation() {
    return getParseGeoPoint("location");
}
项目:ActivityMapper    文件:Record.java   
public void setLocation(ParseGeoPoint value) {
    put("location", value);
}
项目:libertacao-android    文件:UserManager.java   
public void setCurrentLatLng(@Nullable LatLng currentLatLng) {
    boolean shouldPostEvent = false;
    if (this.currentLatLng == null && currentLatLng != null) {
        shouldPostEvent = true;
    }

    if (currentLatLng == null) {
        UserPreferences.setLatitude(Event.INVALID_LOCATION);
        UserPreferences.setLongitude(Event.INVALID_LOCATION);
    } else {
        if (LoginManager.getInstance().isLoggedIn()) {
            if (this.currentLatLng == null ||
                    distance((float) this.currentLatLng.latitude, (float) this.currentLatLng.longitude,
                            (float) currentLatLng.latitude, (float) currentLatLng.longitude) > DISTANCE_THRESHOLD) {
                // If we don't have a current latlng yet, or if the new received distance is from a distance greater than the threshold, update
                // ParseUser object and UserPreferences
                UserPreferences.setLatitude(currentLatLng.latitude);
                UserPreferences.setLongitude(currentLatLng.longitude);

                final double previousLatitude = this.currentLatLng != null ? this.currentLatLng.latitude : Event.INVALID_LOCATION;
                final double previousLongitude = this.currentLatLng != null ? this.currentLatLng.longitude : Event.INVALID_LOCATION;

                ParseUser currentUser = ParseUser.getCurrentUser();
                currentUser.put("location", new ParseGeoPoint(currentLatLng.latitude, currentLatLng.longitude));
                currentUser.saveInBackground(new SaveCallback() {
                    @Override
                    public void done(ParseException e) {
                        if (e != null) {
                            // Something bad occurred. Rollback UserPreferences
                            UserPreferences.setLatitude(previousLatitude);
                            UserPreferences.setLongitude(previousLongitude);
                            Timber.d("Rolling back saved locations in UserPreferences because could not get it saved in Parse.");
                        }
                    }
                });
            }
        } else {
            UserPreferences.setLatitude(currentLatLng.latitude);
            UserPreferences.setLongitude(currentLatLng.longitude);
        }
    }

    this.currentLatLng = currentLatLng;

    if (shouldPostEvent) {
        // Only post event after this..currentLatLng has the right value
        EventBus.getDefault().post(new FirstLocationEncounteredEvent());
    }
}
项目:RadarApp    文件:RegisterActivity.java   
@Override
protected Void doInBackground(String... params) {
    String username = params[0];
    String password = params[1];
    String email = params[2];

    User newUser = new User();
    newUser.setUsername(username);
    newUser.setPassword(password);
    newUser.setEmail(email);

    // Retrieve user current Location
    UserDetail userDetail = new UserDetail();
    Location location = getLocation();
    if (location != null) {
        userDetail.setLocation(new ParseGeoPoint(location.getLatitude(),
                location.getLongitude()));
    } else {
        userDetail.setLocation(new ParseGeoPoint(0, 0));
    }

    userDetail.setProvider(LocationManager.NETWORK_PROVIDER);

    // Create an empty follow row
    Follow emptyFollow = new Follow();
    emptyFollow.setFollowers(new ArrayList<User>());
    emptyFollow.setFollowings(new ArrayList<User>());

    try {
        // Save the new follow table
        emptyFollow.save();
        newUser.setFollow(emptyFollow);

        // Save empty location (0,9)
        userDetail.save();
        newUser.setUserDetail(userDetail);

        // sign-up the new user
        newUser.signUp();
        goToMain(newUser);
    } catch (final ParseException e) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                NotificationHelper.alert(RegisterActivity.this,
                        getString(R.string.dialog_error_title),
                        e.getMessage());
            }
        });
    }

    return null;
}
项目:RadarApp    文件:UserDetail.java   
public ParseGeoPoint getLocation() {
    return getParseGeoPoint(Constants.USER_DETAIL_COL_LOCATION);
}
项目:RadarApp    文件:UserDetail.java   
public void setLocation(ParseGeoPoint location) {
    put(Constants.USER_DETAIL_COL_LOCATION, location);
}
项目:androidClient    文件:RestaurantModel.java   
public String getDistanceFromString(ParseGeoPoint location) {
    return String.format("%.1f", getDistanceFrom(location)) + " mi";
}