Menu
  • HOME
  • TAGS

Google Play Services revision 24

android,service,google-play,playback

The revision 24 correspond to Google Play Services 7.3 Highlights in Version 7.3: Wear - This release provides you with the ability to advertise and discover the capabilities of devices that are connected in a Wear network, through the new CapabilityApi class. The new ChannelApi class lets you send and...

Wrap parameters in AngularJS service for update API request

ruby-on-rails,ruby,angularjs,api,service

Rails automatically does wrap parameters when controller name matches a model name. Check doc. If ever it fails, you can do it manually, in your controller: wrap_parameters :expense, include: [:name, :price] so if you receive: { name: 'name', price: 'price' } Controller will give you: { name: 'name', price: 'price',...

BeanCreationException from Spring with annotation “@Context” and “@Loggable”

java,spring,service,cxf,spring-annotations

I have now received help on how to resolve this issue. In short, the @Context annotation had to be moved into the method of the interface that the class implemented. The solution is as follows: Removed the private member HttpServletRequest request and its @Context annotation. Add the HttpServletRequest as parameter...

Are there drawbacks to leaving a SqlConnection open long-term?

windows,service,ado.net,sqlconnection

Database connections are considered an "expensive" resource, and as such should be opened only when needed, and closed immediately thereafter. As a result, opening a connection early and persisting it would go against that philosophy. Additionally, doing so prevents your underlying framework from making best use of whatever variety of...

Android service's method called in different thread. Does it still run on the main thread?

java,android,multithreading,service

A method is always run in the thread that invokes it. A method doesn't really belong to any thread, so yes, even though the method is defined in your Service it will be executed in the AsyncTask thread, not the main thread that your Service is running in....

Critical section in service, multithreaded service

multithreading,delphi,service

You should use construction like this type TDevice = class protected FCriticalSection: TCriticalSection; FDevName: string; Fms: TMemoryStream; public constructor Create; destructor Destroy; override; procedure Lock; procedure Unlock; property DevName: string read FDevName write FDevName; property ms: TMemoryStream read Fms write Fms; end; ... constructor TDevice.Create; begin inherited Create; FCriticalSection :=...

Android - Camera App passed null surface

android,service,camera,surfaceview

You should use SurfaceTexture and setPreviewTexture() instead of SurfaceHolder: SurfaceTexture surfaceTexture = new SurfaceTexture(0); cam.setPreviewTexture(surfaceTexture); The error Camera : app passed NULL surface has been thrown in setPreviewDisplay() is because there was no surface created. If you still want to use SurfaceHolder, you should implement SurfaceHolder.Callback first and setPreviewDisplay() in...

How check the restSecureServicesPort is available?

windows,service,server

This could mean, that you application hosts a REST service on this Windows service. REST (REpresentational State Transfer) is a simple stateless architecture that generally runs over HTTP. This means it needs a port on which the application listens and receive data. This port is probably already busy and another...

Is it possible to disable the “Application has stopped.” dialog that pops up on Android?

android,opencv,service,process,kill

You could add your own Crash Handler in your project. To give you an idea this is an example of custom Crash Handler you could modify for your purpose.

What is the purpose of disabling an Android service in the manifest?

android,service,manifest.xml

The android:enabled attribute set to a boolean value defined in a resource file. The purpose of this attribute is to enable or disable the service on devices running on different Android OS version. For example, to disable the service on devices running Android 4.3 or lower include menifest attribute android:enabled="@bool/atLeastKitKat"....

communicate with c# service from LAN through web browser

c#,browser,service,lan

One of the questions you are asking is whether your NetNamedPipeBinding will work in this scenario. It will not. WCF uses NetNamedPipeBinding for when the service is on the same machine as a process communicating with the service. That is not the case in the scenario you describe. What you...

Receive event and intent while screen is off on Android

android,service

You need BroadcastReceivers to receive different states. Refer to Android Documentation for more information http://developer.android.com/reference/android/content/BroadcastReceiver.html Also for example, you can refer here https://www.grokkingandroid.com/android-getting-notified-of-connectivity-changes/ Some snippet from the example link provided registerReceiver( new ConnectivityChangeReceiver(), new IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION)); BroadcastReceiver implementation public class ConnectivityChangeReceiver...

Glassfish service throws an error

java-ee,netbeans,service,glassfish

So I have found the answer, I post it there in case someone does read this topic. I had to set another parameter to the glassfish conf, AS_JAVA, and give it the path to the JDK. I then got a 404 error. So I put my .war file in the...

Android is killing my service?

android,service,broadcastreceiver,android-service,android-background

You may run the service in the foreground using startForeground(). A foreground service is a service that's considered to be something the user is actively aware of and thus not a candidate for the system to kill when low on memory. But bear in mind that a foreground service must...

Sending a simple message from Service to Activity

java,android,service,handler

Well I assume that your activity and service are in the same package: Service side: //I suppose that your value is an int declared as: int myInteger; private void sendMessage() { Intent intent = new Intent("my-integer"); // add data intent.putExtra("message", String.parseInt(myInteger)); LocalBroadcastManager.getInstance(this).sendBroadcast(intent); } Activity side: @Override public void onResume() {...

executor.shutdown() in service onDestroy()

android,service,threadpoolexecutor

The consequences depends on what you are tasks are doing in the executor. If the tasks are not informed about the shutdown, they will keep running as shutdown only ensure that no new tasks can be submitted. What you can do is that you create the executor as daemon. Or...

Setting ContentView when updating a notification eventually freezes up the app? (Android)

java,android,mobile,service,notifications

I seemingly solved it by creating a new remoteviews every time I update the notification. RemoteViews newNotifContent = new RemoteViews(getPackageName(), R.layout.custom_notification); newNotifContent.setTextViewText(R.id.exerciseName, _currentExercise.getTitle()); newNotifContent.setTextViewText(R.id.setNumber, getString(R.string.sets_prefix, _currentSet, _currentExercise.getSets())); newNotifContent.setTextViewText(R.id.timeElapsed, getFormattedElapsedTime()); Notification notif = mBuilder.build(); notif.bigContentView =...

AngularJS - Use Service with Controller

javascript,angularjs,service,controller

var bdds = bdd; this.getBdds = function(){ return bdds; }; var bdd = [{ id : 1, nom : "Activité commercial", desc : "Information de l'activité commercial de l'entreprise Bou." }]; This would become as below, becuase of variable hoisting concept in javascript var bdd; var bdds; bdds = bdd;...

Angular Filter Service inside Controller

javascript,angularjs,service,filter,locale

The controller is executed only once, not every time the scope updates. $filter('decorate')($scope.greeting) is evaluated when it is assigned to $scope.code, whereas {{greeting | decorate}} is evaluated every time the scope updates. If your filter is not marked as stateful, your filter expression {{greeting | decorate}} will only be evaluated...

What means /V key when Windows Installer service starts?

windows,service,key,msiexec

According to Rob van der Woude, it is a "repair option" which recaches the local package. A few others say the same. However, this Microsoft page says it is merely a "verbose" switch: Basic troubleshooting steps for Windows Installer (article 907749)....

Get the PID of a Windows service by the name of the service

windows,batch-file,service,cmd,pid

Try the following code: FOR /F "tokens=3" %%A IN ('sc queryex %serviceName% ^| findstr PID') DO (SET pid=%%A) IF "!pid!" NEQ "0" ( taskkill /F /PID !pid! )...

OSGi: service binding without lifecycle management

service,osgi,components,declarative-services

Solution: use ServiceTracker (as suggested by Neil Bartlett) Note: if you want to see the reason for the downvote please see Neil's answer and our back-and-forth in its comments. In the end I've solved it using ServiceTracker and a static registry (MyServiceRegistry), as shown below. public class Activator implements BundleActivator...

AngularJS centralized data with restful services

javascript,angularjs,rest,service,controller

If you use $http with the cache option, only one of your controllers will make the "real" request, all the others will get the products from the cache. $http.get(url, { cache: true }) Or you can emit the results from inside your factory and let the controllers listen that. getProducts:...

WebResourceResponse cause ClassNotFoundException ignoring @TargetApi clause

java,android,caching,service,webview

I fixed it somehow. But it's strange fix. The if statement if ( Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB ) return null; doesn't work inside shouldInterceptRequest function, but works outside setting WebViewClient custom class: if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ) setWebViewClient(new WebViewClientExt2(this)); //with shouldInterceptRequest else setWebViewClient(new WebViewClientExt(this)); //without ...

Can't create handler inside thread that has not called Looper.prepare() android service

java,android,multithreading,service

It seems like you're using an AsyncTask inside your background thread. You cannot execute an AsyncTask from a background thread. Since, you're in a background thread already, you don't need an AsyncTask. Just execute your code directly.

Unbind external service android Paho MQTT ServiceConnectionLeaked error

java,android,service,paho

I just put this code in onDestroy of activity client.unregisterResources(); client.close(); ...

Running toast in at certain interval in a service

java,android,multithreading,service,handler

Try this code, while (true) { new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { Toast.makeText(context, "Service Started", Toast.LENGTH_SHORT).show(); } }); Thread.sleep(2000); } ...

What does the dot mean in Symfony service names?

symfony2,service,configuration,yaml

As per the Symfony coding standards guide, dots are simply a separator used to group services but they have no actual significance in code. Often people will group related services, for example: image.loader image.converter image.viewer This indicates all the services are to do with images. Often people might group these...

Build failure due to Sonar plugin

service,jenkins,sonarqube,sonarqube5.1

You will want to update the SonarQube Java plugin to a more recent version, your error comes from a deprecated API which was removed as of SonarQube 5.1 - and fixed in more recent versions of SonarQube Java (latest as of writing is 3.3).

passing angular service data to gaugechart controller

jquery,angularjs,http,service,promise

Try this:- app.factory("companyData", function ($http) { return { getAll: function (items) { var path = "https://dl.dropboxusercontent.com/u/28961916/companies.json" $http.get(path).success(items); } } }); letus consider this is a service here this returns items object if I want to use that items object in controller app.controller("mainController", function ($scope, companyData) { //console.log(companyData.getAll()); companyData.getAll(function (companyDetails) {...

Is it possible to start / stop apache service from PHP?

php,apache,service

Yes, with exec() exec("apachectl restart"); You might want to allow programs to close themselves before just shutting down the server, so I'd recommend: exec("apachectl graceful"); Make sure PHP doesn't run in safemode (<= PHP 5.3), as these functions won't be available then. Please note, this is how I restart apache...

Why to use Service if it runs in the same thread in android

android,service,binding

Application main thread is not always the UI thread. For example, when activity is stopped, the onStop() is in invoked, hence the UI thread is taken away from that activity and moved to another activity within the same or a different application. However it doesn't mean application is not longer...

How to start service on device boot and on application start

android,service,boot

To get a callback when the device starts, check this post. Start a Service in foreground if you want it to survive even when the device is low on memory. Read more on this....

Upgrade SonarQube issues

service,jenkins,webserver,sonarqube,sonarqube-5.0

On Windows, the scripts are indeed different: if you haven't installed SonarQube as a service, you should read "Running SonarQube as a Service on Windows" to know how to start and stop if not, then: to start SonarQube, you have to execute the "StartSonar.bat" script: this will open a Command...

Multiple instances of the same service in Delphi

delphi,service,delphi-xe

It's fairly simple. You just have to set the name different for each service. You now have: Name := ParamStr(2); DisplayName := ParamStr(3); and just have to change it to: Name := baseServiceName + '-' + GetLastDirName; DisplayName := baseServiceDisplayName + ' (' + GetLastDirName + ')'; where baseServiceName is...

How do I create a log entry for the systemd Journal?

service,systemd

If you have a service, you write your log to standard error. (It's even available as a stream named std::clog in C++, with more "log-like" semantics than std::cerr.) That's it. It's a logging mechanism that works with systemd, daemontools, daemontools-encore, runit, s6, perp, nosh, freedt, and others. There is an...

Accessing repository pattern through one more layer called service in Laravel

laravel,service,laravel-5,repository-pattern

When you access class variables, you need to do $this->some_var, not $this->$some_var. In the latter case, PHP thinks you're trying to use the string value of $some_var, and it can't - so that's why it's complaining about not being able to convert to string. Just changing that should work right...

How to get data from two services with an ID and display the content

javascript,php,angularjs,service,controller

You can use ng-if to compare the users.userId and messages.userId and display them according to the user Here is the working plunker http://embed.plnkr.co/39Dd6AtKorcxX24fNmJF/preview Hope this helps!!!!...

How to send data from BroadcastReceiver to Fragment in android

android,service,broadcastreceiver,fragment,android-gcm

To Register your Broadcast You are using: mReceiver = new ChatBroadCastReceiver(); LocalBroadcastManager.getInstance(getActivity()).registerReceiver(mReceiver ,new IntentFilter("chatupdater")); So you will Only receive Broadcast on ChatBroadCastReceiver class. Because mReceiver is a Instance of ChatBroadCastReceiver class. Now to Receive broadcast Message on anonymous class that you have created in your ChatFragment you need to register...

Starting Windows service with OpenCover throws System.ServiceProcess.TimeoutException

service,timeout,timeoutexception,opencover

There is no option currently available you'll need to raise it as an issue

Service Causes SCM Error “reported an invalid current state 0”

c#,.net,service

First: It is normally not necessary to call the SetServiceState method. It may be needed if your service really takes a long time to initialize (where you can tell the SCM you are still alive with SERVICE_START_PENDING and need a few more seconds) . Normally, you start a thread in...

Is this the a situation for using a service?

android,multithreading,service,background-process

Yes, this is a job you should be doing in a Service specially when UI does not need to be shown and you need to do this. Also if you need the result of this operation in several Activities... It's much easier for a service to notify N activities then...

Checking the equality of two NTAccount objects

c#,.net,windows,service,permissions

One solution I just tried which works is to translate each account to their respective SecurityIdentifier and then comparing them: accessRule.IdentityReference.Translate(typeof(SecurityIdentifier)) == serviceUserAccount.Translate(typeof(SecurityIdentifier)) PS: Not all IdentityReference objects can be translated to a SID so be sure to wrap this in a try-catch block....

AngularJS, Factory, Provider or Services

angularjs,variables,service,provider

I usually use a factory, seems perfect, but like you said you lose all your data when refreshing your page. This behavious is not related to Angular of Factory object, but to Javascript and your browser. You need to save this value in a storage object (cookies, sessionStorage, localStorage, here...

Relationship among Service, Alarm Manager and Broadcast Receiver

android,service,broadcastreceiver,alarmmanager

Here Is The Full Code To Set AN Alarm public class Alarmset extends Activity implements OnClickListener{ Button set; TimePicker timepicker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_alarmset); set=(Button) findViewById(R.id.set); set.setOnClickListener(this); timepicker = (TimePicker)findViewById(R.id.timepicker); } @Override public void onClick(View v) { // TODO Auto-generated method stub if(v==set) { Calendar c...

Displaying a table's row in a div element using AngularJS

javascript,angularjs,service,view,controller

You can just set the row response to controller scope and then access it in the view. In the view you can use angularJS ng-repeat directive to loop through all the records from table response and render the required data. Js myService.PHP.getTableRows(function(getTableRowsResponse){ // getTableRowsResponse contains all of my rows in...

Symfony2 global function in entity

entity-framework,symfony2,service

You could write your own class with static method: class StringUtils{ public static function sanitizeName($s) { return preg_replace('/somethingCrazy/', 'notSoCrazy', $s); } } Then, if you'd like, add a Twig filter/function which invokes this static method. This way, you have have access to it : from within Twig template, via filter/function...

Passing params to an angular service from a controller?

javascript,angularjs,service,controller,params

You can declare your service as: app.factory('books', ['$http', function($http) { // var url = 'http://...' + ParamFromController + '.json' return { getVal: function(url,options){ return $http.get(url,options) } } }]); and use it in your controller and provide appropriate params to pass into 'books' service: app.controller('BookController', ['$scope', '$routeParams', 'books', function($scope, $routeParams, books)...

Best practice for scehduled background task Android

android,service,timer,background,scheduled-tasks

best approach is wakeful intent service with alarm receiver as mentioned here https://github.com/commonsguy/cwac-wakeful...

Get open outlook email as MailItem in Windows service

c#,service,outlook

The fact is that Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. If you...

AltBeacon: BeaconConsumer in Service Not Working

android,service

remove android:exported="true" from service tag of org.altbeacon.beacon.service.BeaconService...

Does anyone know how to get Edittext value in service?

android,service

Following Code may help you to get Edittext in Service context = getApplicationContext(); Activity a=(Activity)context; EditText editText = (EditText)a.findViewById(R.id.editText1); ...

Broadcast receiver not registered

android,service,broadcastreceiver

You are calling unregisterReceiver() on the Activity context, but you are calling registerReceiver() on the LocalBroadcastManager context. This can't work. You need to register and unregister on the same Context. Make sure you only unregister if your Service has already been bound, otherwise you won't have called register(). Also, since...

Pass value to a Service, intentService or bindService?

java,android,service

For your first Question : Passing para to intent service Using putExtra to pass values to intent service , and about send notification back to activity from intent service : Using ResultReceiver in Android or try to use Callbacks Interface in service and implement it on activity // on intent...

Interrupting an unknown long-running function after a certain time period

java,android,multithreading,service,process

If a running code is not designed to react to attempts to interrupt it, then we can do nothing about it. As a workaround we can run it in a separate process and cancel it with Process.destroy()

Updating a singleton from daemon thread

android,multithreading,service,singleton

No, the singleton pattern should be avoided in Android. Why? Because the singleton pattern uses a static instance field. Static fields like that should be avoided because the OS can unload your class and you loose all its content. So my suggestion is to remove the singleton pattern or use...

File operations in Android service

android,file,service

Android services might get killed by the operating system at any possible time. More accurately, Android app processes might get killed by the operating system at any point. There are no guaranteed lifecycle calls like onDestroy() you can rely on. Correct. onDestroy() is very likely to be called, but...

Send data to activity from already running sticky service

java,android,multithreading,service,messenger

As Alternate way You can use LocalBroadcastManager to send Data from Service to Activity. Broadcast Your message from Service: private void broadcastMessage(Context context){ Intent intent = new Intent("UI_UPDATE_BROADCAST"); intent.putExtra("MESSAGE", "MyMessage"); LocalBroadcastManager.getInstance(context).sendBroadcast(intent); } Register Broadcast Receiver in your activity to receive messages: @Override public void onResume() { super.onResume(); LocalBroadcastManager.getInstance(mContext).registerReceiver(mMessageReceiver, new...

Unable to run user service. Exception: Failed to start Java, ServiceStart returned 4

java,windows,service,windows-services

I made bellow changes to make my service work successfully. Folder Structure: C:\MyService1 \myService1.exe \myService1w.exe \MyService1.class \HelloWorld.jar \logs Java Class (Daemon Class): Created java class in default package The class has two static methods: start() and stop() start() should have a infinite loop Below is the snippet from my class....

Room availability between two dates (beginner)

c#,sql,service

This currentBooking is bool hence it always throwing the exception, ie it's never null. Switching the if statement to check for true seemed to highlight an issue with the filtering in the Linq. I have to say I just rewrote the select to this, I've only run a couple of...

service not started on BOOT COMPLETE

android,service,broadcastreceiver

If your application has no activities, your BroadcastReceiver will never get called. When you install an application, it is installed in the "stopped state". applications in "stopped state" do not get broadcast Intents delivered to them. In order to get your application out of "stopped state", the user must manually...

MongoDB CountAsync and Cursors not working in a Windows Service with the new driver

c#,windows,mongodb,service

I changed the code to the following: var cursor = collection.Find(filter).ToCursorAsync(); cursor.Wait(); using (cursor.Result) { while (cursor.Result.MoveNextAsync().Result) { And it worked as expected. In the same way, the count works when I change it to: var temp = collection.CountAsync(new BsonDocument()); temp.Wait(); var count = temp.Result; ...

Unable to create service

android,service,android-service

As you have mentioned in one of one of your comments that the package name of service is different from the package containing activity, use the fully qualified class name in manifest with package name. <service android:name="com.afifa.projectreminder.service.GeofencingService" android:exported="false" > </service> ...

StopService onDestroy being called but service not ending

android,service,timer,handler,timertask

Use Handler and on destroy remove callback task TimerTask scanTask; final Handler handler = new Handler(); Timer t = new Timer(); scanTask = new TimerTask() { public void run() { handler.post(task); }}; t.schedule(scanTask, 5000, 20 * 1000); Runnable task = new Runnable() { @Override public void run() { //START YOUR...

SmtpClient - What is proper lifetime?

c#,.net,email,service

You should always utilise using using (var smtpClient = new SmtpClient()) { smtpClient.SendMail(message); } You should always dispose of anything that implements IDisposable as soon as you are finished with it.The SmtpClient class in .NET 4.0 implements IDisposable so be sure to use it! To quote MSDN: The SmtpClient class...

Hosting ApiControllers on windows service

c#,.net,wcf,rest,service

You can host WCF service in windows service. To do that create a windows service project and refer the the WCF project.Also add System.ServiceModel and System.ServiceModel.Description dlls in in your windows service project then write a function like this private ServiceHost host; private void HostWcfService() { //Create a URI to...

angularjs .then() doesn't work (then is not a function)

javascript,angularjs,service,factory

The jsFiddle needed some tweaking to work, but in general, what you need to do to make this work is: In the mFac.checkUsernameAvailability function you need to return the $http.post() result. You need to inject $q to the factory. Instead of returning res.data, just return res In all occurrences in...

Unable to check if alarm has been set by AlarmManager

android,android-intent,service,alarmmanager

In order for this check to work, you need to be absolutely sure that the PendingIntent only exists when the alarm is set. There are 2 things you can do to ensure that is so: 1) When testing your code, make sure that you uninstall your application and then reinstall...

How to send data to server in android for every 12 hours in android?

android,service,calllog

For this you can use the AlarmManager that could start your service for every 12 Hours. In the service you can check the internet connection, if connection is available then connect to the server. For Example : AlarmManager mgr = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); Intent notificationIntent = new Intent(context, UpdateService.class); PendingIntent...

Program not gathering directory information

c#,service,system,directoryinfo

Missing directory and file info I simplified my questions and discovered that I wasn't considering the visualization within the environment....

Android Process and Resource managment

android,service

In Android when Application is start , Os assign new process to app Correct. app will running in that UIThread (mainthead) of that process Incorrect. An "app" does not run on any thread. Methods of Java objects are called on threads. so operation which is define under Activity Class...

AngularJS - controller doesn't get data from service when using $http

angularjs,http,service,controller,is-empty

You have to learn about promises: http://chariotsolutions.com/blog/post/angularjs-corner-using-promises-q-handle-asynchronous-calls/ In the service you should return directly the promise of the call to the $http-Service: this.getTrips = function() { return $http.get('trips.json').then(function (response) { trips = response.data; return trips; }); }; In the controller you have then to call the then-method to access the...

Getting the Foreground Activity of any application in a Service written in other application

android,android-intent,android-activity,service,intentservice

What I want is that I need the reference to the current Activity of ANY application that is on the foreground. That is not possible. Other applications are running in other processes; you do not have access to Java objects, such as Activity instances, in those processes....

Cannot get the getLastLocation method to work in Android Studio

android,service,location

You were missing the call to connect. Add the call to connect() in onCreate() after you call buildGoogleApiClient(): @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mLatitudeText= (TextView) findViewById(R.id.latitudeTextView); mLongitudeText = (TextView) findViewById(R.id.longitudeTextView); buildGoogleApiClient(); mGoogleApiClient.connect(); //add this here } Note that even with this fix, the call to getLastLocation() will...

Turning on screen from receiver/service

android,service,android-wake-lock

You can use this code to turn the screen on. lock = ((KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE)).newKeyguardLock(KEYGUARD_SERVICE); powerManager = ((PowerManager) getSystemService(Context.POWER_SERVICE)); wake = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "TAG"); lock.disableKeyguard(); wake.acquire(); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |...

Android Step Counter — Count does not match either fitbit / Samsung Step Counter. (Off by thousands)

android,service

From my research: When the screen is locked, the Hardware Sensor waits before outputting steps. It does count steps, but once you press the button on the side it wakes up, and it receives a SensorEvent. Service was occasionally having Start Command being called. Was very important that I only...

AngularJS: Passing variables between controllers

angularjs,service,controllers

var loggedInUser = [] is an array, so if you want to get username you will have to do loggedInUser[0].Username and not loggedInUser.Username. this.GetLoginUsername = function () { return loggedInUser[0].Username; } Also, as stated in comments either use ngRoute/uiRouter to change the page/url......

Change fuse location setting while service is running

android,service,android-location,location-services,android-fusedlocation

I solved my problem by creating new GoogleApiCLient and new LocationRequest in onStartCommand(). When my app going to background I am starting my service again and checking there app is in background or not and changing my setting according to it. @Override public int onStartCommand(Intent intent, int flags, int startId)...

Background service stops working randomly in android in onCreate() and onResume()

java,android,service,background-service

From my view I can see this is a normal process, when the app enters OnPause method, this starts to works in background then you need a background process to execute your class and functions that you want. If this is your first time using parallel programming I think you...

Handle window messages in a c# service

c#,service

The Message pump in a .NET Windows Service article should be what you use. If you need a message pump you will also need a window handle that is receiving the messages. That article shows you how to create a Native Win32 window and how process the messages sent to...

Named Pipes Binding Working in Windows Service, but BasicHttp Binding Failing

c#,wcf,service

It turns out that the answer was actually to do with the account the service was running under. Having followed a (different) tutorial for running a named pipes endpoint in the windows service, the service was installed running as the NetworkService service account, where it needs to be running under...

Pass parameter from controller to service in Angular

angularjs,service,controller

You would need to inject City Service, When using explicit dependency annotation, it is all or none rule, you cannot just specify part of your dependencies. angular.module('CityCtrl', []).controller('CityController', ['$scope', '$http', 'City' function($scope, $http, City){ Also you cannot inject $scope in a factory (It is available for injection only to controllers,...

Angularjs for-loop counter in $http service

angularjs,http,for-loop,service

That's because it's being updated before the $http is finished, you can wrap it in a closure to solve this: var app = angular.module('noviceApp', []); app.controller('noviceAppController', ['$scope', '$http', function ($scope, $http) { var iterations = 1; $scope.myFunction = function() { for(var forItr = 0; forItr < iterations; forItr++) { (function(forItr){...

What is a good/best way to implement a long living service apart from main thread

android,multithreading,service

Use a normal Service that owns a thread. Send jobs to that thread to be executed in parallel on it. Its a fairly common implementation pattern.

update textview title in an Activity from a service

android,service,android-textview

We can achieve by using handler,broadcat and Listener concept.But I think broadcast is easy to implement and understand but need to take care or register and unregister of broadcast. USING LISTENER Create a Listener class public Interface Listener{ public void onResultReceived(String str); } Now implement it in activity like below...

Can I show Toast from none-UI Service in android?

android,service,toast

You can certainly do that. A service is a Context. So you can call Toast.makeText(this, "My Information", Toast.LENGTH_SHORT).show(); ...

Angularjs $http.get service not returning data to calling controller function

angularjs,service,controller

$http service is aync in nature so you need to assign data in a callback GetDataService.getData('/getBroadcastSourceList/1').then(function(data) { $scope.items=data; }) Also your service does not have a return, add it. this.getData = function(ServiceParameter) { return $http.get(WebServiceURL + ServiceParameter) ...

How to detect whether screen is touched in a background service in Android Studio?

android,service,touch,screen,detect

You have onTouch method there. Just return false and touch won't be absorbed by your app. Please also check this: http://stackoverflow.com/a/6384443/1723095 Edit: It's probably not what you want but if you have rooted device you can do something like that: adb shell getevent dev/input/event1 In my case event1 is responsible...

Windows service: Get username when user log on

c#,windows,visual-studio-2010,service

Finally I got a solution. In the windows service method, there is the session id provided. So with this session id we can execute a powershell command 'quser' and get the current user, who login/logoff on the server. Seen here: How to get current windows username from windows service in...

Service Oriented Architecture and the UI

api,user-interface,service,soa

With SOA your aim is to create an inventory of reusable, agnostic, standardised services. These services become enterprise assets - they reduce time to market by providing flexibility and end up being a competitive advantage for the enterprise. In a SOA services are available for consumption via Enterprise Service Bus...

Undefined service in controller

javascript,angularjs,service

Your controller is missing sharedProperties. You need to inject it. Add it after $http. .controller('purchaseOrderCtrl', ['$scope', '$rootScope', '$location', '$http', 'sharedProperties', function ($scope, $rootScope, $location, $http, sharedProperties) { console.log(sharedProperties.getString()); }); ...