Skip to content

Instantly share code, notes, and snippets.

View mambrosi's full-sized avatar

Marcos Ambrosi mambrosi

View GitHub Profile
{
"message": {
"token": "fBAkL5yDV-g:APA91bEygM9QYOTTiBz6TPkrB0GLsNvTzzWlIw0smBiae5ZtkwAoleba2NVIq69cg0X7q061o5Z0uq7--4ZTF1TiivJGS_E9fsOhbqE12Z4VP1FsRsv9oEv24b5QNvtJFUrYjrXdlqgp",
"data": {
"title": "Marcos Test Title (Android & iOS)",
"body": "Marcos Test Body (Android & iOS)",
"alert_type": "0",
"android_channel_id": "catapult_channel"
},
"android": {
@Override public Response intercept(Chain chain) throws IOException {
Level level = this.level;
Request request = chain.request();
if (level == Level.NONE) {
return chain.proceed(request);
}
boolean logBody = level == Level.BODY;
boolean logHeaders = logBody || level == Level.HEADERS;
@mambrosi
mambrosi / MainActivity.java
Created December 28, 2015 14:56
Store Bitmap as a image file on Android
private void storePhotoOnDisk(final Bitmap capturedBitmap) {
new Thread(new Runnable() {
@Override
public void run() {
File folder = new File(Environment.getExternalStorageDirectory() +
File.separator + "MyFolder");
folder.mkdirs();