SoundPool and password to use

2010-05-05  来源:本站原创  分类:Mobile  人气:377 

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 + .5 f);
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 ();
)
)
To change the rate of play afterward must use sp.setRate (StreamID, j)

setContentView

And "Every pool up 1M"

Better way of handling 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 ();

相关文章
  • SoundPool and password to use 2010-05-05

    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 OnClickL

  • js verify password strength 2009-04-15

    Rules are as follows: Figure refers to four kinds of combinations, lowercase letters, uppercase letters, other characters Put the password strength is divided into four and so on: 1. Password length less than or equal to four. Or password only one co

  • Rails MD5 SHA1 Password Encryption 2009-07-09

    class User < ActiveRecord::Base def self.login(name, password) password = sha1(password || "") OR password = md5(password || "") end def self.sha1(pass) Digest::SHA1.hexdigest("---changme--#{pass}--") end def self.md5(pass

  • Under JBoss data source password encryption 2010-03-29

    1. The first look at a common data source configuration file Java code <? xml version = "1.0" encoding = "UTF-8"?> <datasources> <local-tx-datasource> <jndi-name> MySqlDS </ jndi-name> / / jndi name <us

  • Jboss data source password encryption 2010-03-29

    First look at the data source configuration: <?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>MySqlDS</jndi-name> //jndi First name <use-java-context>false</us

  • Prompted to connect to the localhost: localhost in XDB server requires a user name and password 2009-03-17

    At the same time, after installation of the tomcat and oracle9i, debugging jsp there - to connect to the localhost Tip: localhost in the XDB server requires a user name and password, because of port conflicts, adjusting the upload of the machine as o

  • Ext JS to implement a custom password to verify your password change confirmation 2009-03-19

    EXT In the out-of-the-verified , For example, digital ,EMAIL,URL , Etc. , These validation is good , Plus VTYPE , Specifies the type of authentication you can use the For example, xtype:'textfield', fieldLabel:'url', vtype:'url', vtypeText:' The need

  • windows to forget root password mysql super-administrator solution 2009-12-25

    Reprinted from: http://www.kuqin.com/database/20080306/4249.html Today, to help a friend retrieve a MYSQL ROOT super administrator password, and start typing the command when the little punched a "point" of harm to toss a few hours, and finally

  • Password complexity administrative password strength 2009-08-07

    Password strength tips are a feature of the recent popular, but 99% of the cases have ignored the detection mechanism. The characters are basically divided into four categories: numbers, lower case in English, uppercase English, symbols, and then fol

  • JBOSS encrypted database password script 2010-03-23

    java-cp "lib / jboss-jmx.jar; lib / jboss-common.jar; server / default / lib / jboss-jca.jar; server / default / lib / jbosssx.jar" org.jboss.resource.security. SecureIdentityLoginModule PASSWORD @ PAUSE

  • Reset tomcat login user name and password 2010-03-25

    The original tomcat-user.xml yes <? xml version = "1.0" encoding = "utf-8"?> - <tomcat-users> <role rolename="tomcat" /> <role rolename="role1" /> <user username="both" password=

  • spring data source user password encryption 2010-03-30

    Thought that in the configuration file of the database user name password encryption no practical significance. Because when "someone" have been from under your WEB-INF to get database-related user password configuration, with the associated enc

  • super administrator under windows mysql root password forgotten solution 2010-03-09

    Reprinted from: http://www.kuqin.com/database/20080306/4249.html Today to help a friend retrieve a MYSQL ROOT super administrator password, enter the command when starting a small punched a "point" harm's tossing a few hours, finally resolved, w

  • ExtJs Two implementation Confirm Password verification 2010-03-17

    Implementation 1: ************************************************* Ext.apply (Ext.form.VTypes, ( confirmPwd: function (val, field) ( if (field.confirmPwd) ( var firstPwdId = field.confirmPwd.first; var secondPwdId = field.confirmPwd.second; this.fir

  • ERP integration dynamic password authentication to enhance login security 2010-02-07

    First, the program background Enterprise ERP system is like a "black box", the internal cover the most critical applications and sensitive corporate information resources. ERP is characterized by large and comprehensive, the user can find out fr

  • Business how to promote internal employees to regularly change the password of high intensity 2010-02-07

    1. Background: With the continuous progress of enterprise information, enterprise software, an increasing number of business systems, such as VPN, ERP, e-mail, OA, etc., each system needs to log on, and some employees frequently travel log internal s

  • modify root password rhel 2010-02-05

    When you install Linux in a sudden forget the root password, you can reboot your Linux, GUN GRUB boot in the event of painting Press the e key area, select the second item: (original) kernel /vmlinuz-2.6.18-14 root=/dev/VolGroup00/LogVol00 rhgVol qui

  • Linux operating system how to limit SSH password attempts 2010-02-09

    Linux operating system how to limit SSH password attempts [] 1, configuration / etc / security / limits.conf, or configure the / etc / sshd_config 2, with fail2ban. There are other features fail2ban can achieve a similar program. In Debian, you can a

  • Oracle 11g exist password expiration problem (100 with Braun Oh, do not forget to change Well, after a message oh!) 2010-02-07

    【Description】 problem Oracle database using sqlplus login prompt "ORA-28002: 7 days after the password will expire." 【Reason / trigger factors】 To determine the default because oracle11g profile in the default set up "PASSWORD_LIFE_TIME = 1

  • Password security test code - js 2010-03-07

    function chkpwd(obj) { var t = obj.value; var id = getResult(t); // Define the corresponding message prompt var msg = new Array(4); msg[0] = " The password is too short !"; msg[1] = " Password security is poor !"; msg[2] = " Passw