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
class LoadCategories extends AsyncTask<String, String, String> { | |
@Override | |
protected void onPreExecute() { | |
} | |
@Override | |
protected String doInBackground(String... args) { | |
return something; | |
} |
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 onPreExecute() { | |
super.onPreExecute(); | |
pDialog = new ProgressDialog(CategoryActivity.this); | |
pDialog.setMessage("Listing Categories..."); | |
pDialog.setIndeterminate(false); | |
pDialog.setCancelable(false); | |
pDialog.show(); | |
} |
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 String doInBackground(String... args){ | |
// Building Parameters | |
List<NameValuePair> params = new ArrayList<NameValuePair>(); | |
// getting JSON string from URL | |
String json = jsonParser.makeHttpRequest(URL_CATEGORY, "GET", | |
params); | |
// Check your log cat for JSON reponse | |
Log.d("Categories JSON: ", "> " + json); |
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
Intent i = new Intent(getApplicationContext(), | |
CategoryDetail.class); | |
String category_id = ((TextView) view | |
.findViewById(R.id.category_id)).getText() | |
.toString(); | |
i.putExtra("category_id", category_id); | |
startActivity(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
package com.aiman.listviewexample; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.UnsupportedEncodingException; | |
import java.util.List; | |
import org.apache.http.HttpEntity; |
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
package com.aiman.listviewexample; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import org.apache.http.NameValuePair; | |
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; |
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
package com.aiman.listviewexample; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import com.squareup.picasso.Picasso; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; |
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 MainActivity extends AppCompatActivity | |
implements GoogleApiClient.ConnectionCallbacks, | |
GoogleApiClient.OnConnectionFailedListener { | |
private static final String TAG = MainActivity.class.getSimpleName(); | |
private SupportMapFragment mapFragment; | |
private MapObservableProvider mapObservableProvider; | |
private CompositeSubscription subscriptions = Subscriptions.from(); | |
private GoogleMap googleMap; |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright 2012-2015 Matt Martz | |
# All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Environment; | |
import android.provider.MediaStore; | |
import android.support.v4.app.Fragment; | |
import android.util.Log; | |
import java.io.File; | |
import java.io.IOException; |