Skip to content

Instantly share code, notes, and snippets.

View Asutosh11's full-sized avatar
🏠
Working from home

Asutosh Panda Asutosh11

🏠
Working from home
  • Lowe's India
  • Bengaluru, Karnataka, India
View GitHub Profile
@Asutosh11
Asutosh11 / ResponseOKhttp.java
Last active November 30, 2016 11:28
OkHttp Class for making REST API calls
/*
OkHttp class for making REST calls.
Here the method is POST, you can change it to GET in 'request' below
*/
public class ResponseOKhttp
{
OkHttpClient client = new OkHttpClient();
@Asutosh11
Asutosh11 / ViewToImage.java
Last active November 29, 2016 08:38
Android Java Class to take a snapshot of a View on screen and save as Image
/*
This class converts any Layout or View to image and saves in Phone.
In one of my projects, I had a requirement of saving whatever is being displayed on the Screen as an image.
I created a class for it so that in future it becomes easy to reuse.
Usage Example
-----------------------------------------------------------------------------------------------------------
FrameLayout mLin_FramePreview1 = (FrameLayout)findViewById(R.id.lin_FramePreview1);
ViewToImage v = new ViewToImage(mLin_FramePreview1);