Giter Site home page Giter Site logo

distriqt / ane-jobscheduler Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 0.0 2.33 MB

Android ANE to schedule a job to terminate an application after deactivation

Home Page: https://airnativeextensions.com/extension/com.distriqt.JobScheduler

License: MIT License

ActionScript 51.93% Java 48.07%
as3 adobe-air ane native-extension android

ane-jobscheduler's Introduction

built by distriqt //

JobScheduler

The JobScheduler extension is an AIR Native Extension that allows you to schedule particular tasks.

This extension was developed for usage in resolution of the Adobe AIR Android ANR issue, as discussed:

Features

  • Schedule application termination;
  • Cancel application termination;

Documentation

Latest documentation can be found in the wiki along with the asdocs.

Quick Example:

JobScheduler.instance.scheduleTermination( 2000 );

Native Extensions

The highest quality and widest range of Native Extensions for Adobe AIR

With many native extensions available, we are the largest provider of native extensions for AIR developers. Our mobile solutions allow developers to fast-forward development and focus on building great games and apps.

https://airnativeextensions.com

Acknowledgements

This extension was made possible with support by:

  • TODO

ane-jobscheduler's People

Contributors

marchbold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ane-jobscheduler's Issues

JobScheduler Android 64bit support

Update the extension to include support for Android 64bit

Starting August 1, 2019, your apps published on Google Play will need to support 64-bit architectures. 64-bit CPUs deliver faster, richer experiences for your users. Adding a 64-bit version of your app provides performance improvements, makes way for future innovation, and sets you up for devices with 64-bit-only hardware.

Compatibility with Notifications

Hi, my app has been crashed after termination from JobScheduler and after receiving notification from Notifications. E.g. termination is set up for 5 minutes and notification is set up for 6 minutes after deactivate event and then after 6 minutes (app is in background) I get notification and after tap on it, app is starting and after few seconds it has been crashed.

  • AIR SDK version: 30
  • Device OS: Android

Solved: No such service ComponentInfo

I'm not sure if I'm doing something incorrectly, I've wired in several of the distriqt extensions but I haven't seen this issue before. I tried this on 2 different Android 8.0 devices.

Error #2044: Unhandled error:. text=No such service ComponentInfo{air.com.spicerackmedia.bingoshowdown/com.distriqt.extension.jobscheduler.services.TerminateAppJobService}

private function SomeClass() {
	try {
		JobScheduler.init( "" );
		trace( "JobScheduler.init() success" );
		trace("isSupported: " + JobScheduler.isSupported);
		trace("version: " + JobScheduler.VERSION);
	} catch (e:Error) {
		trace( "ERROR::"+e.message );
	}
}
private function onApplicationActivated(e:SpicerackEvent):void {
	var jobCanceled:Boolean = JobScheduler.instance.cancelTermination();
	trace("jobCanceled: " + jobCanceled);
}

private function onApplicationBackgrounded(e:SpicerackEvent):void {
	var jobScheduled:Boolean = JobScheduler.instance.scheduleTermination( 1000 * 7 );
	trace("jobScheduled: " + jobScheduled);
}

console output:
JobScheduler.init() success
isSupported: true
version: 0.0.011
#######onApplicationBackgrounded
jobScheduled: false
Error #2044: Unhandled error:. text=No such service ComponentInfo{air.com.spicerackmedia.bingoshowdown/com.distriqt.extension.jobscheduler.services.TerminateAppJobService}
#######onApplicationActivated
jobCanceled: true

JobScheduler restarts the binded service

I've been testing the ANE file and reproduced what's causing Wakelocks with jobscheduler.

On the device, I've set sleepmode to 15seconds.
On the app, I've set : NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onDeactivate);

onDeactivate method scheduleTermintation after 20 seconds .

Just launch the app, wait for the device to go to sleep mode. After 20 seconds adb logs show:

Expected behaviour

The app should be killed and not restarted after.

Actual behaviour

App is active, device goes in sleep mode after 15 seconds, jobscheduler is set to terminate the app in 20 seconds, after 20 seconds job scheduler will restart the associated app.

Environment
  • AIR SDK version: Air 32.0.0.48 and air 29.0.0.122
  • Device OS: Android 7.0
  • Device version: Samsung Experience 8.1
  • Development IDE: Animate CC 2015.2
  • Development OS: Windows 10
Logs

10-12 15:46:53.139 3781 10415 I ActivityManager: Process com.testapp (pid 16738) has died(194,1227)
10-12 15:46:53.140 3781 10415 W ActivityManager: Scheduling restart of crashed service com.testapp/com.distriqt.extension.jobscheduler.services.TerminateAppJobService in 1000ms
10-12 15:46:53.198 3781 10415 I ActivityManager: Start proc 17363:com.donut/u0a298 for activity com.testapp/.AppEntry
10-12 15:46:53.252 3781 22097 I ActivityManager: DSS on for com.donut and scale is 1.0
10-12 15:46:53.742 3781 3867 I ActivityManager: Displayed com.donut/.AppEntry: +446ms (total +563ms)

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.