Giter VIP home page Giter VIP logo

trackworktime's Introduction

license last released build

Track Work Time

This app can track your work time easily! You can automate time tracking using geo-fencing functions (see below). You may also categorize each recorded interval by a predefined client/task and a free text. Of course, the list of clients/tasks can be edited to suit your needs, and the app has a widget for your home screen.

Additionally, if you wish, your flexible time account is taken care of: you always see how much you worked. You can also keep an eye on how much work time is left for today or for the current week (by a notification which you can enable).

The app enables you to modify the planned working time effortlessly - just tap on the date you want to edit in the main table.

You may provide the geo-coordinates or the Wi-Fi network name of your work place and the app can automatically clock you in while you are at work. This is done without using GPS, so your battery won't be emptied by this app. (You don't have to be connected to the WiFi network at work, it just has to be visible.)

You don't want to open the app for clocking in and out? No problem - there are at least three ways to do that: add the widget to your home screen, use launcher shortcuts (long press the app icon for that) or add a new quick settings tile to your panel by tapping on the pencil below and dragging the "Track Work Time" tile up which then can toggle your clocked-in state.

If you prefer to use other apps like LlamaLab Automate or Tasker for tracking your movements, that's fine - TWT can be triggered from other apps and just do the book-keeping of your work time. In this case, you have to create broadcast intents with the action org.zephyrsoft.trackworktime.ClockIn or org.zephyrsoft.trackworktime.ClockOut. When using ClockIn, you can also set the parameters task=... and text=... in the "extra" section of the intent so your events are more meaningful. Here are some screenshots to point out how it can be done in Automate: Flow overview, "Broadcast send" block arguments. You can also use the action org.zephyrsoft.trackworktime.StatusRequest to get the current state of TWT: is the user clocked in, and if so, with which task and how much time remains for today? Here's how you can use this in Automate: Flow overview, "Send broadcast" settings top, "Send broadcast" settings bottom, "Receive broadcast" settings top, "Receive broadcast" settings bottom, "Dialog message" settings, resulting message.

It's also possible the other way around: TWT generates broadcast intents on event creation/update/deletion. Automation apps can listen for the actions org.zephyrsoft.trackworktime.event.Created, org.zephyrsoft.trackworktime.event.Updated and org.zephyrsoft.trackworktime.event.Deleted.
There are the following extras available: id (number uniquely identifying an event), date (the event's date, formatted YYYY-MM-DD), time (the event's time, formatted HH:MM:SS), timezone_offset (offset in standard format, e.g. +02:00), timezone_offset_minutes (offset in minutes, e.g. 120), type_id (number uniquely identifying the event's type, 0=clock-out / 1=clock-in), type (name of the event's type, CLOCK_IN or CLOCK_OUT), task_id (number uniquely identifying the event's task, not available on clock-out events), task (name of the event's task, not available on clock-out events), comment (only available if the user provided it), source (where the event was generated originally, possible values are MAIN_SCREEN_BUTTON, EVENT_LIST, QUICK_SETTINGS, LAUNCHER_SHORTCUT, MULTI_INSERT, AUTO_PAUSE, LOCATION, WIFI, RECEIVED_INTENT [includes both externally created broadcasts and actions from TWT's own widget and notification]).
Some screenshots so you can see it in action in Automate: Flow overview, "Receive Broadcast" settings top, "Receive Broadcast" settings bottom, "Dialog Message" settings, Result 1, Result 2.

If you have a Pebble smart watch, the app can notify you on clock-in and clock-out events which is especially useful if you want to be in the know about automatic time tracking via location and/or WiFi.

For other smart watches you can enable some options regarding notifications to help you. Firstly, you can enable the notification generally. Without any other related option, this will only display a notification on your phone in case you're clocked in. To also display this notification on your phone when not clocked in, select to always show it. Now, if you want it also on your watch, you also have to switch notifications to non-persistent (otherwise Android won't synchronize them). This is kind of a compromise because with this option notifications won't be pinned at the top of the list and also can be closed unintentionally (but will be displayed again after a minute). In addition you can silence all notifications so you are not distracted by them (this will be applied on your watch as well as on your phone, Android doesn't differentiate here).

Finally, the app can generate reports for you. The raw events report is the right thing if you want to import your data somewhere else, while year/month/week reports are fine if you want to keep track of your task progress.

Important note: This app definitely won't use your personal data for anything you don't want! If the app crashes, it will offer you to send some information about the crash circumstances to the developer (and does that only if you agree, you will be asked every time). The app does NOT include tracked times or places in the bug report, but the general log file is appended and might potentially include personal data - if so, it will be kept strictly confidential and only used to identify the problem.

Get it on F-Droid Get it on Google Play Get it on Amazon Appstore

You can track the past development by looking at the version history.

This is an open source project, so if there's something you don't like, you are very welcome to file an issue or even fix things yourself and create a pull request. Please don't try to communicate with me via reviews, that doesn't work in both directions. You can always write me an email and I'll see what I can do.

trackworktime's People

Contributors

bebopcl avatar dependabot[bot] avatar dirkmb avatar dliw avatar github-actions[bot] avatar hadrienbecle avatar jonaotto avatar mathisdt avatar niyumard avatar prosenb avatar wildorangutan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trackworktime's Issues

reconfigure ACRA

ACRA should show a dialog or notification when a crash has happened

Report: Not working on oreo

Reports export has stopped working when my phone was updated to oreo version.

Reproduce:

  1. Select reports
  2. Choose any report type (e.g. "last" + "month")
  3. Click any export button (e.g. "all events")
  4. Nothing happens

Device info:

  • Model: LG G6
  • Android: 8.0.0

Stack trace of error:

06-04 08:05:45.442 27503-27503/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.zephyrsoft.trackworktime, PID: 27503
    android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/org.zephyrsoft.trackworktime/files/trackworktime/reports/events-last-month-generated-at-2018-06-04-08-05-45.csv exposed beyond app through ClipData.Item.getUri()
        at android.os.StrictMode.onFileUriExposed(StrictMode.java:1958)
        at android.net.Uri.checkFileUriExposed(Uri.java:2359)
        at android.content.ClipData.prepareToLeaveProcess(ClipData.java:941)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9756)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9762)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9741)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1611)
        at android.app.Activity.startActivityForResult(Activity.java:4479)
        at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
        at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
        at android.app.Activity.startActivityForResult(Activity.java:4437)
        at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:856)
        at android.app.Activity.startActivity(Activity.java:4798)
        at android.app.Activity.startActivity(Activity.java:4766)
        at org.zephyrsoft.trackworktime.ReportsActivity$1.onClick(ReportsActivity.java:125)
        at android.view.View.performClick(View.java:6274)
        at android.view.View$PerformClick.run(View.java:24859)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6710)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
06-04 08:05:45.442 27503-27503/? E/ACRA: ACRA caught a FileUriExposedException for org.zephyrsoft.trackworktime
    android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/org.zephyrsoft.trackworktime/files/trackworktime/reports/events-last-month-generated-at-2018-06-04-08-05-45.csv exposed beyond app through ClipData.Item.getUri()
        at android.os.StrictMode.onFileUriExposed(StrictMode.java:1958)
        at android.net.Uri.checkFileUriExposed(Uri.java:2359)
        at android.content.ClipData.prepareToLeaveProcess(ClipData.java:941)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9756)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9762)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9741)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1611)
        at android.app.Activity.startActivityForResult(Activity.java:4479)
        at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
        at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
        at android.app.Activity.startActivityForResult(Activity.java:4437)
        at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:856)
        at android.app.Activity.startActivity(Activity.java:4798)
        at android.app.Activity.startActivity(Activity.java:4766)
        at org.zephyrsoft.trackworktime.ReportsActivity$1.onClick(ReportsActivity.java:125)
        at android.view.View.performClick(View.java:6274)
        at android.view.View$PerformClick.run(View.java:24859)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6710)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)```

Report: summing the times doesn't give the same results as the in app total

Reproduce

  1. Have events over the previous week
  2. Generate a report, eg.
  • sums-per-week-last-and-current-month
  • sums-per-week-last-and-current-year
    (the clock was still running which might matters)
  1. open it in a spreadsheet software
  2. do the sum for one week of all tasks.
    Details in my case:
    4.1. use GNU Units eg. units --one-line --compact "5 hr + 22 min" hr -> 5.3666667
    4.2. select all the cells to get the sum (LibreOffice)
  3. Go to the relevant week in the app
  4. Convert it's total in decimal
  5. Observe that there is a difference

backup/restore does not honor event order

The back/restore mechanism (which exports all events into a flat CSV) sometimes has problems restoring these events when they appear in the CSV file in an order so that at any point the week's sum is negative.

Possible solution: Export events in exactly the order in which they are interpreted by TWT normally (old before new, if timestamp is equal: "out" before "in").

fix FileUriExposedException on sending logs

android.os.FileUriExposedException: file:///storage/emulated/0/trackworktime/log.txt exposed beyond app through ClipData.Item.getUri()
	at android.os.StrictMode.onFileUriExposed(StrictMode.java:1960)
	at android.net.Uri.checkFileUriExposed(Uri.java:2356)
	at android.content.ClipData.prepareToLeaveProcess(ClipData.java:942)
	at android.content.Intent.prepareToLeaveProcess(Intent.java:9850)
	at android.content.Intent.prepareToLeaveProcess(Intent.java:9856)
	at android.content.Intent.prepareToLeaveProcess(Intent.java:9835)
	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1796)
	at android.app.Activity.startActivityForResult(Activity.java:4514)
	at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
	at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68)
	at android.app.Activity.startActivityForResult(Activity.java:4472)
	at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:751)
	at android.app.Activity.startActivity(Activity.java:4833)
	at android.app.Activity.startActivity(Activity.java:4801)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.doSendLogs(WorkTimeTrackerActivity.java:801)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.lambda$sendLogs$11$WorkTimeTrackerActivity(WorkTimeTrackerActivity.java:785)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity$$Lambda$11.onClick(Unknown Source:2)
	at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6753)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

IllegalArgumentException: Minute is not in the range 0..9999

java.lang.IllegalArgumentException: Minute is not in the range 0..9999
	at hirondelle.date4j.DateTimeInterval.checkRange(DateTimeInterval.java:118)
	at hirondelle.date4j.DateTimeInterval.plusOrMinus(DateTimeInterval.java:100)
	at hirondelle.date4j.DateTimeInterval.plus(DateTimeInterval.java:27)
	at hirondelle.date4j.DateTime.plus(DateTime.java:1046)
	at org.zephyrsoft.trackworktime.Basics.checkPersistentNotification(Basics.java:274)
	at org.zephyrsoft.trackworktime.Basics.safeCheckPersistentNotification(Basics.java:242)
	at org.zephyrsoft.trackworktime.Basics.periodicHook(Basics.java:198)
	at org.zephyrsoft.trackworktime.Watchdog.onReceive(Watchdog.java:34)
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)
	at android.app.ActivityThread.-wrap17(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6494)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Overview by day/week of time sums by task

This may not be a bug (unless not being able to find something is a bug) but there's something I can't find.

How do I find how much I've worked on each task summed for the day and week in app?

Case 1: I get to work on monday and have to fill out my time sheet adding the totals for each project for each day. Where do I go to see a days tasks and sums?
Case 2: I need to see if i correctly logged the time I spent earlier in the week on a certain project. I think I forgot to log the hour I spent reading a report on the train. Where do I go to see a days tasks and sums and make those changes?
Case 3: I logged 3 hours of admin today. On second thoughts I should have logged half of it to a specific project. Where do I go to see a days tasks and sums and make those changes?

The picture is of the in app report from ATimeTracker (which I am looking to migrate from because this report is also very tricky to use as a reference for making changes and correction.)
screenshot_20181015-094834

Empty reports when shared to Markor

Creating reports to Markor Texteditor App, it only shows:
"report time frame: [timeframe]"
None of my trackings is listed.

I tried every report option with 'All events'

multiple work places

support multiple work places for location-based tracking (latitude, longitude, tolerance)

Notification spam

Test info

App version: v1.0.4
Android Version: Emulator API26

A. When WorkTimeTrackerActivity is resumed

  1. Make sure "Track Work Time Notifications" channel is set to "Make sound" (it's set to on by default), so that issue is more apparent
  2. Click "Start Tracking"
  3. Minimize app
  4. Resume app and notification will go off every time

B. When tracking by wifi is enabled

  1. Enable "Track Work Time Notifications" channel to "Make sound"
  2. Set up wifi tracking
  3. Click "Start tracking"
  4. Notification sound goes off periodically

Request: report for all times

At the moment reports exist for current and last time frames, but the most useful kind of report for me would be all times for one task.

Cheers

create ACRA collector on separate domain

  • choose one of the backends and install it on a separate subdomain of zephyrsoft.org so it does not interfere with other changes that are made there
  • change the app settings accordingly (include https instead of http if appropriate)

Location based tracking does not work

Using Android 8.0.0 on my OnePlus 3 phone, I have enabled Track by location, entered the latitude and longitude with a precision of 20 meters from the GPS, put a tolerance of 500 meters, and the tracking does no start automatically when I get to work. My home is about 2 km away so it should detect a change I think.

make start of week customizable

A user suggested to change the start and end days of the week. He said: "Our pay weeks go from Friday at 3am to Thursday at 3am, so to be able to track it that way would be really awesome."

fix ArrayIndexOutOfBoundsException on permission request

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.zephyrsoft.trackworktime/org.zephyrsoft.trackworktime.WorkTimeTrackerActivity}: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4915)
	at android.app.ActivityThread.-wrap21(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6682)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.onRequestPermissionsResult(WorkTimeTrackerActivity.java:870)
	at android.app.Activity.requestPermissions(Activity.java:4291)
	at android.support.v4.app.ActivityCompat.requestPermissions(ActivityCompat.java:507)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.backupToSdAutomatically(WorkTimeTrackerActivity.java:931)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.onCreate(WorkTimeTrackerActivity.java:206)
	at android.app.Activity.performCreate(Activity.java:6942)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
	... 10 more
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.onRequestPermissionsResult(WorkTimeTrackerActivity.java:870)
	at android.app.Activity.requestPermissions(Activity.java:4291)
	at android.support.v4.app.ActivityCompat.requestPermissions(ActivityCompat.java:507)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.backupToSdAutomatically(WorkTimeTrackerActivity.java:931)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.onCreate(WorkTimeTrackerActivity.java:206)
	at android.app.Activity.performCreate(Activity.java:6942)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4915)
	at android.app.ActivityThread.-wrap21(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6682)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

data backup to SD card

TWT should have an option to enable copying the data to a SD card (customizable directory if possible). This should happen on every write so a suddenly defective phone won't make the data inaccessible.

track by more than one SSID

Enable the user to track by more than 1 wifi SSID, e.g. track task1 when in range of ssid1 and track task2 when in range of ssid2.

Or, to simplify the task, track only the default task (not different tasks), but the user can configure more than one SSID for the range check.

It's not easy to implement this the generic way because SSIDs can contain any character, also spaces, commas and semicolons. So a list of SSIDs which can be configured in one single input field would remove support for SSIDs containing the separator character, therefore this solution is not suitable.

Multiple work locations

Thanks for a nice app! It has potential to save me from 5 mins a day of unimportant work after a policy change at my employer.

I have an office job that is split between two locations. It would be nice to location track both of them as work time automatically. SSID-tracking will not be as reliable or accurate for me, but it will be a second best workaround.

WiFi based tracking keeps disconnecting

Using Android 8.0.0 on my OnePlus 3 phone, I have enabled Track by WiFi, entered SSID of my Workplace network, and the event log is full of IN/OUT events every couple of minutes, even though the SSID never loses signal.

Request for new Report: Listing of data next to each other per day

I have a request for a new report. Is there a possibility to export the *.cvs in a way that the data in Excel are not under each other but next to each other per day? Something like that:

date / start of work / end of work / break time / working time /

Any help would be welcome.

IllegalStateException: "not allowed to start service intent - app is in background" on Android 8+

java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.zephyrsoft.trackworktime/.location.LocationTrackerService (has extras) }: app is in background uid UidRecord{fbd005 u0a305 RCVR bg:+4m57s939ms idle procs:2 seq(223,223,223)}
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1538)
	at android.app.ContextImpl.startService(ContextImpl.java:1484)
	at android.content.ContextWrapper.startService(ContextWrapper.java:663)
	at org.zephyrsoft.trackworktime.Basics.startLocationTrackerService(Basics.java:361)
	at org.zephyrsoft.trackworktime.Basics.checkLocationBasedTracking(Basics.java:341)
	at org.zephyrsoft.trackworktime.Basics.safeCheckLocationBasedTracking(Basics.java:218)
	at org.zephyrsoft.trackworktime.Basics.periodicHook(Basics.java:196)
	at org.zephyrsoft.trackworktime.Watchdog.onReceive(Watchdog.java:34)
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:3390)
	at android.app.ActivityThread.-wrap18(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1780)
	at android.os.Handler.dispatchMessage(Handler.java:105)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6938)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Starting with API level 21 (Android 5.0 Lollipop), the JobScheduler is available and apparently under Oreo it has to be used if the user didn't grant an exception.

Anyone may go to "Settings" -> "Apps & notifications" -> "Advanced" -> "Special app access" -> "Battery optimization", select "All apps", tap on "Track Work Time" in the list and select "Don't optimize". This will exclude TWT from some restrictions regarding background work.

UI polishing

The UI could be much more friendly and shiny, for example:
In the events list, show the event type by an icon and not just by the text "IN" and "OUT".

fix IllegalArgumentException ("sum of a week may not be negative")

java.lang.IllegalArgumentException: sum of a week may not be negative
	at org.zephyrsoft.trackworktime.model.Week.setSum(Week.java:65)
	at org.zephyrsoft.trackworktime.timer.TimerManager.updateWeekSum(TimerManager.java:601)
	at org.zephyrsoft.trackworktime.timer.TimerManager.createEvent(TimerManager.java:584)
	at org.zephyrsoft.trackworktime.timer.TimerManager.createEvent(TimerManager.java:544)
	at org.zephyrsoft.trackworktime.timer.TimerManager.createEvent(TimerManager.java:528)
	at org.zephyrsoft.trackworktime.timer.TimerManager.startTracking(TimerManager.java:172)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.clockInAction(WorkTimeTrackerActivity.java:321)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity.lambda$onCreate$3$WorkTimeTrackerActivity(WorkTimeTrackerActivity.java:218)
	at org.zephyrsoft.trackworktime.WorkTimeTrackerActivity$$Lambda$3.onClick(Unknown Source)
	at android.view.View.performClick(View.java:6205)
	at android.widget.TextView.performClick(TextView.java:11103)
	at android.view.View$PerformClick.run(View.java:23653)
	at android.os.Handler.handleCallback(Handler.java:751)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6682)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

remove week object with last event object from DB

When deleting events, also remove the corresponding week object from the database if the user currently removes the last event for that week. This way test events don't trigger flexi time calculation for weeks far in the past.

create test suite

Create unit test suite, perhaps using Robolectric.
The package org.zephyrsoft.trackworktime.timer should be thoroughly tested, plus important parts of org.zephyrsoft.trackworktime.util.

fix remaining work time in notification

When the options "use flexi time 0:00 as target" and "countdown to 0:00 every day" are enabled, the notification sometimes displays incorrect finishing times. Especially high overtime amounts (more than one working day) could be the cause of the miscalculation, it seems that the displayed "possible finishing time" is from some days back. In case the flexi time is more than the rest for today it should display "now".

Method getFinishingTime of class TimerManager is likely to be wrong.

Wifi tracking not working with Android Pie

I recently upgraded my Samsung Galaxy S8 to Android Pie (9). Before that, Wifi tracking was working fine but now it just stopped. No events are logged at all. I already disabled battery optimization in the app's system settings (App Info - Optimize battery usage: Not optimized). Do you have some recommendation what could be done to enable this feature with the new Android version? Would be happy to provide you with more details.

make WiFi-based tracking work with Android 6.0 "Doze" / "App Standby"

The "Doze" feature which was introduced in Android 6.0 seems to confuse the WiFi-based tracking. When Doze is active, WiFi gets disabled and TWT clocks out. When WiFi is enabled again, TWT clocks in. This has to be corrected to ignore the "SSID unavailable" event when Doze is active.

Report: Times by task (Daily)

Would it be too difficult to add a daily summarized report option? Exactly like the weekly report, but per-day.

I just might be able to do this myself (by 'copying' the weekly report), but I'm not really confident in my Android programming skills...

make settings easier to set up

when trying to use this app, I struggled a lot with (not so descriptive) error messages. you can re-try this by, instead showing agonizingly useless error messages, show dialog asking for additional information related to the feature - tracking by WiFi should show available WiFi SSIDs to pick, tracking by position should perhaps show dialog window with a world map rather than asking for gps coordinates, etc.

Request: View reports in-app

Hi

I'd like to see the results of the reports in the app before exporting it. Mostly I don't need to share the report with another app, I just want to see the information quickly.

Thanks

problem in time calculation

Vili Seppänen reported a problem after being clocked in over midnight. This bug causes the UI to crash immediately in the week following the being-clocked-in-over-midnight. After another week the UI starts working again but crashes when switching to the previous week.

The automatic clock-in/clock-out works nevertheless, only the UI is affected.

Notification permanently shown

I just updated to 1.0.3 and now I have a notification that is permanently shown and cannot be removed. It says "automatic clock-in by location and/or WiFi active". Regardless of whether I check the notification setting or not the notification does not go away. I believe the notification should not be shown if the setting is not checked.

use a logging framework

At the moment the app uses a handmade logger which formats messages. It would be better to use a standard library for logging.

fix error looking up the WIFI_SERVICE

trackworktime/app/src/main/java/org/zephyrsoft/trackworktime/location/WifiTrackerService.java:50:
Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on
devices < Android N. Try changing  to .getApplicationContext()  [WifiManagerLeak]
  wifiTracker = new WifiTracker((WifiManager) getSystemService(Context.WIFI_SERVICE), basics.getTimerManager(),
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Explanation for issues of type "WifiManagerLeak":
   On versions prior to Android N (24), initializing the WifiManager via
   Context#getSystemService can cause a memory leak if the context is not the
   application context. Change context.getSystemService(...) to
   context.getApplicationContext().getSystemService(...).

repair reports for Android Nougat and newer

When TWT runs on Android Nougat or newer, the following error occurs when exporting a report:

android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/org.zephyrsoft.trackworktime/files/trackworktime/reports/sums-all-data-week-generated-at-2018-04-26-22-20-28.csv exposed beyond app through ClipData.Item.getUri()
        at android.os.StrictMode.onFileUriExposed(StrictMode.java:1960)
        at android.net.Uri.checkFileUriExposed(Uri.java:2348)
        at android.content.ClipData.prepareToLeaveProcess(ClipData.java:942)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9854)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9860)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:9839)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1610)
        at android.app.Activity.startActivityForResult(Activity.java:4487)
        at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
        at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68)
        at android.app.Activity.startActivityForResult(Activity.java:4445)
        at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:751)
        at android.app.Activity.startActivity(Activity.java:4806)
        at android.app.Activity.startActivity(Activity.java:4774)
        at org.zephyrsoft.trackworktime.ReportsActivity.lambda$onCreate$2$ReportsActivity(ReportsActivity.java:166)
        at org.zephyrsoft.trackworktime.ReportsActivity$$Lambda$2.onClick(Unknown Source:2)

Also see: https://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed

add report: first login and last logout for each day

feature request (received by mail):

If I walk through my university I often leave the range of an WiFi AP and later coming again in to the range, this make TWT generate events every time . This is OK, but if I export the list at the end of the month, I have a lot of events every day. But I only need the first even (login) and the last one (logout). can you add a function in the reports to only count first login and last logout for the day?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.