Context.startForegroundService() did not then call Service.startForeground()

I am using Service Class on the Android O OS. I plan to use the Service in the background. The Android documentation states that If your app targets API level 26 or higher, the system imposes restrictions on using or creating background services unless the app itself is in the foreground. If an app needs … Read more

AngularJS : Initialize service with asynchronous data

I have an AngularJS service that I want to initialize with some asynchronous data. Something like this: myModule.service(‘MyService’, function($http) { var myData = null; $http.get(‘data.json’).success(function (data) { myData = data; }); return { setData: function (data) { myData = data; }, doStuff: function () { return myData.getSomeData(); } }; }); Obviously this won’t work because … Read more

Should a RESTful ‘PUT’ operation return something….

I was wondering what people’s opinions are of a RESTful PUT operation that returns nothing (null) in the response body. 12 s 12 The HTTP specification (RFC 2616) has a number of recommendations that are applicable. Here is my interpretation: HTTP status code 200 OK for a successful PUT of an update to an existing … Read more