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 java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.StringReader; | |
import java.net.MalformedURLException; | |
import java.net.URL; |
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
timer = new Timer(); | |
timer.schedule(new TimerTask() { | |
@Override | |
public void run() { | |
getActivity().runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
fetchallMessages(match_id,true); |
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
In the Fragment : | |
TabsPagerAdapter mAdapter = new TabsPagerAdapter(getChildFragmentManager(),itemsList); | |
viewPager.setAdapter(mAdapter); | |
viewPager.setOnPageChangeListener(new OnPageChangeListener() { | |
@Override | |
public void onPageSelected(int arg0) { | |
} | |
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 ServiceHandler { | |
static String response = null; | |
public final static int GET = 1; | |
public final static int POST = 2; | |
public ServiceHandler() { | |
} |
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 static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) { | |
final int height = options.outHeight; | |
final int width = options.outWidth; | |
int inSampleSize = 1; | |
if (height > reqHeight || width > reqWidth) { | |
if (width > height) { | |
inSampleSize = Math.round((float) height / (float) reqHeight); | |
} else { | |
inSampleSize = Math.round((float) width / (float) reqWidth); |
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
Here arg[0] --> is the image url that we have to pass to this asynctask as parameter. | |
public class DownloadImage extends AsyncTask<String, Integer, Bitmap> { | |
@Override | |
protected void onPreExecute() { | |
super.onPreExecute(); | |
} |
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 dataIntoPdf(int noOfLines, ArrayList<Info> bookInfosById, PDFCanvas canvasId){ | |
try { | |
float x = 40f; | |
float y = 60f; | |
for (int j = 0; j < bookInfosById.size();j++) { | |
int z = j; | |
Info myInfos = bookInfosById.get(j); | |
if (z < noOfLines) { | |
for (int v = 0; v <= z; v++) { | |
if (z == v) { |
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 Uri getTempFile(){ | |
File root = new File(Environment.getExternalStorageDirectory(), "fashion_swap"); | |
if (!root.exists()){ | |
root.mkdirs(); | |
} | |
String filename=""+System.currentTimeMillis(); | |
File file = new File(root,filename+".jpeg" ); | |
Uri muri = Uri.fromFile(file); | |
selectedImagePath = muri.getPath(); | |
Log.v("take picture path",selectedImagePath); |
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 java.io.UnsupportedEncodingException; | |
import java.util.Map; | |
import org.simpleframework.xml.Serializer; | |
import org.simpleframework.xml.core.Persister; | |
import com.android.volley.AuthFailureError; | |
import com.android.volley.NetworkResponse; | |
import com.android.volley.ParseError; | |
import com.android.volley.Request; |
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 BlurUtil { | |
public static Bitmap blur(Context context, Bitmap sentBitmap, int radius) { | |
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) { | |
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true); | |
final RenderScript rs = RenderScript.create(context); | |
final Allocation input = Allocation.createFromBitmap(rs, sentBitmap, Allocation.MipmapControl.MIPMAP_NONE, | |
Allocation.USAGE_SCRIPT); |
OlderNewer