Skip to content

Instantly share code, notes, and snippets.

Cüneyt AYYILDIZ Swisyn

View GitHub Profile
@Swisyn
Swisyn / README.md
Created Feb 3, 2016 — forked from lopspower/README.md
Configuration of proguard-rules.pro
View README.md

Proguard Configuration

Twitter

1) Enable Proguard in your build.gradle module :

android {
    //...
    buildTypes {
@Swisyn
Swisyn / 1-README.md
Created Feb 3, 2016 — forked from lopspower/1-README.md
Android M Permissions
View 1-README.md

Android M Permissions

Twitter

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
Swisyn / string_encrypt_decrypt.md
Created Apr 23, 2016 — forked from aogilvie/string_encrypt_decrypt.md
Quick and sexy String encrypt / decrypt for Android
View string_encrypt_decrypt.md

#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.

Notes;

  • 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
Swisyn / CountDownTimer.java
Created May 5, 2016 — forked from Gautier/CountDownTimer.java
Drop-in alternative for the Android CountDownTimer class, but which you can cancel from within onTick.
View CountDownTimer.java
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Swisyn
Swisyn / README.md
Created Jun 16, 2016 — forked from gabrielemariotti/README.md
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)
View README.md

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:

root
  --gradleScript
  ----dependencies.gradle
@Swisyn
Swisyn / LocalBroadcastExampleActivity.java
Created Jun 29, 2016 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
View LocalBroadcastExampleActivity.java
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@Swisyn
Swisyn / DatabaseUtil.java
Created Nov 30, 2016
Database Operations
View DatabaseUtil.java
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/");
dbDirectory.mkdirs();
try {
CopyDB(context.getAssets().open(dbName), new FileOutputStream(context.getDatabasePath(dbName).getPath()));
} catch (Exception e) {
e.printStackTrace();
}
@Swisyn
Swisyn / new_gist_file.java
Created Nov 30, 2016
Database Operations
View new_gist_file.java
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
Swisyn / README.md
Created Dec 6, 2016 — forked from gabrielemariotti/README.md
How to manage the firebase libraries in a multi-module projects
View README.md

Centralize the firebase libraries dependencies in gradle

ext {
      firebaseVersion = '9.0.0';

      firebaseDependencies = [
              core :         "com.google.firebase:firebase-core:${firebaseVersion}",
              database :     "com.google.firebase:firebase-database:${firebaseVersion}",
              storage :      "com.google.firebase:firebase-storage:${firebaseVersion}",
@Swisyn
Swisyn / LICENCE SUBLIME TEXT
Created Feb 9, 2017
Sublime Text 3 Serial key build is 3103
View LICENCE SUBLIME TEXT
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
You can’t perform that action at this time.