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

The following examples show how to use android.net.wifi.p2p.WifiP2pManager.Channel. These examples are extracted from open source projects. 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 Project: ShareBox   Source File: WifiDirectManager.java    License: 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 Project: ShareBox   Source File: WifiDirectManager.java    License: Apache License 2.0 4 votes vote down vote up
public Channel getChannel() {
	return mWifiChannel;
}
 
Example 3
Source Project: Demo_Public   Source File: WifiDirectReceiver.java    License: 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
public void startReceiver(WifiP2pManager mManager, Channel mChannel) {
    Logger.log(TAG, "Starting receiver");
    this.mChannel = mChannel;
    this.mManager = mManager;
}