Skip to content

Instantly share code, notes, and snippets.

View hitesh-dhamshaniya's full-sized avatar
🎯
Focusing

Hitesh Dhamshaniya hitesh-dhamshaniya

🎯
Focusing
View GitHub Profile
@hitesh-dhamshaniya
hitesh-dhamshaniya / HighScoreManager
Created November 19, 2015 12:11
Script for Database Connection and Read & Write Operation in Unity3d for store Data i.e High score of Players
using UnityEngine;
using System.Collections;
using System;
using System.Data;
using Mono.Data.Sqlite;
public class HighscoreManager : MonoBehaviour {
private String connectionString;
// Use this for initialization
using UnityEngine;
using System.Collections;
public class Santawalk : MonoBehaviour {
public float speed;
private Vector3 direction;
private Vector3 setVec;
// Use this for initialization
import android.util.Base64;
import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Security;
import javax.crypto.BadPaddingException;
/**
* Performs rotation over bitmap
*
* @param bitmap
* Input bitmap for rotate
* @param orientation
* Value of image orientation
* @return Rotated bitmap
*/
public static Bitmap rotateBitmap(Bitmap bitmap, int orientation) {
@hitesh-dhamshaniya
hitesh-dhamshaniya / gist:3f3723ed441b8be254357e66d6186b57
Created June 28, 2016 13:32
SMTP Mail sender help to send mail from Android application without user interaction.
public class SmtpSendMail {
public static void sendMail() {
// Recipient's email ID needs to be mentioned.
String to = "hitesh.dhamshaniya@devdigital.com";
// Sender's email ID needs to be mentioned
String from = to;//"web@gmail.com";
// Assuming you are sending email from localhost
// String host = "localhost";
@hitesh-dhamshaniya
hitesh-dhamshaniya / Full Screen
Created July 18, 2016 06:21
Full Screen Appcompact Activity Transparent Navigation and Status bar
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
public Bitmap getScreenshotFromRecyclerView(RecyclerView view) {
RecyclerView.Adapter adapter = view.getAdapter();
Bitmap bigBitmap = null;
if (adapter != null) {
int size = adapter.getItemCount();
int height = 0;
Paint paint = new Paint();
int iHeight = 0;
final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
Here I would like to make list of good useful libs. starting with TarsosDSP sound lib
1) https://github.com/JorenSix/TarsosDSP
2) http://cmusphinx.sourceforge.net/wiki/tutorialandroid
@hitesh-dhamshaniya
hitesh-dhamshaniya / Transparent status bar
Created May 2, 2017 08:51
FullScreenAndroid - Transparent status bar
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow(); // in Activity's onCreate() for instance
//use this to make transparent both status and navigationbar, add 24dp marginTop to toolbar in xml
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
// use this to make transparent status bar, No need to add 24dp marginTop to toolbar.
/*w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
w.setExitTransition(null);
}
}
@hitesh-dhamshaniya
hitesh-dhamshaniya / Single Selection in Group NavigatioView Android
Created May 6, 2017 13:23
How to set shared checkable behavior across all groups in NavigationView?
Here's the solution.
Step 1: Remove
android:checkableBehavior="single"
from both groups.
Step 2: Add the following logic to the listener:
mUiNavigationView.setNavigationItemSelectedListener(