This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.emon.haziraKhata.sms; | |
import android.app.Activity; | |
import android.app.role.RoleManager; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.os.Build; | |
import android.provider.Telephony; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
package="*****"> | |
<!-- SMS related permissions--> | |
<uses-permission android:name="android.permission.SEND_SMS" /> | |
<uses-permission android:name="android.permission.READ_SMS" /> | |
<uses-permission android:name="android.permission.WRITE_SMS" /> | |
<uses-permission android:name="android.permission.RECEIVE_SMS" /> | |
<uses-permission android:name="android.permission.READ_CONTACTS" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.memtrip; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import android.content.ContentResolver; | |
import android.content.ContentUris; | |
import android.content.ContentValues; | |
import android.graphics.Bitmap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestLinkedListImplementation { | |
public static void main(String args[]) { | |
LinkedList ll = new LinkedList(); | |
ll.addValue(1); | |
ll.addValue(2); | |
ll.addValue(3); | |
ll.addValue(4); | |
ll.addValue(5); | |
ll.addValue(6); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isRotated= false; | |
View rotateLayout; | |
if(isRotated) | |
{ | |
rotateLayout.setRotation(360); | |
rotateLayout.setTranslationX(0); | |
rotateLayout.setTranslationY(0); | |
ViewGroup.LayoutParams lp = rotateLayout.getLayoutParams(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ishtiaq.techlogicians.offergenie.list; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.StrictMode; | |
import androidx.recyclerview.widget.RecyclerView; | |
import android.text.Html; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File file = new File(sdcard,"Android/file.txt"); | |
StringBuilder text = new StringBuilder(); | |
try { | |
BufferedReader br = new BufferedReader(new FileReader(file)); | |
String line; | |
while ((line = br.readLine()) != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String msg="My name is emon"; | |
String directory_path = Environment.getExternalStorageDirectory().getPath(); | |
File file = new File(directory_path,"/Android"); //"/Android" is the folder name | |
if(!file.exists()){ | |
file.mkdir(); | |
} | |
if (!file.exists()) { | |
file.createNewFile(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class unixToHuman { | |
private static final int SECOND_MILLIS = 1000; | |
private static final int MINUTE_MILLIS = 60 * SECOND_MILLIS; | |
private static final int HOUR_MILLIS = 60 * MINUTE_MILLIS; | |
private static final int DAY_MILLIS = 24 * HOUR_MILLIS; | |
private static final int WEEK_MILLIS = 7 * DAY_MILLIS ; | |
public static String getTimeAgo(long time) { | |
if (time < 1000000000000L) { | |
// if timestamp given in seconds, convert to millis |
NewerOlder