SoundPool的使用以及登录密码

float j = 1.0f; 
SoundPool sp = null; 
int sID = 0; 
 
@Override 
public void onCreate(Bundle savedInstanceState) { 
   
super.onCreate(savedInstanceState); (R.layout.main); 
 
   
Button b = (Button)findViewById(R.id.Button01); 
    b
.setOnClickListener(new OnClickListener() { 
 
       
@Override 
       
public void onClick(View v) { 
            j
= (float) (j +.5f); 
            sp
.setRate(sID,j); 
 
       
} 
   
}); 
 
   
AssetFileDescriptor afd; 
   
try { 
 
        sp
= new SoundPool(1, AudioManager.STREAM_MUSIC, 0); 
 
        afd
= getAssets().openFd("wav/sample.wav"); 
       
int id = sp.load(afd, 1); 
        sID
= sp.play(id, 1, 1, 1, 0, j); 
 
   
} catch (IOException e) { 
       
// TODO Auto-generated catch block 
        e
.printStackTrace(); 
   
} 
} 
为了改变 rate of play afterward 必须使用sp.setRate(StreamID,j)

    setContentView

而且“每一个pool最多1M”

更好的处理方法http://code.google.com/p/libgdx/

2.URL url = new URL("https://acme.com.au/your_account/index.php?function=login"); 
 
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
 
// If you need a cookie from previous requests 
//conn.setRequestProperty("Cookie", "JSESSIONID=" + encode(jSessionId, "UTF-8"));  
conn
.setRequestProperty("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); 
conn
.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); 
 
conn
.setRequestMethod("POST"); 
conn
.setDoOutput(true); 
conn
.setDoInput(true); 
 
DataOutputStream out = new DataOutputStream(conn.getOutputStream()); 
out.writeBytes(String.format("check_username=%s&password=%s", 
       
URLEncoder.encode(PERSNR, "UTF-8"), 
       
URLEncoder.encode(PASSWD, "UTF-8"))); 
 
out.close(); 
 
// I have absolutely no idea why this is needed. 
InputStream is = conn.getInputStream(); 
// ... read the response from is. 
is.close(); 

你可能感兴趣的:(PHP,Google,J#,idea)