Vignesh Bala Vignesh Bala - 2 months ago 22
Android Question

Android application without GUI

I have been developing a simple application without UI using broadcast receiver.

The app doesn't contain any ACTIVITIES.

I have given necessary permissions.

I took the code from this url:

The app shows a toast "Not connected to internet" when I click change wifi state. It's working correctly.

But my question is There is an activity registered in my manifest file which I don't have. So I delete those lines from my manifest. Then no toasts are shown and I checked the logs too. No output on changing wifi state.

Why this happened? Please help me guys...

Here is the manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
android:versionName="1.0" >

android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

android:theme="@style/AppTheme" >
android:label="@string/app_name" >
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

android:label="NetworkChangeReceiver" >
<action android:name="" />
<action android:name="" />


Here is my Broadcastreceiver class:

public class NetworkChangeReceiver extends BroadcastReceiver{

public void onReceive(final Context context, final Intent intent) {

String status = NetworkUtil.getConnectivityStatusString(context);
/*Above line will return the status of wifi */
Toast.makeText(context, status, Toast.LENGTH_LONG).show();