Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7501807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:39:36+00:00 2026-05-29T20:39:36+00:00

I am building an Android app that uses wifi. I have properly declared these

  • 0

I am building an Android app that uses wifi.
I have properly declared these uses permissions in the manifest, however for some reason the app is throwing a SecurityException that causes the app to force-close.

I traced the cause of the security exception in LogCat to the system saying it doesn’t have the access_wifi_state permission. This is strange and confusing to me because I have already declared it in the manifest.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="android.wifi"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-permission android:name="ACCESS_WIFI_STATE" />
    <uses-permission android:name="CHANGE_WIFI_STATE" />
    <uses-feature android:name="android.hardware.wifi" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-sdk android:minSdkVersion="8" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

        <activity
            android:name="android.wifi.AndroidWiFiActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

And here is the code that causes the exception:

package android.wifi;

import android.app.Activity;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.wifi.R;

public class AndroidWiFiActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       TextView tv = (TextView) findViewById(R.id.textbox);
       tv.setText("ABC 123");
       WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
       if(wifiMgr.isWifiEnabled())
       {
           tv.append("Wifi is enabled");
       }
       else
       {
           tv.append("Wifi is disabled");
       }

  }
}

Any help is greatly appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:39:38+00:00Added an answer on May 29, 2026 at 8:39 pm

    The permission is:

    android.permission.ACCESS_WIFI_STATE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building an android app that uses facebook connect for users to log
I'm building an Android app. I'm trying to use Admob, but I have some
I started building an Android app that uses a flat file for storage. The
I need to start building an Android app that uses the JUCE libraries. I'm
I'm building an Android app using Eclipse. If I have a single Drawable folder
I have been slowing learning and building my first android app. I'm VERY new
I'm building and Android app that needs to go through steps like a wizard.
I'm building an Android app that is basically an RSS reader, with different topics
I'm building an Android app that resizes based on the screen size using different
I am building an Android app. For that i want to show image at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.