Skip to content

Instantly share code, notes, and snippets.

View dseerapu's full-sized avatar

Dhamra Sai Seerapu dseerapu

View GitHub Profile
package com.sample.awsutils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.CognitoCachingCredentialsProvider;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferListener;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferObserver;
package com.sample.awsutils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.CognitoCachingCredentialsProvider;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferListener;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferObserver;
@dseerapu
dseerapu / gist:b768728b3b4ccf282c7806a3745d0347
Last active October 25, 2022 15:04
Android app inactivity timeout | Android Logout timer
public class LogOutTimerUtil {
public interface LogOutListener {
void doLogout();
}
static Timer longTimer;
static final int LOGOUT_TIME = 600000; // delay in milliseconds i.e. 5 min = 300000 ms or use timeout argument
public static synchronized void startLogoutTimer(final Context context, final LogOutListener logOutListener) {
@dseerapu
dseerapu / ImageInputHelper
Last active April 24, 2017 10:19
Image Picker from Gallery and Photo
package com.bolste.android.activities.ui.utils;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v4.app.Fragment;
import android.support.v4.content.FileProvider;
import android.util.Log;