Category: General

How to develop a Flip Coin App in Android Studio

In this tutorial, you will learn how to develop a flip coin app in Android Studio. Download the live app from https://play.google.com/store/apps/details?id=com.zakasoft.flip Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.zakasoft.flip"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

Implementing backup and restore feature of SQLite Database to comply with Scoped Storage Android 11

package com.abc.def; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.channels.FileChannel; import java.text.SimpleDateFormat; import

MikroTik Simple Queue Script – Add All IP

As a network administrator, you may need to create queue for all IP which will limit the internet usage for a particular router. For this the below command is very handy and easy to use. :for x from= 1 to= 254 do={/queue simple add name=”queue-$x” max-limit=1M/1M target=”192.168.24.$x”} Open the New Terminal from Winbox and type

How to show empty View in Activity Recyclerview?

package com.zakasoft.cashreceipt; import android.content.Context; import androidx.recyclerview.widget.RecyclerView; import android.util.AttributeSet; import android.view.View; import androidx.recyclerview.widget.RecyclerView; public class EmptyRecyclerView extends RecyclerView { private View emptyView; final private RecyclerView.AdapterDataObserver observer = new AdapterDataObserver() { @Override public void onChanged() { checkIfEmpty(); } @Override public void onItemRangeInserted(int positionStart, int itemCount) { checkIfEmpty(); } @Override public void onItemRangeRemoved(int positionStart, int itemCount) { checkIfEmpty();