Android Open Source - hts-cycle Packet Handler






From Project

Back to project page hts-cycle.

License

The source code is released under:

GNU General Public License

If you think the Android project hts-cycle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package it.uniroma2.wifionoff;
//  ww w  . j ava 2  s . c o m
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class PacketHandler extends BroadcastReceiver{

  @Override
  public void onReceive(Context context, Intent intent) {


    String m=intent.getStringExtra("Message");
    String ip=intent.getStringExtra("IP");
    
    boolean done=false;
    
    for(int i=0;i<OnOffService.IPs.size();i++){
      
      if(OnOffService.IPs.get(i).equals(ip)){
        done=true;
        
      }
      
    }
  if(!done)  {
    OnOffService.IPs.add(ip);
    String[] lines = m.split(System.getProperty("line.separator"));
    
    for(int i=1; i<lines.length;i++){
      
      String l=lines[i];
      
      for(int j=0;j<OnOffService.ConnectedApp.size();j++){
        
        if(OnOffService.ConnectedApp.get(j).getName().equals(l)){
          
          Intent noti=new Intent (OnOffService.ConnectedApp.get(j).getBro());
          noti.putExtra("IP", ip);
          context.sendBroadcast(noti);
          
        }
        
      }
        
      
    }
  }
    
    
    
  }

}




Java Source Code List

it.uniroma2.musicsharep2p.DataBaseHelper.java
it.uniroma2.musicsharep2p.DefaultValue.java
it.uniroma2.musicsharep2p.DownloadActivity.java
it.uniroma2.musicsharep2p.MainActivity.java
it.uniroma2.musicsharep2p.MessengerService.java
it.uniroma2.musicsharep2p.MusicSettingActivity.java
it.uniroma2.musicsharep2p.MusicShutReceiver.java
it.uniroma2.musicsharep2p.PlayListActivity.java
it.uniroma2.musicsharep2p.RemoteServiceConnection.java
it.uniroma2.musicsharep2p.SongsManager.java
it.uniroma2.musicsharep2p.Utilities.java
it.uniroma2.wifionoff.AlarmReceiver.java
it.uniroma2.wifionoff.AppActivity.java
it.uniroma2.wifionoff.AppHelper.java
it.uniroma2.wifionoff.DataBaseHelper.java
it.uniroma2.wifionoff.IpMaker.java
it.uniroma2.wifionoff.MainActivity.java
it.uniroma2.wifionoff.MessageMaker.java
it.uniroma2.wifionoff.MyListActivity.java
it.uniroma2.wifionoff.NameActivity.java
it.uniroma2.wifionoff.OnOffService.java
it.uniroma2.wifionoff.PacketHandler.java
it.uniroma2.wifionoff.ServiceCall.java
it.uniroma2.wifionoff.SettingActivity.java
it.uniroma2.wifionoff.Setting.java
it.uniroma2.wifionoff.ShutDownReceiver.java
it.uniroma2.wifionoff.WifiConfigurationNew.java
it.uniroma2.wifionoff.WifiHandler.java
it.uniroma2.wifionoff.WifiManagerNew.java
it.uniroma2.wifionoff.WifiOffReceiver.java
it.uniroma2.wifionoff.WifiReceiver.java