Broadcast receiver for checking internet connection in android app

Broadcast receiver for checking internet connection in android app

I am developing an android broadcast receiver for checking internet connection.The problem is that my broadcast receiver is being called two times. I want it to get called only when the network is available. If it is unavailable, I don't wa

Android global variable

Android global variable

How can I create global variable keep remain values around the life cycle of the application regardless which activity running.. 1:You can extend the base android.app.Application class and add member variables like so:public class MyAppl

Invoking JavaScript code in an iframe from the parent page

Invoking JavaScript code in an iframe from the parent page

Basically, I have an iframe embedded in a page and the iframe has some JavaScript routines I need to invoke from the parent page.Now the opposite is quite simple as you only need to call parent.functionName(), but unfortunately, I need exac

Share data between AngularJS controllers

Share data between AngularJS controllers

I'm trying to share data across controllers. Use-case is a multi-step form, data entered in one input is later used in multiple display locations outside the original controller. Code below and in jsfiddle here.HTML

How do I use reflection to call a generic method?

How do I use reflection to call a generic method?

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?Consider the following sample code - inside the Example() method, what's the most concise way t

Android: start service with parameter

Android: start service with parameter

To start my service from an Activiy I use startService(MyService.class). This works great, but in a special case the service should be started differently. I want to pass some parameters to the service start.I tried the following in my Acti

How to parse/read multiple parameters with restify framework for Node.JS

How to parse/read multiple parameters with restify framework for Node.JS

Scenario: We developer are trying to replace a web service (written in C#.Net) with Node.JS Restful API.Issue: Now we need to handle the incoming request as is (we don't have control over it). So the following is the format of the incoming

Why do I need two SQL Server Service Broker queues for a simple task?

Why do I need two SQL Server Service Broker queues for a simple task?

All examples I find on the web for using SQL Server Service Broker queues seem to have two queues. I don't understand why and every example seems to assume that this is so obvious as to be unnecessary to explain.Several things will write to

Is it possible to have Android Voice Recognition (as a custom service) on Google Glass?

Is it possible to have Android Voice Recognition (as a custom service) on Google Glass?

We have a demo android application (Android 4.0.3) that runs voice recognition as a service, and (continuosly) logs the results of the recognition on the view.Everything is working fine in our smartphones.We would like to replicate this sce

Java Mail fails to authenticate smtp setting in openshift server

Java Mail fails to authenticate smtp setting in openshift server

I have written the following bean to authenticate my mail.public class Mail_Authenticator { public Session Get_Auth() { // sets SMTP server properties ResourceBundle rs_mail = ResourceBundle.getBundle("mail"); final S

Prevent IIS from killing a Task before it ends

Prevent IIS from killing a Task before it ends

I'm building a Logging library that stores everything on an Azure table. Writing to that table obviously takes a lot of time (never more than 1 sec, but it's still too much to make the user wait), so Log method returns a LogResult instance,

Fused Location Provider in Android

Fused Location Provider in Android

I am developing an app using Fused Location Provider. I have a doubt. For getting location in regular intervals it uses requestLocationUpdates(). But from which source is it get the location either from WIFI or GPS or Network. In my app, it

How to protect background service/alarms to be kill in newly launched devices in customized OS like

How to protect background service/alarms to be kill in newly launched devices in customized OS like

I have a WakefulBroadcastReceiver with IntentService, every half hour alarm called and doing some stuff.I have already handle doze mode with setExactAndAllowWhileIdle() method.Some new smart phones with customized os recently launched in ma

Using Renderer in Angular 4

Using Renderer in Angular 4

I understand why it's better to use renderer instead of directly manipulating the DOM in Angular2 projects. However, I have uninstalled, clear cache, reinstalled Node, Typescript and the Angular-CLI several times and I still get an error wh

iOS Devices do not show up on Xcode 6.1.1 - until after rebooting the Mac

iOS Devices do not show up on Xcode 6.1.1 - until after rebooting the Mac

Since updating to Xcode 6.1 all of my iOS devices will not be recognized by the Mac after a period of time. It used to be every couple of days, but now it is happening several times a day.The only remedy is to reboot the Mac. This is comple

How can I determine the bitness of the OS using Perl on Windows?

How can I determine the bitness of the OS using Perl on Windows?

Using Perl, how can I determine whether my program is running on 32 bit Windows or 64 bit Windows?Is there any API available?I can think of a couple of options..Check the PE_HEADER of some windows file (eg: c:\windows\explorer.exe) - maybe

npm install jsdom error on windows?

npm install jsdom error on windows?

I have installed nodejs on my windows pc. And it was working fine. But when I tried to install jsdom using "npm install jsdom" I was prompoted by this error. node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_module

How does the Spotify web browser button interact with the Spotify app?

How does the Spotify web browser button interact with the Spotify app?

Check out this play button, written entirely it seems, using javascript: spotify play button.Notice that pressing play will cause Spotify to start playing music. OK, I figure that's done via some app-specific protocol link (like spotify://p

Long polling with NSURLConnection

Long polling with NSURLConnection

I'm working on an iPhone application which will use long-polling to send event notifications from the server to the client over HTTP. After opening a connection on the server I'm sending small bits of JSON that represent events, as they oc

How can I define an AngularJS factory using TypeScript class that has constructor parameters

How can I define an AngularJS factory using TypeScript class that has constructor parameters

I want to write a TypeScript class that gets a "prefix" parameter in the constructor, this class also needs access to a LogService inject.Using plain JavaScript you should do it like this:angular.module('myModule', []).factory('LogWithPrefi

National holiday web service [closed]

National holiday web service [closed]

Is there a public/government web service that I can call to find out what the national holidays are for a given year? (For the US and/or any country in the world.)Edit: Does anybody have a set of formulas to calculate US holidays? (C# would

How to get an integer from MySQL as integer in PHP?

How to get an integer from MySQL as integer in PHP?

When data is returned from MySQL, it is automatically returned as strings, regardless of the MySQL data type.Is there any way to tell MySQL/PHP to maintain the data types (e.g. int), so if you query an int column, you get an integer in PHP

Android Google Cloud Messaging (GCM) token generation crash after Firebase-related Google Play Servi

Android Google Cloud Messaging (GCM) token generation crash after Firebase-related Google Play Servi

My Android application started crashing today when generating a token for Google Cloud Messaging (GCM). This happens on multiple devices and version of Android. I think it may have to do with the new Firebase features announced by Google ye

What is the difference between asio::tcp::socket's async_read_some and async_receive?

What is the difference between asio::tcp::socket's async_read_some and async_receive?

What is the difference between:boost::asio::tcp::socket::async_read_some()boost::asio::tcp::socket::async_receive()As far as I can tell their documentation is identical.Which should I prefer? 1:Their specification in the networking TR2 p

How can I access a mapped network drive with System.IO.DirectoryInfo?

How can I access a mapped network drive with System.IO.DirectoryInfo?

I need to create a directory on a mapped network drive. I am using a code:DirectoryInfo targetDirectory = new DirectoryInfo(path);if (targetDirectory != null){ targetDirectory.Create();}If I specify the path like "\\\\ServerName\\Directo