Skip to content

Instantly share code, notes, and snippets.

View Swisyn's full-sized avatar

Dzhunet Hasan Swisyn

  • kleinanzeigen GmbH
  • Berlin, Germany
  • 14:34 (UTC +02:00)
View GitHub Profile
Swisyn /
Created February 3, 2016 16:47 — forked from lopspower/
Configuration of

Proguard Configuration


1) Enable Proguard in your build.gradle module :

android {
 buildTypes {
Swisyn /
Created February 3, 2016 16:48 — forked from lopspower/
Android M Permissions

Android M Permissions


1) Android Permissions

Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. This approach streamlines the app install process, since the user does not need to grant permissions when they install or update the app. It also gives the user more control over the app's functionality; for example, a user could choose to give a camera app access to the camera but not to the device location. The user can revoke the permissions at any time, by going to the app's Settings screen.

Normal and Dangerous Permissions

Swisyn /
Created May 5, 2016 12:37 — forked from Gautier/
Drop-in alternative for the Android CountDownTimer class, but which you can cancel from within onTick.
* Copyright (C) 2008 The Android Open Source Project
* 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
* Unless required by applicable law or agreed to in writing, software
Swisyn /
Created June 16, 2016 21:38 — forked from gabrielemariotti/
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

Swisyn /
Created June 29, 2016 07:04 — forked from Antarix/
Simple Example of using LocalBroadcastManager in Android
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
Swisyn /
Created November 30, 2016 20:48
Database Operations
public static void CopyDBIfNotExists(Context context, String dbName) {
File db = new File(context.getDatabasePath(dbName).getPath());
if (!db.exists()) {
File dbDirectory = new File("/data/data/" + context.getPackageName() + "/databases/");
try {
CopyDB(context.getAssets().open(dbName), new FileOutputStream(context.getDatabasePath(dbName).getPath()));
} catch (Exception e) {
Swisyn /
Created November 30, 2016 20:49
Database Operations
package com.cuneytayyildiz.aktuelurunler.utils;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.text.TextUtils;
Swisyn /
Created December 6, 2016 11:56 — forked from gabrielemariotti/
How to manage the firebase libraries in a multi-module projects

Centralize the firebase libraries dependencies in gradle

ext {
      firebaseVersion = '9.0.0';

      firebaseDependencies = [
              core :         "${firebaseVersion}",
              database :     "${firebaseVersion}",
              storage :      "${firebaseVersion}",
Created February 9, 2017 21:41
Sublime Text 3 Serial key build is 3103
Michael Barnes
Single User License
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
Swisyn / file
Created February 18, 2017 22:43
{"0.3731753471884953":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEIUqFbmrAOe09vcGzVXq5ScqREYgdX6yV\r\nYpYATq/sst5lOLwT4DQK4U+r/wpau0uQx1YZgj3Y/bOt+R8G2Cw7Uc3/AAAACDxn\r\naXRodWI+wv8AAACOBBATCABA/wAAAAWCWKjOEP8AAAACiwn/AAAACZCXidFimoTY\r\nLP8AAAAFlQgJCgv/AAAABJYDAQL/AAAAApsD/wAAAAKeAQAA3K4A/0tsj/6C8QZf\r\n5ahfGaTNvnDaqPIcYiVX7e+iPSHgxyGYAQDcHRGkMmavdz/pWswdtJhVxALesGVJ\r\nvhR5TE/Fw0mRf87/AAAAVgQAAAAAEggqhkjOPQMBBwIDBL7AJJJe6sRLJNfkr6gt\r\n9WviMw/UZYTvZGPJj91jVdrgSX5idaoEH0hlin6gl5ql8ScWjcLT77aaBk0Lo0jO\r\n7DsDAQgHwv8AAABtBBgTCAAf/wAAAAWCWKjOEP8AAAAJkJeJ0WKahNgs/wAAAAKb\r\nDAAAbIgBAITu9WEzFHWA4YZHUiFz3TBtDrQIduOxhr6vXbNAmkGCAP0c7W7CP4vj\r\nezaQPkzcU+oD5LMJCJgOSlCCdd58V3Bl5g==\r\n=Nsze\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n"}