UsageTracker README
##Installation:
- Set up AWS.
- This libary uses your own AWS account.
- Specifically, you will need to create your own instance of Amazon SimpleDB. You can create a domain prefix for the library to use if you have other SimpleDB projects.
- Import library.
- Download project and import into Eclipse.
- Mark as a library.
- In your project, add library to build path.
- A more detailed explanation can be found here.
- Set permissions in Manifest file.
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
- Add
Service
's andBroadcastReceiver
's to Manifest file.
<service android:name="com.samgavis.usagetracker.CallCacheService" />
<service android:name="com.samgavis.usagetracker.DataCacheService" />
<receiver android:name="com.samgavis.usagetracker.StartupReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name="com.samgavis.usagetracker.PhoneStateReceiver">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
- Subclass
PushService
- You must provide a
getSimpleDBClient()
method and ahandleError()
method. - You must start this service somehow. It is strongly recommended to use a
Startup BroadcastReceiver
to avoid storing too much data to the local database. You should also make sure to callsetServiceAlarm()
when the app is first opened.
- Construct
UsageTracker
to capture data.