android.net.wifi.p2p.WifiP2pManager.Channel Java Examples

The following examples show how to use android.net.wifi.p2p.WifiP2pManager.Channel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WifiDirectManager.java    From ShareBox with Apache License 2.0 5 votes vote down vote up
public void setDeviceName(String name){
//		setDeviceName(Channel c, String devName, ActionListener listener)
		Class<WifiP2pManager> clzz = WifiP2pManager.class;
		
		ActionListener listener=new ActionListener() {
			@Override
			public void onSuccess() {
				ALog.i(TAG, "setDeviceName succees");
			}
			@Override
			public void onFailure(int reason) {
				ALog.i(TAG, "setDeviceName failure");
			}
		};
		
		Method m=null;
		try {
			m=clzz.getDeclaredMethod("setDeviceName", 
					new Class[]{Channel.class,String.class,ActionListener.class});
			m.setAccessible(true);
			m.invoke(mWifiP2pManager, getChannel(),name,listener);	
		} catch (Exception e) {
			e.printStackTrace();
		} finally{
			if(m!=null)
				m.setAccessible(false);
		}
	}
 
Example #2
Source File: WifiDirectManager.java    From ShareBox with Apache License 2.0 4 votes vote down vote up
public Channel getChannel() {
	return mWifiChannel;
}
 
Example #3
Source File: WifiDirectReceiver.java    From Demo_Public with MIT License 4 votes vote down vote up
public WifiDirectReceiver(WifiP2pManager manager,Channel channel,WiFiDirectActivity activity){
    super();
    this.mActivity = activity;
    this.mChannel = channel;
    this.mManager = manager;
}
 
Example #4
Source File: WiFiDirectManagementFragment.java    From commcare-android with Apache License 2.0 4 votes vote down vote up
public void startReceiver(WifiP2pManager mManager, Channel mChannel) {
    Logger.log(TAG, "Starting receiver");
    this.mChannel = mChannel;
    this.mManager = mManager;
}