Back to project page MapAlarmist.
The source code is released under:
Copyright 2013 Guilhem Vellut <guilhem@vellut.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), t...
If you think the Android project MapAlarmist listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.vellut.geoalarm.io; //from ww w. j a v a 2s .c om import java.lang.reflect.Type; import com.google.android.gms.maps.model.LatLngBounds; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; public class LatLngBoundsSerializer implements JsonSerializer<LatLngBounds> { @Override public JsonElement serialize(LatLngBounds zone, Type arg1, JsonSerializationContext arg2) { JsonArray arr = new JsonArray(); arr.add(new JsonPrimitive(zone.southwest.latitude)); arr.add(new JsonPrimitive(zone.southwest.longitude)); arr.add(new JsonPrimitive(zone.northeast.latitude)); arr.add(new JsonPrimitive(zone.northeast.longitude)); return arr; } }