Monday, 18 November 2019

This release is compatible with the google play 64-bit requirements / 64 bit support

 Build.gradle

Step 1 - import below the line

import com.android.build.OutputFile



Step 2 - add ndk Tag insie defaultConfig tag

defaultConfig {
      ------

    ndk {

            // config you want to support device

            abiFilters 'arm64-v8a', 'armeabi', 'armeabi-v7a', 'x86' , 'x86_64'

        }
}


Step 3 - add splits tag inside Android tag

android {

splits {

// Configures multiple APKs based on ABI.

        abi {

// Enables building multiple APKs per ABI.

            enable true


// By default all ABIs are included, so use reset() and include to specify that we only

// want APKs for x86, armeabi-v7a, and mips.

            reset()


// Specifies a list of ABIs that Gradle should create APKs for.

            include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"


// Specifies that we want to also generate a universal APK that includes all ABIs.

            universalApk true

        }

    }


// Map for the version code that gives each ABI a value.

    def abiCodes = ['x86': 1, 'x86_64': 2, 'armeabi-v7a': 3, 'arm64-v8a': 4]


// APKs for the same app that all have the same version information.

    android.applicationVariants.all { variant ->

// Assigns a different version code for each output APK.

        variant.outputs.each {

            output ->

                def abiName = output.getFilter(OutputFile.ABI)

                output.versionCodeOverride = abiCodes.get(abiName, 0) * 100000 + variant.versionCode

        }

    }

}


Step 4 - there are generate multiple apk, 
Upload apk : app-universal-release.apk

Thursday, 4 July 2019

Face detection and Pixelate programetically in android


Face detection using Firebase vision library.

Pixelate face using canvas.

Demo here: https://drive.google.com/open?id=1AwIAC1zi06gj-wrC_eahmiPXSEdsMPKQ


Face detection and pixelate without internet/offline

Tuesday, 11 June 2019

Get current location / get repeat location

Get current location - Continuously gets device location.

Download demo :
https://drive.google.com/open?id=1IOlbxRfKABnqcznpng8z7TDsIdqSgciq

Wednesday, 5 June 2019

Android kiosk mode / Standalone Device

Android kiosk mode demo. Make Standalone Device

- lock device for single application.
- cant swtich to other application.

Download demo:- https://drive.google.com/open?id=1ZAE1I38EIdB7M0sVi_4DQTFk_3cx_FYt

Monday, 25 February 2019

Music player Service Demo


How service will work in backgroud and foregroud.


git clone https://milankamariya@bitbucket.org/milankamariya/sky-music-player.git


- Pending intent notification with service.

Wednesday, 20 February 2019

Android build variant / signingConfigs / buildTypes


- How to configure project with build variant and build types
- Set detail keystore password and file for auto generate signapk



just change build variand and create/run apk with diffent details or enviroment.



Download demo from here:   https://drive.google.com/open?id=1U3jjkzB7pyOWp8zEqowqK5jARxkHRMkP





Thursday, 14 February 2019

Filter for Edittext for percentage value

 
 
Filter for Edit text for percentage value (like 100.00 , 99.99)
 
 
 
inner class MoneyValueFilter : DigitsKeyListener(false, true) {

    private var digits = 2
    fun setDigits(d: Int) {
        digits = d
    }

    override fun filter(source: CharSequence, start: Int, end: Int,
                        dest: Spanned, dstart: Int, dend: Int): CharSequence {
        var source = source
        var start = start
        var end = end
        val out = super.filter(source, start, end, dest, dstart, dend)


        // if changed, replace the source        if (out != null) {
            source = out
            start = 0            end = out.length        }

        val len = end - start

        // if deleting, source is empty        // and deleting can't break anything        if (len == 0) {
            return source
        }

        val dlen = dest.length

        try {


            // Get input            val stringToMatch = dest.toString() + source.toString()
            val input = java.lang.Float.parseFloat(stringToMatch)
            val inputInt = input.toInt()
            val inputString = input.toString()

            if ((inputInt > 100)) {
                return "";
            }
            if((inputInt == 100) && stringToMatch.contains("."))MoneyValueFilter

{
                return "";
            }

        } catch (e: java.lang.Exception) {

        }


        // Find the position of the decimal .        for (i in 0 until dstart) {
            if (dest[i] == '.') {
                // being here means, that a number has                // been inserted after the dot                // check if the amount of digits is right                return if (dlen - (i + 1) + len > digits)
                    ""                else                    SpannableStringBuilder(source, start, end)
            }
        }

        for (i in start until end) {
            if (source[i] == '.') {
                // being here means, dot has been inserted                // check if the amount of digits is right                return if (dlen - dend + (end - (i + 1)) > digits)
                    ""                else                    break  // return new SpannableStringBuilder(source, start, end);            }
        }


        // if the dot is after the inserted part,        // nothing can break        return SpannableStringBuilder(source, start, end)
    }

    private fun isInRange(min: Float, max: Float, input: Float): Boolean {
        return input >= min && input <= max
    }
}

Thursday, 3 January 2019

Fullscreen Activity in Android ?


Put below code in onCreate() method


try {
    window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE            or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION            or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN            or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION            or View.SYSTEM_UI_FLAG_FULLSCREEN            or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
} catch (e: Exception) {
    e.printStackTrace()
}


Run/install/debug Android applications over Wi-Fi ?

Open Teminal/cmd --------------- Below steps is for Android 10 or lower Step 1 - Connect the device via USB and make sure debugging is work...