kraigs-android / kraigsandroid

Kraig's android applications
26 stars 26 forks source link

Marshmallow supported only #103

Closed Jai-GAY closed 8 years ago

Jai-GAY commented 8 years ago

65.2% of the users are unable to access and appreciate your effort.

<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"/>

kraigs-android commented 8 years ago

This was an intentional decision. Part of the reason the old version had gotten so buggy was because of all of the compatibility layers for supporting all the way back to SDK version 4. In particular, the android AlarmManager API has changed many times in incompatible ways. Since I was re-writing everything from scratch, I decided to scrap all of the old interfaces and focus on supporting the current set of APIs correctly. The old versions of the app are still available in the Play Store and will continue to be available.

Jai-GAY commented 7 years ago

I hope you could consider revive version 1.x back to the GooglePlay store so that the rest could enjoy it. I seem to have fixed an snooze issue where you have fixed in version 2.x (I think so, didn't confirm it) as shown below. I tested and the snooze works for a few times using the test button.

In AlarmInfo.java line 146

private static AlarmTime BuildAlarmTime(int secondsAfterMidnight, int dowBitmask) { // fix not getting back the hours, min, sec correctly - start int hours = secondsAfterMidnight / 3600; int minutes = secondsAfterMidnight % 3600; int seconds = minutes % 60; minutes /= 60; // fix not getting back the hours, min, sec correctly - end Week week = new Week();

    for (Day day : Day.values()) {
        if ((dowBitmask & (1 << day.ordinal())) > 0) {
            week.addDay(day);
        }
    }

    Log.d(TAG,
        "" + secondsAfterMidnight + " dow = " +
        Integer.toHexString(dowBitmask));
    Log.d(TAG,
        "BuildAlarmTime hr = " + hours + " min = " + minutes + " sec = " +
        seconds);

    return new AlarmTime(hours, minutes, seconds, week);

}

kraigs-android commented 7 years ago

The old versions are still available on the website: https://github.com/kraigs-android/kraigsandroid-downloads

Jai-GAY commented 7 years ago

in alarmclock\PendingAlarmList.java version 1.10

public void put(long alarmId, AlarmTime time) Line 78: alarmTimes.put will throw new IllegalStateException("Inconsistent pending alarms: " if a second identical time is set. // Keep track of all scheduled alarms. pendingAlarms.put(alarmId, new PendingAlarm(time, scheduleIntent)); alarmTimes.put(time, alarmId);

May be version 2.x has different concept and will not has this issue. like to suggest the following for application to check and overcome this issue into PendingAlarmList.java and via AlarmClockServiceBinder.java (propagate through the Stub)

in PendingAlarmList.java int check (AlarmTime a) { Long id = alarmTimes.get(a); int val; if (id != null) { val = id.intValue(); } else { val = -1; } return val; }

in AlarmClockServiceBinder.java public int Alarm_check (AlarmTime time) { int temp; try { temp = clock.Alarm_check(time); } catch (RemoteException r) { temp = -1; Log.e (TAG, "Alarm_check time " + time.calendar().getTimeInMillis()); r.printStackTrace(); } return temp; } illegalstateexception