Skip to content

Developer guide

Arnaud Vassellier edited this page Aug 28, 2017 · 22 revisions

Table of contents

  1. Installing Oracle Java JDK
  2. Installing Android SDK
  3. Building with Eclipse (with ADT Plugin)
  4. Building with Android Studio
  5. AC2RD Project

AC2RD can be built from source either using Eclipse (with ADT Plugin), or Android Studio.

Prerequisites: Oracle Java JDK and Android SDK are required.

Installing Oracle Java JDK

Installing Android SDK

  • Android SDK can be downloaded here: http://developer.android.com/sdk/index.html
  • Retrieve the Android SDK version for your operating system, and install it
  • Launch Android SDK Manager
  • If you are behind a proxy, then you need to configure it by selecting Tools > Options in the menu
  • Select which package you want to download by selecting the checkbox and then click Install (for the AC2RD project, i select Android SDK Tools, Android SDK Platform-tools, and the SDK Platform of the latest API which is version 25, but also Android Support Repository/Library in Extras category)

Building with Eclipse (with ADT Plugin)

  • Eclipse can be downloaded here: http://www.eclipse.org/downloads/ (for the AC2RD project, i used the following version: eclipse-SDK-4.4.2-linux-gtk downloadable here: http://archive.eclipse.org/eclipse/downloads/drops4/R-4.4.2-201502041700/)
  • ADT Plugin can be downloaded here: https://developer.android.com/studio/tools/sdk/eclipse-adt.html (for the AC2RD project, i used the following version: ADT-23.0.7 downloadable here: https://dl.google.com/android/ADT-23.0.7.zip)
  • Start Eclipse, then select Help > Install New Software
  • Click Add, in the top-right corner
  • In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ (or click Archive, and select the offline ADT Plugin archive), then click OK
  • In the Available Software dialog, select the checkbox next to Developer Tools and click Next
  • In the next window, you'll see a list of the tools to be downloaded, then click Next
  • Read and accept the license agreements, then click Finish
  • When the installation completes, restart Eclipse
  • In the "Welcome to Android Development" window that appears, select Use existing SDKs (if window that not appears, select Window > Preferences, and click Android)
  • Browse and select the location of the Android SDK directory you recently downloaded and unpacked, then click Next
  • Select File > New > Project
  • Select Android Project from Existing Code, then click Next
  • Browse and select the location of the Android Support V7 AppCompat directory (in the Extras directory of the Android SDK.), then click OK and Finish
  • Extract the AC2RD source code in your eclipse workspace
  • Select File > New > Project
  • Select Android Project from Existing Code, then click Next
  • Browse and select the location of the AC2RD source code directory, then click OK and Finish
  • Select Project > Properties
  • Select Android, and add the android-support-v7-appcompat library, then click Apply
  • Always in properties, select Java Build Path > Libraries, and uncheck Android Private Libraries, then add android-support-v4.jar and android-support-v7.jar (these files are located in the Extras directory of the Android SDK)
  • Now you can build the AC2RD software by selecting the AC2RD project in eclipse, and selecting Run > Run As > Android Application

Building with Android Studio

Coming soon

AC2RD Project

Src folder

Contains classes : Acquitment.java (activity requesting user acceptance of software license), Main.java (the main activity includes, through a tabhost, two other activities: Home.java and Records.java), and SplashScreen.java (the entry point of the software, it displays a short animation including the name of the AC2RD software).

Package .database

Contains classes : DatabaseDefinition.java (defines the names of tables and columns of the database), DatabaseManager.java (contains methods for querying the database), and DatabaseProvider.java (the database provider for a SQLite database).

Package .filters

Contains classes : Filters.java (activity to see and interact with the list of call filters), and FiltersManager.java (contains methods for managing call filters).

Package .localizer

Contains classes : LocalizerManager.java (manages the language to be used in the AC2RD software).

Package .main

Contains classes : About.java (PreferenceActivity displaying the licenses used by the AC2RD software as well as details about its current version), Home.java (integrated into the tabhost of the Main.java class, it synthesizes the relevant information of the AC2RD software), Preferences.java (accessible from the slide bar, this is a PreferenceActivity allowing the setting of many options on the software), and Records.java (integrated into the tabhost of the Main.java class, this activity allows you to view all the records).

Package .main.description

Contains classes : Description.java (adding a text description to a record).

Package .main.license

Contains classes : License.java (accessible from About.java, this class displays the license used by the software: GNU GPL V3).

Package .main.logger

Contains classes : TelephoneCallLogger.java (accessible from the slide bar, this activity allows the display of AC2RD software logs).

Package .main.terms

Contains classes : Terms.java (accessible from About.java, this class displays the terms of use of the software).

Package .monitoring

Contains classes : MonitoringManager.java (methods for retrieving information about the use of system resources by the software), MonitoringService.java (resource monitoring service used by the software), MonitoringServiceManager.java (class to instrument the MonitoringService.java class), and IMonitoringService.aidl (interface of the MonitoringService.java class).

Package .notifier

Contains classes : TelephoneCallNotifier.java (methods handling different software notifications).

Package .purge

Contains classes : PurgeManager.java (methods to purge records to the database, and to the phone's memory), PurgeService.java (the purge service), PurgeServiceManager.java (class to instrument the PurgeService.java class), and IPurgeService.aidl (interface of the PurgeService.java class).

Package .receiver

Contains classes : TelephoneCallReceiver.java (BroadcastReceiver to monitor different phone states).

Package .recorder

Contains classes : RecordFileMaker.java (creates a new recording file), RecordFileWriter.java (saves the audio stream to a file), RecordService.java (the record service), RecordServiceManager.java (class to instrument the RecordService.java class), and IRecordService.aidl (interface of the RecordService.java class).

Package .replayer

Contains classes : Replayer.java (activity for replaying a telephone recording), ReplayFileDisplayer.java (Graphical display of the visualizer), ReplayFileReader.java (verifies that the file to be replayed is valid), and ReplayFileVisualizer.java (visualizer corresponding to the replayed record).

Package .sensor

Contains classes : ShakeDetector.java (methods for detecting shakes on the phone), ShakeDetectorService.java (the shake detector service), ShakeDetectorServiceManager.java (class to instrument the ShakeDetectorService.java class), and IShakeDetectorService.aidl (interface of the ShakeDetectorService.java class).

Package .theme

Contains classes : EditTextPreferenceThemeManager.java (redefinition of the EditTextPreference class), ListPreferenceThemeManager.java (redefinition of the ListPreference class), and ThemeManager.java (class to manage the visual theme of the AC2RD software).

Package .widget

Contains classes : WidgetProvider.java (provider of the AC2RD widget).

Res folder

TODO