├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── misc.xml ├── modules.xml └── runConfigurations.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── example │ │ └── vs00481543 │ │ └── phonecallrecorder │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── vs00481543 │ │ │ └── phonecallrecorder │ │ │ ├── CallDetails.java │ │ │ ├── CommonMethods.java │ │ │ ├── DatabaseHandler.java │ │ │ ├── DatabaseManager.java │ │ │ ├── DatabaseSingleton.java │ │ │ ├── GenericFileProvider.java │ │ │ ├── MainActivity.java │ │ │ ├── PhoneStateReceiver.java │ │ │ ├── RecordAdapter.java │ │ │ └── RecorderService.java │ ├── phone_launcher-web.png │ └── res │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── date_layout.xml │ │ ├── date_noname_layout.xml │ │ ├── record_list.xml │ │ ├── record_noname_list.xml │ │ └── switch_layout.xml │ │ ├── menu │ │ └── mainmenu.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── phone_launcher.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── phone_launcher.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── phone_launcher.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── phone_launcher.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── phone_launcher.png │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── provider_paths.xml │ └── test │ └── java │ └── com │ └── example │ └── vs00481543 │ └── phonecallrecorder │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Call-Recorder 2 | 3 | #### Recorder Features 4 | 1. Records incoming/outgoing calls which might be single or conference calls. 5 | 2. Stores all recordings in internal storage in a folder “MyRecords” which further has folders according to the dates. 6 | 3. Displays the dates and call recording logs under each date. 7 | 4. Displays the contact names as saved by user in phone contacts. 8 | 5. On clicking the particular contact ,user has option to chose which media player to play it on. 9 | 6. Has a switch to turn the recorder on/off. 10 | 7. Runtime permissions implemented. 11 | 12 | #### Compatibility 13 | The application is fully compatible till android 6. Some audio glitches can occur in higher android versions due to restrictions on accessing the audio stream of the other end in higher android versions. 14 | Android 7 compatible app will come out soon. 15 | 16 | #### Permissions 17 | Runtime permissions are implemented in code for following permissions 18 | 1. READ_CONTACTS 19 | 2. RECORD_AUDIO 20 | 3. READ_EXTERNAL_STORAGE 21 | 4. WRITE_EXTERNAL_STORAGE 22 | 5. READ_PHONE_STATE 23 | 24 | #### Database 25 | SQLite database is used for saving the list of phone number, date and time which is futher displayed on screen via Recycler View. 26 | Singleton Class is implemented to the database handler. 27 | 28 | #### Broadcast Receiver 29 | A receiver class is made to handle the broadcasts which is registered in the manifest. 30 | The application receives broadcasts on particularly 3 events when phone is : 31 | 1. "Ringing". 32 | 2. "Picked up" 33 | 3. "Hung up" 34 | 35 | #### Player 36 | On clicking a call log, a menu pops up giving option to the user, to chose from various media payers on device. 37 | FileReader class is used to give the access of mp4 file to music players on device. 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "26.0.0" 6 | defaultConfig { 7 | applicationId "com.example.vs00481543.phonecallrecorder" 8 | minSdkVersion 15 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:25.3.1' 28 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 29 | testCompile 'junit:junit:4.12' 30 | compile 'com.android.support:recyclerview-v7:25.3.1' 31 | compile 'com.android.support:cardview-v7:25.3.1' 32 | } 33 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\AndroidSdk\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/vs00481543/phonecallrecorder/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.vs00481543.phonecallrecorder", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/CallDetails.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | /** 4 | * Created by VS00481543 on 01-11-2017. 5 | */ 6 | 7 | public class CallDetails { 8 | 9 | private int serial; 10 | private String num; 11 | // private String name; 12 | private String time; 13 | private String date; 14 | 15 | public CallDetails(){ 16 | 17 | } 18 | 19 | public CallDetails(int serial,String num,String time,String date) 20 | { 21 | this.serial=serial; 22 | this.num=num; 23 | //this.name=name; 24 | this.time=time; 25 | this.date=date; 26 | } 27 | 28 | public int getSerial() 29 | { 30 | return serial; 31 | } 32 | 33 | public void setSerial(int serial) 34 | { 35 | this.serial=serial; 36 | } 37 | 38 | public String getNum() 39 | { 40 | return num; 41 | } 42 | 43 | public void setNum(String num) 44 | { 45 | this.num=num; 46 | } 47 | 48 | /* public String getName() 49 | { 50 | return name; 51 | } 52 | 53 | public void setName(String name) 54 | { 55 | this.name=name; 56 | }*/ 57 | 58 | public String getTime1() 59 | { 60 | return time; 61 | } 62 | 63 | public void setTime1(String time) 64 | { 65 | this.time=time; 66 | } 67 | 68 | public String getDate1() 69 | { 70 | return date; 71 | } 72 | 73 | public void setDate1(String date) 74 | { 75 | this.date=date; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/CommonMethods.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.content.Context; 4 | import android.database.Cursor; 5 | import android.net.Uri; 6 | import android.os.Environment; 7 | import android.provider.ContactsContract; 8 | import android.support.v4.content.FileProvider; 9 | import android.util.Log; 10 | 11 | import java.io.File; 12 | import java.util.Calendar; 13 | 14 | /** 15 | * Created by VS00481543 on 31-10-2017. 16 | */ 17 | 18 | public class CommonMethods { 19 | 20 | final String TAGCM="Inside Service"; 21 | Calendar cal=Calendar.getInstance(); 22 | 23 | public String getDate() 24 | { 25 | int year=cal.get(Calendar.YEAR); 26 | int month=cal.get(Calendar.MONTH)+1; 27 | int day=cal.get(Calendar.DATE); 28 | String date=String.valueOf(day)+"_"+String.valueOf(month)+"_"+String.valueOf(year); 29 | 30 | Log.d(TAGCM, "Date "+date); 31 | return date; 32 | } 33 | 34 | 35 | public String getTIme() 36 | { 37 | String am_pm=""; 38 | int sec=cal.get(Calendar.SECOND); 39 | int min=cal.get(Calendar.MINUTE); 40 | int hr=cal.get(Calendar.HOUR); 41 | int amPm=cal.get(Calendar.AM_PM); 42 | if(amPm==1) 43 | am_pm="PM"; 44 | else if(amPm==0) 45 | am_pm="AM"; 46 | 47 | String time=String.valueOf(hr)+":"+String.valueOf(min)+":"+String.valueOf(sec)+" "+am_pm; 48 | 49 | Log.d(TAGCM, "Date "+time); 50 | return time; 51 | } 52 | 53 | public String getPath() 54 | { 55 | String internalFile=getDate(); 56 | File file=new File(Environment.getExternalStorageDirectory()+"/My Records/"); 57 | File file1=new File(Environment.getExternalStorageDirectory()+"/My Records/"+internalFile+"/"); 58 | if(!file.exists()) 59 | { 60 | file.mkdir(); 61 | } 62 | if(!file1.exists()) 63 | file1.mkdir(); 64 | 65 | 66 | String path=file1.getAbsolutePath(); 67 | Log.d(TAGCM, "Path "+path); 68 | 69 | return path; 70 | } 71 | 72 | public String getContactName(final String number,Context context) 73 | { 74 | Uri uri=Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI,Uri.encode(number)); 75 | String[] projection=new String[]{ContactsContract.PhoneLookup.DISPLAY_NAME}; 76 | String contactName=""; 77 | Cursor cursor=context.getContentResolver().query(uri,projection,null,null,null); 78 | if (cursor != null) { 79 | if(cursor.moveToFirst()) { 80 | contactName=cursor.getString(0); 81 | } 82 | cursor.close(); 83 | } 84 | 85 | if(contactName!=null && !contactName.equals("")) 86 | return contactName; 87 | else 88 | return ""; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/DatabaseHandler.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteOpenHelper; 6 | 7 | /** 8 | * Created by VS00481543 on 01-11-2017. 9 | */ 10 | 11 | public class DatabaseHandler extends SQLiteOpenHelper { 12 | 13 | private static final int DATABASE_VERSION = 2; 14 | public static final String DATABASE_NAME = "callRecords"; 15 | public static final String TABLE_RECORD = "callRecord"; 16 | public static final String SERIAL_NUMBER= "serialNumber"; 17 | public static final String PHONE_NUMBER ="phoneNumber"; 18 | // public static final String CONTACT_NAME="contactName"; 19 | public static final String TIME = "time"; 20 | public static final String DATE = "date"; 21 | 22 | 23 | public DatabaseHandler(Context context) 24 | { 25 | super(context,DATABASE_NAME,null,DATABASE_VERSION); 26 | } 27 | 28 | @Override 29 | public void onCreate(SQLiteDatabase db) { 30 | 31 | String CREATE_LOG_TABLE="CREATE TABLE " + TABLE_RECORD + "(" 32 | + SERIAL_NUMBER + " INTEGER PRIMARY KEY,"+ PHONE_NUMBER + " TEXT," + TIME + " TEXT," 33 | + DATE + " TEXT" + ")"; 34 | 35 | db.execSQL(CREATE_LOG_TABLE); 36 | } 37 | 38 | @Override 39 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 40 | 41 | db.execSQL("DROP TABLE IF EXISTS " + TABLE_RECORD); 42 | onCreate(db); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/DatabaseManager.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.app.Activity; 4 | import android.content.ContentValues; 5 | import android.content.Context; 6 | import android.database.Cursor; 7 | import android.database.sqlite.SQLiteDatabase; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | /** 13 | * Created by VS00481543 on 07-11-2017. 14 | */ 15 | // Will be performing all actions on database. 16 | public class DatabaseManager { 17 | 18 | SQLiteDatabase sqLiteDatabase; 19 | 20 | public DatabaseManager(Context activity) { 21 | sqLiteDatabase = DatabaseSingleton.getInstance(activity); 22 | } 23 | 24 | public void addCallDetails(CallDetails callDetails) { 25 | 26 | 27 | ContentValues values = new ContentValues(); 28 | values.put(DatabaseHandler.SERIAL_NUMBER, callDetails.getSerial()); 29 | values.put(DatabaseHandler.PHONE_NUMBER, callDetails.getNum()); 30 | // values.put(DatabaseHandler.CONTACT_NAME,callDetails.getName()); 31 | values.put(DatabaseHandler.TIME, callDetails.getTime1()); 32 | values.put(DatabaseHandler.DATE, callDetails.getDate1()); 33 | 34 | sqLiteDatabase.insert(DatabaseHandler.TABLE_RECORD, null, values); 35 | } 36 | 37 | 38 | public List getAllDetails() { 39 | List recordList = new ArrayList<>(); 40 | String selectQuery = "SELECT * FROM " + DatabaseHandler.TABLE_RECORD; 41 | 42 | Cursor cursor = sqLiteDatabase.rawQuery(selectQuery, null); 43 | 44 | if (cursor.moveToFirst()) { 45 | do { 46 | CallDetails callDetails = new CallDetails(); 47 | callDetails.setSerial(cursor.getInt(0)); 48 | callDetails.setNum(cursor.getString(1)); 49 | // callDetails.setName(cursor.getString(2)); 50 | callDetails.setTime1(cursor.getString(2)); 51 | callDetails.setDate1(cursor.getString(3)); 52 | 53 | recordList.add(callDetails); 54 | } while (cursor.moveToNext()); 55 | } 56 | 57 | return recordList; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/DatabaseSingleton.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.database.sqlite.SQLiteDatabase; 6 | 7 | /** 8 | * Created by VS00481543 on 07-11-2017. 9 | */ 10 | 11 | public class DatabaseSingleton { 12 | public static SQLiteDatabase database; 13 | 14 | public static SQLiteDatabase getInstance(Context activity){ 15 | if(database==null) 16 | database = new DatabaseHandler(activity).getWritableDatabase(); 17 | return database; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/GenericFileProvider.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.support.v4.content.FileProvider; 4 | 5 | /** 6 | * Created by VS00481543 on 14-12-2017. 7 | */ 8 | 9 | public class GenericFileProvider extends FileProvider { 10 | 11 | 12 | public GenericFileProvider() { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.Manifest; 4 | import android.app.Activity; 5 | import android.content.Context; 6 | import android.content.SharedPreferences; 7 | import android.content.pm.PackageManager; 8 | import android.os.Build; 9 | import android.os.StrictMode; 10 | import android.preference.PreferenceManager; 11 | import android.support.v4.app.ActivityCompat; 12 | import android.support.v4.content.ContextCompat; 13 | import android.support.v4.content.FileProvider; 14 | import android.support.v7.app.AppCompatActivity; 15 | import android.os.Bundle; 16 | import android.support.v7.widget.DefaultItemAnimator; 17 | import android.support.v7.widget.LinearLayoutManager; 18 | import android.support.v7.widget.RecyclerView; 19 | import android.support.v7.widget.SwitchCompat; 20 | import android.util.Log; 21 | import android.view.Menu; 22 | import android.view.MenuItem; 23 | import android.view.View; 24 | import android.widget.CompoundButton; 25 | import android.widget.Switch; 26 | import android.widget.Toast; 27 | 28 | import java.lang.reflect.Method; 29 | import java.util.ArrayList; 30 | import java.util.Collections; 31 | import java.util.List; 32 | 33 | public class MainActivity extends AppCompatActivity { 34 | 35 | DatabaseHandler db=new DatabaseHandler(this); 36 | final static String TAGMA="Main Activity"; 37 | RecordAdapter rAdapter; 38 | RecyclerView recycler; 39 | List callDetailsList; 40 | boolean checkResume=false; 41 | 42 | @Override 43 | protected void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | setContentView(R.layout.activity_main); 46 | 47 | /*StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); 48 | StrictMode.setVmPolicy(builder.build());*/ 49 | 50 | /* if(Build.VERSION.SDK_INT>=24){ 51 | try{ 52 | Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure"); 53 | m.invoke(null); 54 | }catch(Exception e){ 55 | e.printStackTrace(); 56 | } 57 | }*/ 58 | 59 | SharedPreferences pref= PreferenceManager.getDefaultSharedPreferences(this); 60 | pref.edit().putInt("numOfCalls",0).apply(); 61 | 62 | // pref.edit().putInt("serialNumData", 1).apply(); 63 | 64 | //rAdapter.notifyDataSetChanged(); 65 | } 66 | 67 | @Override 68 | protected void onResume() { 69 | super.onResume(); 70 | Log.e("Check", "onResume: "); 71 | if(checkPermission()) { 72 | Toast.makeText(getApplicationContext(), "Permission already granted", Toast.LENGTH_LONG).show(); 73 | if(checkResume==false) { 74 | setUi(); 75 | // this.callDetailsList=new DatabaseManager(this).getAllDetails(); 76 | rAdapter.notifyDataSetChanged(); 77 | } 78 | } 79 | } 80 | 81 | protected void onPause() 82 | { 83 | super.onPause(); 84 | SharedPreferences pref3=PreferenceManager.getDefaultSharedPreferences(this); 85 | if(pref3.getBoolean("pauseStateVLC",false)) { 86 | checkResume = true; 87 | pref3.edit().putBoolean("pauseStateVLC",false).apply(); 88 | } 89 | else 90 | checkResume=false; 91 | } 92 | 93 | public boolean onCreateOptionsMenu(Menu menu) 94 | { 95 | getMenuInflater().inflate(R.menu.mainmenu,menu); 96 | MenuItem item=menu.findItem(R.id.mySwitch); 97 | 98 | View view = getLayoutInflater().inflate(R.layout.switch_layout,null,false) ; 99 | 100 | final SharedPreferences pref1= PreferenceManager.getDefaultSharedPreferences(this); 101 | 102 | SwitchCompat switchCompat = (SwitchCompat) view.findViewById(R.id.switchCheck); 103 | switchCompat.setChecked(pref1.getBoolean("switchOn",true)); 104 | switchCompat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 105 | @Override 106 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 107 | if (isChecked){ 108 | Log.d("Switch", "onCheckedChanged: " +isChecked); 109 | Toast.makeText(getApplicationContext(), "Call Recorder ON", Toast.LENGTH_LONG).show(); 110 | pref1.edit().putBoolean("switchOn",isChecked).apply(); 111 | }else{ 112 | Log.d("Switch", "onCheckedChanged: " +isChecked); 113 | Toast.makeText(getApplicationContext(), "Call Recorder OFF", Toast.LENGTH_LONG).show(); 114 | pref1.edit().putBoolean("switchOn",isChecked).apply(); 115 | } 116 | } 117 | }); 118 | item.setActionView(view); 119 | return true; 120 | } 121 | 122 | public void setUi() 123 | { 124 | recycler=(RecyclerView) findViewById(R.id.recyclerView); 125 | callDetailsList=new DatabaseManager(this).getAllDetails(); 126 | 127 | for(CallDetails cd:callDetailsList) 128 | { 129 | String log="Phone num : "+cd.getNum()+" | Time : "+cd.getTime1()+" | Date : "+cd.getDate1(); 130 | Log.d("Database ", log); 131 | } 132 | 133 | Collections.reverse(callDetailsList); 134 | rAdapter=new RecordAdapter(callDetailsList,this); 135 | LinearLayoutManager layoutManager=new LinearLayoutManager(getApplicationContext()); 136 | recycler.setLayoutManager(layoutManager); 137 | recycler.setItemAnimator(new DefaultItemAnimator()); 138 | recycler.setAdapter(rAdapter); 139 | 140 | } 141 | 142 | 143 | private boolean checkPermission() 144 | { 145 | int i=0; 146 | String[] perm={Manifest.permission.READ_PHONE_STATE,Manifest.permission.RECORD_AUDIO,Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_CONTACTS}; 147 | List reqPerm=new ArrayList<>(); 148 | 149 | for(String permis:perm) { 150 | int resultPhone = ContextCompat.checkSelfPermission(MainActivity.this,permis); 151 | if(resultPhone== PackageManager.PERMISSION_GRANTED) 152 | i++; 153 | else { 154 | reqPerm.add(permis); 155 | } 156 | } 157 | 158 | if(i==5) 159 | return true; 160 | else 161 | return requestPermission(reqPerm); 162 | } 163 | 164 | 165 | 166 | private boolean requestPermission(List perm) 167 | { 168 | // String[] permissions={Manifest.permission.READ_PHONE_STATE,Manifest.permission.RECORD_AUDIO,Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE}; 169 | 170 | String[] listReq=new String[perm.size()]; 171 | listReq=perm.toArray(listReq); 172 | for(String permissions:listReq) { 173 | if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,permissions)) { 174 | Toast.makeText(getApplicationContext(), "Phone Permissions needed for " + permissions, Toast.LENGTH_LONG); 175 | } 176 | } 177 | 178 | ActivityCompat.requestPermissions(MainActivity.this, listReq, 1); 179 | 180 | 181 | return false; 182 | } 183 | 184 | 185 | public void onRequestPermissionsResult(int requestCode,String permissions[],int[] grantResults) 186 | { 187 | switch(requestCode) 188 | { 189 | case 1: 190 | if(grantResults.length>0 && grantResults[0]==PackageManager.PERMISSION_GRANTED) 191 | Toast.makeText(getApplicationContext(),"Permission Granted to access Phone calls",Toast.LENGTH_LONG); 192 | else 193 | Toast.makeText(getApplicationContext(),"You can't access Phone calls",Toast.LENGTH_LONG); 194 | break; 195 | } 196 | 197 | } 198 | 199 | } 200 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/PhoneStateReceiver.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.media.MediaRecorder; 8 | import android.os.Bundle; 9 | import android.os.Environment; 10 | import android.preference.PreferenceManager; 11 | import android.provider.ContactsContract; 12 | import android.provider.Settings; 13 | import android.provider.Telephony; 14 | import android.telephony.TelephonyManager; 15 | import android.util.Log; 16 | import android.widget.Toast; 17 | 18 | import java.io.File; 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | /** 23 | * Created by VS00481543 on 25-10-2017. 24 | */ 25 | 26 | public class PhoneStateReceiver extends BroadcastReceiver { 27 | 28 | static final String TAG="State"; 29 | static final String TAG1=" Inside State"; 30 | static Boolean recordStarted; 31 | public static String phoneNumber; 32 | public static String name; 33 | 34 | @Override 35 | public void onReceive(Context context, Intent intent) { 36 | SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); 37 | 38 | Boolean switchCheckOn = pref.getBoolean("switchOn", true); 39 | if (switchCheckOn) { 40 | try { 41 | System.out.println("Receiver Start"); 42 | 43 | // boolean callWait=pref.getBoolean("recordStarted",false); 44 | Bundle extras = intent.getExtras(); 45 | String state = extras.getString(TelephonyManager.EXTRA_STATE); 46 | Log.d(TAG, " onReceive: " + state); 47 | Toast.makeText(context, "Call detected(Incoming/Outgoing) " + state, Toast.LENGTH_SHORT).show(); 48 | 49 | if (extras != null) { 50 | if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) { 51 | Log.d(TAG1, " Inside " + state); 52 | /*int j=pref.getInt("numOfCalls",0); 53 | pref.edit().putInt("numOfCalls",++j).apply(); 54 | Log.d(TAG, "onReceive: num of calls "+ pref.getInt("numOfCalls",0));*/ 55 | } else if (state.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)/*&& pref.getInt("numOfCalls",1)==1*/) { 56 | 57 | int j = pref.getInt("numOfCalls", 0); 58 | pref.edit().putInt("numOfCalls", ++j).apply(); 59 | Log.d(TAG, "onReceive: num of calls " + pref.getInt("numOfCalls", 0)); 60 | 61 | Log.d(TAG1, " recordStarted in offhook: " + recordStarted); 62 | Log.d(TAG1, " Inside " + state); 63 | 64 | phoneNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER); 65 | 66 | Log.d(TAG1, " Phone Number in receiver " + phoneNumber); 67 | 68 | if (pref.getInt("numOfCalls", 1) == 1) { 69 | Intent reivToServ = new Intent(context, RecorderService.class); 70 | reivToServ.putExtra("number", phoneNumber); 71 | context.startService(reivToServ); 72 | 73 | //name=new CommonMethods().getContactName(phoneNumber,context); 74 | 75 | int serialNumber = pref.getInt("serialNumData", 1); 76 | new DatabaseManager(context).addCallDetails(new CallDetails(serialNumber, phoneNumber, new CommonMethods().getTIme(), new CommonMethods().getDate())); 77 | 78 | List list = new DatabaseManager(context).getAllDetails(); 79 | for (CallDetails cd : list) { 80 | String log = "Serial Number : " + cd.getSerial() + " | Phone num : " + cd.getNum() + " | Time : " + cd.getTime1() + " | Date : " + cd.getDate1(); 81 | Log.d("Database ", log); 82 | } 83 | 84 | 85 | //recordStarted=true; 86 | pref.edit().putInt("serialNumData", ++serialNumber).apply(); 87 | pref.edit().putBoolean("recordStarted", true).apply(); 88 | } 89 | 90 | } else if (state.equals(TelephonyManager.EXTRA_STATE_IDLE)) { 91 | int k = pref.getInt("numOfCalls", 1); 92 | pref.edit().putInt("numOfCalls", --k).apply(); 93 | int l = pref.getInt("numOfCalls", 0); 94 | Log.d(TAG1, " Inside " + state); 95 | recordStarted = pref.getBoolean("recordStarted", false); 96 | Log.d(TAG1, " recordStarted in idle :" + recordStarted); 97 | if (recordStarted && l == 0) { 98 | Log.d(TAG1, " Inside to stop recorder " + state); 99 | 100 | context.stopService(new Intent(context, RecorderService.class)); 101 | 102 | pref.edit().putBoolean("recordStarted", false).apply(); 103 | } 104 | 105 | } 106 | } 107 | 108 | } catch (Exception e) { 109 | e.printStackTrace(); 110 | } 111 | 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/RecordAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.media.MediaPlayer; 7 | import android.net.Uri; 8 | import android.os.Environment; 9 | import android.preference.PreferenceManager; 10 | import android.support.v4.content.FileProvider; 11 | import android.support.v7.widget.RecyclerView; 12 | import android.util.Log; 13 | import android.view.LayoutInflater; 14 | import android.view.View; 15 | import android.view.ViewGroup; 16 | import android.widget.TextView; 17 | import android.widget.Toast; 18 | 19 | import java.io.File; 20 | import java.io.FileInputStream; 21 | import java.io.IOException; 22 | import java.util.List; 23 | 24 | import static android.support.v4.content.FileProvider.getUriForFile; 25 | 26 | /** 27 | * Created by VS00481543 on 03-11-2017. 28 | */ 29 | 30 | public class RecordAdapter extends RecyclerView.Adapter { 31 | 32 | List callDetails; 33 | Context context; 34 | SharedPreferences pref; 35 | String checkDate = ""; 36 | 37 | public RecordAdapter(List callDetails, Context context) { 38 | this.callDetails = callDetails; 39 | this.context = context; 40 | pref = PreferenceManager.getDefaultSharedPreferences(context); 41 | } 42 | 43 | public class MyViewHolder extends RecyclerView.ViewHolder { 44 | TextView number, time, date,name; 45 | 46 | public MyViewHolder(View itemView) { 47 | super(itemView); 48 | date = (TextView) itemView.findViewById(R.id.date1); 49 | name = (TextView) itemView.findViewById(R.id.name1); 50 | number = (TextView) itemView.findViewById(R.id.num); 51 | time = (TextView) itemView.findViewById(R.id.time1); 52 | } 53 | 54 | public void bind(final String dates, final String number, final String times) { 55 | itemView.setOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | 59 | Toast.makeText(context, "Clicked on " + number, Toast.LENGTH_SHORT).show(); 60 | 61 | String path = Environment.getExternalStorageDirectory() + "/My Records/" + dates + "/" + number + "_" + times + ".mp4" ; 62 | Log.d("path", "onClick: "+path); 63 | // Uri uri = Uri.parse(path); 64 | Intent intent = new Intent(Intent.ACTION_VIEW); 65 | File file = new File(path); 66 | // intent.setDataAndType(Uri.fromFile(file), "audio/*"); 67 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 68 | intent.setDataAndType(getUriForFile(context,"com.example.vs00481543.phonecallrecorder",file), "audio/*"); 69 | context.startActivity(intent); 70 | 71 | pref.edit().putBoolean("pauseStateVLC",true).apply(); 72 | 73 | /*FileInputStream fis=null; 74 | MediaPlayer mp=new MediaPlayer(); 75 | try { 76 | fis=new FileInputStream(path); 77 | mp.setDataSource(fis.getFD()); 78 | fis.close(); 79 | mp.prepare(); 80 | } catch (IOException e) { 81 | e.printStackTrace(); 82 | } 83 | mp.start(); 84 | mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 85 | @Override 86 | public void onCompletion(MediaPlayer mp) { 87 | mp.stop(); 88 | } 89 | });*/ 90 | } 91 | }); 92 | } 93 | } 94 | 95 | @Override 96 | public RecordAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 97 | 98 | MyViewHolder viewHolder = null; 99 | LayoutInflater layoutInflator = LayoutInflater.from(parent.getContext()); 100 | 101 | switch (viewType) { 102 | case 0: 103 | View v1 = layoutInflator.inflate(R.layout.record_list, parent, false); 104 | viewHolder = new MyViewHolder(v1); 105 | break; 106 | /*case 1: 107 | View v2 = layoutInflator.inflate(R.layout.record_noname_list, parent, false); 108 | viewHolder = new MyViewHolder(v2); 109 | break;*/ 110 | case 2: 111 | View v3 = layoutInflator.inflate(R.layout.date_layout, parent, false); 112 | viewHolder = new MyViewHolder(v3); 113 | break; 114 | /*case 3: 115 | View v4 = layoutInflator.inflate(R.layout.date_noname_layout, parent, false); 116 | viewHolder = new MyViewHolder(v4); 117 | break;*/ 118 | } 119 | return viewHolder; 120 | } 121 | 122 | @Override 123 | public void onBindViewHolder(RecordAdapter.MyViewHolder holder, int position) { 124 | 125 | CallDetails cd1 = callDetails.get(position); 126 | String n=cd1.getNum(); 127 | String name=new CommonMethods().getContactName(n,context); 128 | String name2="Unknown"; 129 | Log.d("Names", "onBindViewHolder: "+name); 130 | holder.bind(cd1.getDate1(), cd1.getNum(), cd1.getTime1()); 131 | switch (getItemViewType(position)) { 132 | case 0: 133 | if(name!=null && !name.equals("")) { 134 | holder.name.setText(name); 135 | holder.name.setTextColor(context.getResources().getColor(R.color.colorPrimaryDark)); 136 | } 137 | else { 138 | holder.name.setText(name2); 139 | holder.name.setTextColor(context.getResources().getColor(R.color.red)); 140 | } 141 | holder.number.setText(callDetails.get(position).getNum()); 142 | holder.time.setText(callDetails.get(position).getTime1()); 143 | break; 144 | /*case 1: 145 | holder.number.setText(callDetails.get(position).getNum()); 146 | holder.time.setText(callDetails.get(position).getTime1()); 147 | break;*/ 148 | case 2: 149 | holder.date.setText(callDetails.get(position).getDate1()); 150 | if(name!=null && !name.equals("")) { 151 | holder.name.setText(name); 152 | holder.name.setTextColor(context.getResources().getColor(R.color.colorPrimaryDark)); 153 | } 154 | else { 155 | holder.name.setText(name2); 156 | holder.name.setTextColor(context.getResources().getColor(R.color.red)); 157 | } 158 | holder.number.setText(callDetails.get(position).getNum()); 159 | holder.time.setText(callDetails.get(position).getTime1()); 160 | break; 161 | /*case 3: 162 | holder.date.setText(callDetails.get(position).getDate1()); 163 | holder.number.setText(callDetails.get(position).getNum()); 164 | holder.time.setText(callDetails.get(position).getTime1()); 165 | break;*/ 166 | } 167 | } 168 | 169 | @Override 170 | public int getItemCount() { 171 | return callDetails.size(); 172 | } 173 | 174 | public int getItemViewType(int position) { 175 | CallDetails cd = callDetails.get(position); 176 | String dt = cd.getDate1(); 177 | Log.d("Adapter", "getItemViewType: " + dt); 178 | Log.d("Adapter", "getItemViewType: " + pref.getString("date", "")); 179 | // String checkDate=pref.getString("date",""); 180 | 181 | try { 182 | if (position!=0 && cd.getDate1().equalsIgnoreCase(callDetails.get(position - 1).getDate1())) { 183 | checkDate = dt; 184 | //pref.edit().putString("date",dt).apply(); 185 | Log.d("Adapter", "getItemViewType: in if condition" + pref.getString("date", "")); 186 | return 0; 187 | /*if(name1!=null && !name1.equals("")) 188 | return 0; 189 | else 190 | return 1;*/ 191 | } else { 192 | checkDate = dt; 193 | //pref.edit().putString("date",dt).apply(); 194 | Log.d("Adapter", "getItemViewType: in else condition" + pref.getString("date", "")); 195 | /* if(name1!=null && !name1.equals("")) 196 | return 2; 197 | else 198 | return 3;*/ 199 | return 2; 200 | } 201 | } catch (Exception e) { 202 | e.printStackTrace(); 203 | return 2; 204 | } 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vs00481543/phonecallrecorder/RecorderService.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.media.MediaRecorder; 7 | import android.os.IBinder; 8 | import android.preference.PreferenceManager; 9 | import android.support.annotation.Nullable; 10 | import android.util.Log; 11 | 12 | import java.io.IOException; 13 | 14 | /** 15 | * Created by VS00481543 on 30-10-2017. 16 | */ 17 | 18 | public class RecorderService extends Service { 19 | 20 | MediaRecorder recorder; 21 | static final String TAGS=" Inside Service"; 22 | 23 | @Nullable 24 | @Override 25 | public IBinder onBind(Intent intent) { 26 | return null; 27 | } 28 | 29 | public int onStartCommand(Intent intent,int flags,int startId) 30 | { 31 | recorder = new MediaRecorder(); 32 | recorder.reset(); 33 | 34 | String phoneNumber=intent.getStringExtra("number"); 35 | Log.d(TAGS, "Phone number in service: "+phoneNumber); 36 | 37 | String time=new CommonMethods().getTIme(); 38 | 39 | String path=new CommonMethods().getPath(); 40 | 41 | String rec=path+"/"+phoneNumber+"_"+time+".mp4"; 42 | 43 | recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 44 | recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); 45 | recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); 46 | 47 | recorder.setOutputFile(rec); 48 | 49 | try { 50 | recorder.prepare(); 51 | } catch (IOException e) { 52 | e.printStackTrace(); 53 | } 54 | recorder.start(); 55 | 56 | Log.d(TAGS, "onStartCommand: "+"Recording started"); 57 | 58 | return START_NOT_STICKY; 59 | } 60 | 61 | public void onDestroy() 62 | { 63 | super.onDestroy(); 64 | 65 | recorder.stop(); 66 | recorder.reset(); 67 | recorder.release(); 68 | recorder=null; 69 | 70 | Log.d(TAGS, "onDestroy: "+"Recording stopped"); 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/phone_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/phone_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/date_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 15 | 24 | 25 | 26 | 27 | 28 | 34 | 35 | 39 | 40 | 46 | 47 | 55 | 56 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /app/src/main/res/layout/date_noname_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | 17 | 18 | 22 | 23 | 30 | 31 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/record_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 18 | 19 | 25 | 26 | 34 | 35 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/record_noname_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | 17 | 18 | 22 | 23 | 24 | 31 | 32 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/switch_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/menu/mainmenu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/phone_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-hdpi/phone_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/phone_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-mdpi/phone_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/phone_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xhdpi/phone_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/phone_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xxhdpi/phone_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/phone_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/app/src/main/res/mipmap-xxxhdpi/phone_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #666666 6 | 7 | #666666 8 | #000000 9 | #ffffff 10 | #B22222 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Phone Call Recorder 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/vs00481543/phonecallrecorder/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.vs00481543.phonecallrecorder; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Fri Oct 27 11:49:48 IST 2017 16 | systemProp.http.proxyPort=8080 17 | systemProp.http.proxyUser=techmahindra\\vs00481543 18 | systemProp.http.proxyPassword=Samsung@123 19 | org.gradle.jvmargs=-Xmx1536m 20 | systemProp.https.proxyPassword=Samsung@123 21 | systemProp.https.proxyHost=10.13.125.13 22 | systemProp.http.proxyHost=10.13.125.13 23 | systemProp.https.proxyPort=8080 24 | systemProp.https.proxyUser=techmahindra\\vs00481543 25 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishal044/Call-Recorder/7efd4842ed052eb54aeed69ff83181935fc901ff/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 24 16:06:38 IST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------