Giter Site home page Giter Site logo

merlin's Introduction

๐Ÿ›‘ THIS REPOSITORY IS OFFICIALLY NO LONGER UNDER MAINTENANCE since 10/02/2022 ๐Ÿ›‘

Merlin header image

Merlin Build status Download License

Merlin aims to simplify network monitoring. Providing 3 registerable callbacks for network connectivity changes. onConnect() , onDisconnect() and onBind(NetworkStatus networkStatus).

Adding to your project

To start using Merlin, add these lines to your module's build.gradle:

repositories {
    jcenter()
}

dependencies {
    implementation 'com.novoda:merlin:1.2.0'
}

Optional steps

Note: these steps should not be necessary as the Manifest Merger should be taking care of this for you!

If for some reason your app's manifest doesn't end up containing the required entries, and you encounter issues, you might need to manually add a few things to your AndroidManifest.xml:

  1. These permissions:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  2. This service:

    <service
      android:exported="false"
      android:name="com.novoda.merlin.MerlinService" />

Sample usage

Create Merlin:

merlin = new Merlin.Builder().withConnectableCallbacks().build(context);

Bind and unbind the service in your activity:

@Override
protected void onResume() {
    super.onResume();
    merlin.bind();
}

@Override
protected void onPause() {
    merlin.unbind();
    super.onPause();
}

Register for callbacks:

merlin.registerConnectable(new Connectable() {
    @Override
    public void onConnect() {
        // Do something you haz internet!
    }
});

For further details you can check the wiki.

Migrating from pre-v1 versions

Version 1 of Merlin introduced several breaking changes in the implementation and the APIs, to account for the latest changes in Android N+. Please follow the instructions in the wiki to make the upgrade as painless as possible.

Migrating from 1.1.7

In version 1.1.8 some public API changes were made. According to our tests auto importing should be able to take care of these changes.

RxJava support in v1.0+

Starting in version 1.0.0, the RxJava support is no longer built into the library but it has been split out into a separate artifact. You'll need to add one of these two dependencies, depending on the version of RxJava you use:

// For RxJava 1.x
implementation 'com.novoda:merlin-rxjava:[version_number]'

// For RxJava 2.x
implementation 'com.novoda:merlin-rxjava2:[version_number]'

Links

Here are a list of useful links:

  • We always welcome people to contribute new features or bug fixes, here is how
  • If you have a problem check the Issues Page first to see if we are working on it
  • For further usage or to delve more deeply checkout the Project Wiki
  • Looking for community help, browse the already asked Stack Overflow Questions or use the tag: support-merlin when posting a new question

merlin's People

Contributors

amlcurran avatar anupcowkur avatar arturdryomov avatar ataulm avatar blundell avatar caroinberlin avatar charroch avatar danybony avatar electryc avatar fourlastor avatar frapontillo avatar friedger avatar hcmsilva avatar hutch4 avatar jd-alexander avatar joetimmins avatar jszmltr avatar juankysoriano avatar krishan711 avatar mr-archano avatar niltsiar avatar ouchadam avatar rock3r avatar ronocod avatar tagantroy avatar takecare avatar tasomaniac avatar xrigau avatar zegnus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

merlin's Issues

Replace MerlinLog

Problem

MerlinLog is tightly coupled to the android framework with no easy way to switch out implementations of logging as and when required.

Potential Solution

Replace MerlinLog with a simple Logger to which the client can specify the type of logging they want to be performed.

Impact

  • Not coupled to the android framework.
  • Multiple logging handles can be attached.

Integration with RxJava

Hello! Last day I was hacking with Merlin and I came up with a small wrapper around it to make it a stream.

public class RxMerlin {
    private RxMerlin() {
        throw new AssertionError("No instances.");
    }

    public static Observable<Boolean> from(final Context context) {
        return Observable.create(new Observable.OnSubscribe<Boolean>() {
            @Override public void call(final Subscriber<? super Boolean> subscriber) {

                final Merlin merlin = new Merlin.Builder()
                    .withConnectableCallbacks()
                    .withDisconnectableCallbacks()
                    .build(context);

                MerlinsBeard beard = MerlinsBeard.from(context);

                merlin.registerConnectable(new Connectable() {
                    @Override public void onConnect() {
                        subscriber.onNext(true);
                    }
                });

                merlin.registerDisconnectable(new Disconnectable() {
                    @Override public void onDisconnect() {
                        subscriber.onNext(false);
                    }
                });

                subscriber.add(Subscriptions.create(new Action0() {
                    @Override public void call() {
                        merlin.unbind();
                    }
                }));

                subscriber.onNext(beard.isConnected());

                merlin.bind();
            }
        });
    }
}

I thought it would make a good companion library, separate from the core, for whoever wants to use it in the same way. What do you guys think?

Streamline dependencies across modules

Problem

We now have multiple modules in the project. They all use similar dependencies by duplicating them. We should also drop the targetSdkVersion see here.

Potential Solution

Just like some other Novoda projects we can have a shared gradle file for these.

Impact

Maintaining dependencies is potentially harder without this change.

Get notified when the mobile data connection is lost

Currently, merlin only triggers when the connection type changes (cell/wifi).

The following could be used to detect changes of the data connection for mobile connection type.

telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_DATA_CONNECTION_STATE);

null point exception in the ConnectivityReceiver

peekService(context, new Intent(context, MerlinService.class)) can return null if the service is not running

05-15 10:52:09.047: ERROR/AndroidRuntime(1635): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start receiver com.novoda.merlin.receiver.ConnectivityReceiver: java.lang.NullPointerException
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2383)
at android.app.ActivityThread.access$1500(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1310)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.novoda.merlin.receiver.ConnectivityReceiver.getMerlinService(ConnectivityReceiver.java:34)
at com.novoda.merlin.receiver.ConnectivityReceiver.notifyMerlinService(ConnectivityReceiver.java:29)
at com.novoda.merlin.receiver.ConnectivityReceiver.onReceive(ConnectivityReceiver.java:19)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2376)
... 10 more

Not calling onConnect on Lollipop

I only receive one onConnect event from Merlin with a Nexus 5 running Lollipop 5.0.1. All subsequent onConnect events never seem to be fired. Code working fine on a Nexus 5 running KitKat 4.4.4. Thanks!

I did some more testing and I can confirm this issue still exists. The first onConnect gets fired and every event from then on does not get fired. I am not getting any onBind, onConnect, or onDisconnect events. After calling the merlin.bind() and merlin.unbind() (my Activity went into the background and then the foreground), I started receiving events again. After I get one onConnect event though again they stop firing. I tested this code again on the 4.4.4 Nexus 5 and it was working expecting.

Major readme and Wiki updates

Problem

We are planning a major release of the Merlin library which includes breaking changes.

Potential Solution

Communicate these changes on the README and update the Wiki to include a migration guide.

Impact

Without a migration guide, we may see an increase in GitHub issues / stackoverflow questions about how to incorporate this library.

Use ConnectivityManager.NetworkCallbacks

Problem

We are currently explicitly registering a BroadcastReceiver for all Android versions. For Android Lollipop and above we should be using ConnectivityManager.NetworkCallbacks. See conversation in #93 for further details.

Solution

For Android Lollipop and above use ConnectivityManager.NetworkCallbacks but we should build in a compatibility layer to ensure that MerlinService is not aware of this change.

Default endpoint is private URL

The default endpoint is http://connectivitycheck.android.com/generate_204. This is fine for now, but as it isn't a widely-used URL, it may change in future and break connectivity.

We could change this to google.com which is much less likely to break.

Updated artifact

The latest release of the library is from June 2016. Could an updated artifact be released with the latest fixes?

Setup is rather verbose

The setup of the library (which works great btw, kudos) is a bit long, with the need to specify withBindableCallbacks withConnectableCallbacks and what not.

For my use case, I have to implement all of these, but in the end, I'm not interested in the callbacks themselves, I just want to know - at some given point - whether I have a connection... perhaps with merlin.isConnectedToNetwork() or something?

Remove implicit receiver

Problem

Apps targeting Android 7.0 do not receive CONNECTIVITY_ACTION broadcasts, even if they have manifest entries to request notification of these events. Apps that are running can still listen for CONNECTIVITY_CHANGE on their main thread if they request notification with a BroadcastReceiver.

Currently, we implicitly register a BroadcastReceiver for all API levels EXCEPT for Android N and above. This will potentially have a huge impact on battery life for devices using merlin in the background. See conversation in #93 for further details.

Solution

Explicitly register a BroadcastReceiver for all Android versions.

Provide the current network state

Provide a simple way get the network state Merlin.isConnected()
This state should be the one provided from the callbacks (post pinged)

Merlin doesn't work on API 24

Merlin doesn't work in apps targeting API 24

From Android 7.0 Behavior Changes

Apps targeting Android 7.0 do not receive CONNECTIVITY_ACTION broadcasts, even if they have manifest entries to request notification of these events. Apps that are running can still listen for CONNECTIVITY_CHANGE on their main thread if they request notification with a BroadcastReceiver.

ConnectivityReceiver needs to be registered explicitly.

Package repository not updated.

Hello fellow-developers,

Looks like the latest commit was in October 2015 and the latest gradle package repository was created in July 2015. Could you please check and update asap?

Fragments

How to use on fragments when you can't extend from MarlinActivity

Use BDD naming

Problem

We are currently using a JS-like "should" notation for most of our tests in the codebase.

ShouldExpectedBehaviorWhenStateUnderTest

This omits any pre-conditions that need to happen before the test is run to make it successful.

Potential Solution

Remove JS-like "should" notation and replace it with the BDD format of:

givenPreconditions_whenStateUnderTest_thenExpectedBehavior

This will allow us to take into account any preconditions and make the tests much more explicit. When updating the library to use BDD we should also include a test naming entry in the wiki to explain to external collaborators the different variations on naming we will accept.

Impact

Make tests easier to read and allow for preconditions.

Move to gradle

With the build tools moving to gradle, everything should be .aar'd! also makes the set up easy since the manifest merging works so nicely

Introduce separate notifications for WiFi/Mobile data

sorry if "notifications" isn't the right term - the only thing I know of merlin is that it's for checking for a real internet connection.

My use case is that I'd like to download data/sync only when connected to WiFi, even if my app isn't running.

Currently I believe merlin can be used to check for net connection, but not type.

Remove VisibleForTesting from ConnectivityReceiver

Problem

ConnectivityReceiver exposes protected methods to allow the class to be testable. Some methods are only partially testable because they are backed by android.

Potential Solution

Have the ConnectivityReceiver delegate work to a fully testable collaborator.

Impact

  • Remove the @VisibleForTesting annotation on ConnectivityReceiver.
  • Create an immutable, fully tested collaborator.

Update MerlinsBeard to get more specific information about connection type

For example (but with more enums)

public class NetworkConnectionType {

    static final String OFFLINE = "offline";
    static final String WIFI = "wifi";
    static final String UNKNOWN = "unknown";

    private final NetworkInfo networkInfo;

    NetworkConnectionType(NetworkInfo networkInfo) {
        this.networkInfo = networkInfo;
    }

    public static NetworkConnectionType from(ConnectivityManager connectivityManager) {
        return new NetworkConnectionType(connectivityManager.getActiveNetworkInfo());
    }

    @Override
    public String toString() {
        if (noConnection()) {
            return OFFLINE;
        }
        if (connectedToWifi()) {
            return WIFI;
        }
        if (connectedViaMobileNetwork()) {
            return mobileNetworkType();
        }
        return UNKNOWN;
    }

    private String mobileNetworkType() {
        return networkInfo.getSubtypeName();
    }

    private boolean connectedViaMobileNetwork() {
        return networkInfo.getType() == ConnectivityManager.TYPE_MOBILE && networkInfo.getSubtype() != TelephonyManager.NETWORK_TYPE_UNKNOWN;
    }

    private boolean connectedToWifi() {
        return networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
    }

    private boolean noConnection() {
        return networkInfo == null || !networkInfo.isConnected();
    }

}

Doesn't handle WiFi which requires login

When connecting to public WiFi services such as The Cloud, many require login and will redirect any web requests to their own login page.

The current implementation will indicate that network connectivity is available when the hotspot redirects to its login page, but in many cases internet access will be blocked until login has been successfully completed.

HostPinger should, at the very least, verify that the host responding to the ping is actually the host that we think that we're pinging.

Create RxJava modules

Problem

Merlin has a hard dependency on RxJava1 which forces clients to include it even if not required.

Potential Solution

Modularise Merlin to remove the hard dependency.

Impact

  • Clients can choose which packages they require from the Merlin library rather having hard dependencies.
  • We can expand to incorporate additional modules for future versions of RxJava.

Update to use latest Mockito

Problem

We are currently using an outdated version of Mockito org.mockito:mockito-core:1.9.5, current is v2.8.9.

Potential Solution

Update Mockito to the latest stable release.

Impact

Benefit from an added annotation @Rule which prevents us from having a setup method just for initMocks(this).

Crash when turning off network when doing a service call

04-20 16:11:52.038: E/AndroidRuntime(16724): java.lang.RuntimeException: An error occured while executing doInBackground()
04-20 16:11:52.038: E/AndroidRuntime(16724): at android.os.AsyncTask$3.done(AsyncTask.java:300)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
04-20 16:11:52.038: E/AndroidRuntime(16724): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.lang.Thread.run(Thread.java:811)
04-20 16:11:52.038: E/AndroidRuntime(16724): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/github/kevinsawicki/http/HttpRequest;
04-20 16:11:52.038: E/AndroidRuntime(16724): at com.novoda.merlin.service.HostPinger$ResponseCodeFetcher.from(HostPinger.java:34)
04-20 16:11:52.038: E/AndroidRuntime(16724): at com.novoda.merlin.service.HostPinger$PingTask.doInBackground(HostPinger.java:77)
04-20 16:11:52.038: E/AndroidRuntime(16724): at com.novoda.merlin.service.HostPinger$PingTask.doInBackground(HostPinger.java:59)
04-20 16:11:52.038: E/AndroidRuntime(16724): at android.os.AsyncTask$2.call(AsyncTask.java:288)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-20 16:11:52.038: E/AndroidRuntime(16724): ... 4 more
04-20 16:11:52.038: E/AndroidRuntime(16724): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.kevinsawicki.http.HttpRequest" on path: DexPathList[[zip file "/data/app/com.depop-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.depop-1, /vendor/lib, /system/lib]]
04-20 16:11:52.038: E/AndroidRuntime(16724): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
04-20 16:11:52.038: E/AndroidRuntime(16724): ... 9 more
04-20 16:11:52.038: E/AndroidRuntime(16724): Suppressed: java.lang.ClassNotFoundException: com.github.kevinsawicki.http.HttpRequest
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.lang.Class.classForName(Native Method)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
04-20 16:11:52.038: E/AndroidRuntime(16724): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
04-20 16:11:52.038: E/AndroidRuntime(16724): ... 10 more
04-20 16:11:52.038: E/AndroidRuntime(16724): Caused by: java.lang.NoClassDefFoundError: Class "Lcom/github/kevinsawicki/http/HttpRequest;" not found
04-20 16:11:52.038: E/AndroidRuntime(16724): ... 14 more
04-20 16:11:53.678: E/GCM(1303): Failed to start GCM
04-20 16:11:53.678: E/GCM(1303): java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.net.InetAddress.getAddress()' on a null object reference
04-20 16:11:53.678: E/GCM(1303): at efs.onReceive(SourceFile:1260)
04-20 16:11:53.678: E/GCM(1303): at com.google.android.gms.gcm.GcmService.onStartCommand(SourceFile:377)
04-20 16:11:53.678: E/GCM(1303): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2702)
04-20 16:11:53.678: E/GCM(1303): at android.app.ActivityThread.access$2100(ActivityThread.java:135)
04-20 16:11:53.678: E/GCM(1303): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
04-20 16:11:53.678: E/GCM(1303): at android.os.Handler.dispatchMessage(Handler.java:102)
04-20 16:11:53.678: E/GCM(1303): at android.os.Looper.loop(Looper.java:136)
04-20 16:11:53.678: E/GCM(1303): at android.app.ActivityThread.main(ActivityThread.java:5017)
04-20 16:11:53.678: E/GCM(1303): at java.lang.reflect.Method.invoke(Native Method)
04-20 16:11:53.678: E/GCM(1303): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-20 16:11:53.678: E/GCM(1303): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)

rxjava2 support

Problem

RxJava2 has been released and Merlin does not support it ๐Ÿ˜ฑ

Potential Solution

Add RxJava2 module so that we support it.

Impact

Clients can opt-in to use RxJava2 in Merlin.

String to Endpoint

Problem

A String representing an Endpoint is passed all the way down through Merlin. The type String makes it difficult to see all usages of what is meant to be an Endpoint and does not enforce type safety. In future, if we wanted to add any validation around this String we would need to extract an additional class or swap this out.

Potential Solution

Replace the String representation of an Endpoint with a concrete implementation of an Endpoint to enforce type safety.

Impact

We can accurately see all usages of Endpoint. Easy to add validation to Endpoint should we wish it in the future.

Remove VisibleForTesting from MerlinService

Problem

MerlinService exposes protected methods to allow the class to be testable. Some methods are only partially testable because they are backed by android.

Potential Solution

Have the MerlinService delegate work to a fully testable collaborator.

Impact

  • Remove the @VisibleForTesting annotation on MerlinService.
  • Create an immutable, fully tested collaborator.

Custom Endpoint ignored

Problem

When adding a custom endpoint for Merlin to ping it is ignored. The custom endpoint seems to be ignored because the ping is performed immediately when the service is created, not after the onBind. Here are the logs demonstrating this:

05-18 09:41:05.850 15958-15958/com.novoda.merlin.demo D/DemoLogHandle: MerlinService.onCreate
05-18 09:41:05.850 15958-15958/com.novoda.merlin.demo D/DemoLogHandle: Host address not set, using Merlin default: http://connectivitycheck.android.com/generate_204
05-18 09:41:05.856 15958-16714/com.novoda.merlin.demo D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
05-18 09:41:05.862 15958-16715/com.novoda.merlin.demo D/DemoLogHandle: Pinging: Endpoint{endpoint='http://connectivitycheck.android.com/generate_204'}
05-18 09:41:05.894 15958-15958/com.novoda.merlin.demo D/DemoLogHandle: onServiceConnected
05-18 09:41:05.895 15958-15958/com.novoda.merlin.demo D/DemoLogHandle: MerlinService.onServiceConnected
05-18 09:41:05.895 15958-15958/com.novoda.merlin.demo D/DemoLogHandle: onBind
05-18 09:41:05.919 15958-16009/com.novoda.merlin.demo D/OpenGLRenderer: endAllStagingAnimators on 0xee83cf00 (RippleDrawable) with handle 0xe0dfff30
05-18 09:41:06.182 15958-15958/com.novoda.merlin.demo D/DemoLogHandle: onConnect
05-18 09:41:56.143 15958-16714/com.novoda.merlin.demo D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524296

Potential Solution

Change the call order to ensure that the ping is performed after the MerlinService is bound.

Impact

Clients will be able to specify a custom endpoint.

Runtime restart when uninstalling

05-23 12:10:46.669: ERROR/AndroidRuntime(12764): *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.PACKAGE_CHANGED dat=package:com.example.foo flg=0x8000010 (has extras) } in com.android.server.NotificationManagerService$2@429774b0
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:768)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at com.android.server.ServerThread.run(SystemServer.java:1000)
Caused by: java.lang.IllegalArgumentException: Unknown package: com.example.foo
at com.android.server.pm.Settings.getApplicationEnabledSettingLPr(Settings.java:2440)
at com.android.server.pm.PackageManagerService.getApplicationEnabledSetting(PackageManagerService.java:9026)
at android.app.ApplicationPackageManager.getApplicationEnabledSetting(ApplicationPackageManager.java:1279)
at com.android.server.NotificationManagerService$2.onReceive(NotificationManagerService.java:539)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:758)
... 4 more

Seems to be an android bug -
http://code.google.com/p/android/issues/detail?id=55781&can=4&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

What is pinged?

I'm looking through the code but am a bit of a noobie. What is the host that is pinged to determine that there is internet connectivity? Where is the part of the code to look?

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.