Timesheet API is an Android library project which allows you to access the Timesheet ContentProvider
.
See https://timesheet.io for more information.
Add the API library to your build.gradle
dependencies.
dependencies {
compile 'com.rauscha.apps.timesheet:api:2.1.0'
}
You have to set two permissions to read from and write to the Timesheet Content Provider. Add the following permissions to your AndroidManifest.xml
:
<uses-permission android:name="com.rauscha.apps.timesheet.permission.READ_DATA" />
<uses-permission android:name="com.rauscha.apps.timesheet.permission.WRITE_DATA" />
Timesheet uses the ContentProvider. Just use one of the provided Data Queries to retrieve the data:
mProjectCursor = getContentResolver().query(
TimesheetUris.PROJECTS, // The content URI of projects
ProjectQuery.PROJECTION, // The columns to return for each row
null // Selection criteria
null, // Selection criteria
null); // Sort criteria
Use IntentUtils to start and stop the Timer. The API provides even more Actions.
if(mProjectCursor.moveToFirst()) {
// Start Timer
String projectId = mProjectCursor.getString(ProjectQuery.ID);
Uri projectUri = TimesheetUris.buildProjectUri(projectId);
IntentUtils.startTimer(this, projectUri);
}
You can get Timesheet at the Playstore: Timesheet - Time Tracker.
Copyright 2016 Florian Rauscha
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.