Skip to content

Instantly share code, notes, and snippets.

@medstudioinc
medstudioinc / 01.step1.md
Created May 18, 2020 05:13 — forked from gnuanu/01.step1.md
Creating a simple Hello World application Using Android NDK with C++

Prerequisites

  1. I am using GNU/Linux
  2. My IDE is IntelliJ IDEA
  3. The project is Ant based.
  4. My working directory is $JNI
  5. My C++ IDE is QtCreator (I'll mention the build steps inline).
  6. NDK should be installed and ndk-build should be available in $PATH
  7. javah should be available in $PATH

Step 1 - Create The Android Project

@medstudioinc
medstudioinc / AudioRecordThread.java
Created May 18, 2020 04:26 — forked from nieldeokar/AudioRecordThread.java
Recording an Audio with .aac extension using AudioRecord android.
package com.nieldeokar.whatsappaudiorecorder.recorder;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
import android.media.MediaRecorder;
import android.os.Build;
import android.util.Log;
@medstudioinc
medstudioinc / ChangePassword.java
Created June 30, 2019 17:04 — forked from zach-klippenstein/ChangePassword.java
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall ([email protected]), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{
@medstudioinc
medstudioinc / CoreAppGlideModule.java
Created January 10, 2019 12:07 — forked from wonsuc/FirebaseAppGlideModule.java
Downloading progress with FirebaseUI Storage
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;
import com.google.firebase.storage.StorageReference;
@medstudioinc
medstudioinc / DateHeaderHelper.kt
Created December 31, 2018 14:26 — forked from AkshayChordiya/DateHeaderHelper.kt
Use these date related top-level Kotlin functions to show sections like "Today", "Yesterday" and so on
import org.joda.time.LocalDate
/**
* @return true if the supplied date is in the future else false
*/
fun isUpcoming(millis: Long): Boolean {
return !isTomorrow(millis) && LocalDate(millis).isAfter(LocalDate.now())
}
/**
@medstudioinc
medstudioinc / PhonecallReceiver.java
Created December 6, 2018 17:30 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@medstudioinc
medstudioinc / RoundedCornerLayout.java
Created November 5, 2018 16:29 — forked from grennis/RoundedCornerLayout.java
Android Rounded Corner Layout
// This layout will display its children with rounded corners
// It works with Glide image library placeholders and animations
// It assumes your background is a solid color. If you need the corners to be truly transparent,
// this solution will not work for you.
package com.myapp.ui;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@medstudioinc
medstudioinc / RoundedCornerLayout.java
Created November 5, 2018 16:29 — forked from grennis/RoundedCornerLayout.java
Android Rounded Corner Layout
// This layout will display its children with rounded corners
// It works with Glide image library placeholders and animations
// It assumes your background is a solid color. If you need the corners to be truly transparent,
// this solution will not work for you.
package com.myapp.ui;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@medstudioinc
medstudioinc / rules.pro
Created August 14, 2018 15:51 — forked from aegis123/rules.pro
ProGuard and DexGuard rules
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
#your package path where your gson models are stored
-keep class com.project.models.** { *; }