Skip to content

Instantly share code, notes, and snippets.

View Swisyn's full-sized avatar

Dzhunet Hasan Swisyn

  • kleinanzeigen GmbH
  • Berlin, Germany
  • 08:28 (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 April 23, 2016 20:10 — forked from aogilvie/
Quick and sexy String encrypt / decrypt for Android

#Quick and sexy String encrypt / decrypt for Android

Sometimes you find yourself wanted to use SharedPrefs to hold something precious? Want to prevent those pesky rooted hackz0rs from looking in your SharedPreds? Here is a quick and sexy no-external-libs-required solution.


  • I have declared everything static so you can create your own utility class and throw the following straight in.

  • 3rd party imports are not required. Use import android.util.Base64; for Base64, and import javax.crypto.*; for Cipher.

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