Git Product home page Git Product logo

vibwifi's Introduction

VibWifi

This Android library used to Scan Wifi single or multiple times and get connect the scaned wifi

Anyone can simple scan and connect the wifi using vibwifi library

Add vibwifi library via dependencies

compile 'com.techibi:vibwifi_lib:0.1.1'

Enable Location permission in manifest file

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

You can scan wifi using below code

vibwifi vib= new vibwifi();
vib.StartScan(MainActivity.this,1000);

For single scan use below code

vibwifi vib= new vibwifi();
vib.singlescan(MainActivity.this);

Get scanned results via intent

  private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {

            updateUI(intent);
        }
    };

   @Override
    public void onPause() {
        super.onPause();
        unregisterReceiver(broadcastReceiver);
    }

    @Override
    public void onResume() {
        super.onResume();
       // startService(intent);
        registerReceiver(broadcastReceiver, new IntentFilter(MultipleScan.BROADCAST_ACTION));
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        unregisterReceiver(broadcastReceiver);

    }

You can also connect the wifi using below codes

vib.connectwifi(getApplicationContext(),ssid,password);

Marshmallow devices need runtime permissions

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){
   requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},
                 PERMISSIONS_REQUEST_CODE_ACCESS_COARSE_LOCATION);

}else{

 vibwifi vib= new vibwifi();
 vib.singlescan(MainActivity.this);
   
}

@Override
 public void onRequestPermissionsResult(int requestCode, String[] permissions,
         int[] grantResults) {
     if (requestCode == PERMISSIONS_REQUEST_CODE_ACCESS_COARSE_LOCATION
             && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
         // Do something with granted permission
         
         vibwifi vib= new vibwifi();
        vib.singlescan(MainActivity.this);
       
     }
 }

vibwifi's People

Contributors

vibinreji avatar

Stargazers

 avatar  avatar Viktor Ponomarenko avatar Pranav Lathigara avatar  avatar Jungle avatar Xiaohai.lin avatar Adrian Garcia Espinosa avatar

Watchers

 avatar

vibwifi's Issues

Password Process Issue

1.) first of all this code was not working without location permission So I had to add these lines below in manifest.xml files :

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

2.) After scanned result password input dialogue box pop up doesn't work at all, it asks the password but doesn't submit it for further process.

So password issue I'm facing currently now.. testing this on my mi note 5 pro (8.1.0) oreo.

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.