This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//on model | |
function getUserDetails(){ | |
$this->db->select('coment,name,dob,contry,main_photo'); | |
$this->db->from('user'); | |
$this->db->join('coment', 'coment.email = user.email'); | |
$query = $this->db->get(); | |
if ($query->num_rows() > 0) { | |
return $query->result(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//how to get user where name = laabroo | |
select u.name as name | |
from User u | |
where u.name = 'laabroo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ConvertJakson { | |
private JsonData jsonData; | |
private Gson gson; | |
private String json; | |
public ConvertJakson() { | |
Log.i("Hasil Json : ", jsonData + ""); | |
String data = objJson(); | |
Log.i("ConvetJakson : ", data + ""); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String loadData(double lat, double lon, double rad) { | |
httpGet = new HttpGet("http://laabroo.cu.cc/lokasi.php?lat=" + lat | |
+ "&lon=" + lon + "&rad=" + rad); | |
StringBuilder builder = new StringBuilder(); | |
httpClient = new DefaultHttpClient(); | |
try { | |
response = httpClient.execute(httpGet); | |
StatusLine statusLine = response.getStatusLine(); | |
int statuscode = statusLine.getStatusCode(); | |
if (statuscode == 200) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void getAll(double lat, double lon, double rad) { | |
String posisis = loadData(lat, lon, rad); | |
Log.i("Posisi : ", posisis); | |
try { | |
JSONObject obj = new JSONObject(posisis); | |
JSONArray jsonArray = obj.getJSONArray("items"); | |
for (int i = 0; i < jsonArray.length(); i++) { | |
JSONObject jsonObject = jsonArray.getJSONObject(i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("serial") | |
public class Place implements Serializable { | |
public double lat; | |
public double lon; | |
public double rad; | |
public String name; | |
public String address; | |
public Place() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void tampilkanPosisikeMap(Location newLocation) { | |
List<Overlay> overlays = mapView.getOverlays(); | |
if (overlays.size() > 0) { | |
for (Iterator<Overlay> iterator = overlays.iterator(); iterator | |
.hasNext();) { | |
iterator.next(); | |
iterator.remove(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initMap() { | |
mapView = (MapView) findViewById(R.id.mymap); | |
mapView.displayZoomControls(true); | |
mapView.getController().setZoom(16); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initPosition() { | |
locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); | |
locListener = new LocationListener() { | |
public void onStatusChanged(String provider, int status, | |
Bundle extras) { | |
// TODO Auto-generated method stub | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
initPosition(); | |
initMap(); | |
// initLocationManager(); | |
} |
OlderNewer