prepare

MediaPlayer 'prepare();' problem

久未见 提交于 2019-12-04 21:49:19
When I use prepare(); on my mediaplayer, a black layout pops up till the mediaplayer is prepared.. I want to change that black screens layout, is that possible? prepare(); is a blocking operation, if you dont want to block your UI Thread use prepareAsync(); . Or use prepare in another Thread Do all these thing in background thread until media player instance prepared the resource to play and show progress bar upto that time //progressDialog Thread th=new Thread(new Runnable() { @Override public void run() { MediaPlayer md=new MediaPlayer(); try { md.setDataSource("Path"); md.prepareAsync(); md

Commit some files while maven release:prepare

家住魔仙堡 提交于 2019-12-04 08:34:42
Is it possible to commit some file (no pom.xml) while mvn release:prepare? In My MultiModul Project I configured the rlease plugin with preparationGoals to change the Version in a sql file. <preparationGoals>clean verify org.codehaus.mojo:build-helper-maven-plugin:1.5:parse-version com.google.code.maven-replacer-plugin:replacer:1.5.0:replace</preparationGoals> Everything works fine but the changed sql File will not be commited. The sql File is in a subdirectory of the parent Folder. There are no pom.xml I use now a scm:checkin in the preparationGoals clean verify org.codehaus.mojo:build-helper

ERROR in PDO : Call to a member function prepare() on null

别等时光非礼了梦想. 提交于 2019-12-02 09:18:58
I have a problem with prepare function ==> Call to a member function prepare() on null i have tow pages classo.php and index.php classo.php : <?php class classo { function connection(){ $db=new pdo ('mysql:host=localhost;dbname=pronostic','root',''); $db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING); } function insererDonne($pseudo,$password) { global $db; classo::connection(); $donne=array( 'user' =>$pseudo, 'pass' =>$password ); $req="INSERT INTO users (user,pass) VALUES (:user,:pass)"; $sql=$db->prepare($req); $sql->execute($donne); } } ?> index.php: <?php require('classo.php');

Dynamically bind params in $bind_param(); Mysqli

ⅰ亾dé卋堺 提交于 2019-12-02 09:18:04
问题 I have DB class which is dealing all queries will be made to database I have mysqli prepare working fine. bind_param is also working fine but the problem is I want to define variable type dynamically. here is my code public function query($sql, $params = array()){ $this->_error = false; if($this->_query = $this->_mysqli->prepare($sql)){ $x = 1; if(count($params)){ foreach($params as $param){ $this->_query->bind_param($x, $param); $x++; } } IN PDO fist parameter defines position I guess so

Dynamically bind params in $bind_param(); Mysqli

我们两清 提交于 2019-12-02 06:58:58
I have DB class which is dealing all queries will be made to database I have mysqli prepare working fine. bind_param is also working fine but the problem is I want to define variable type dynamically. here is my code public function query($sql, $params = array()){ $this->_error = false; if($this->_query = $this->_mysqli->prepare($sql)){ $x = 1; if(count($params)){ foreach($params as $param){ $this->_query->bind_param($x, $param); $x++; } } IN PDO fist parameter defines position I guess so this function runs fine by setting X = 1 and x++ everytime, but in bind_param first argument defines type

Android MediaPlayer prepare failed: status = 0x1

北战南征 提交于 2019-12-01 16:02:15
I'm building an audio recorder that needs to play back the recorded sound. I'm running into a lot of trouble playing back the audio. I know that the file exists because I isolated it into a folder on my SD Card, but for some reason it can't play it back. Here is my code: public class RecorderEditActivity extends SherlockActivity implements DatabaseHelper.MetadataListener { private long position; private Button playButton = null; private TextView date = null; private EditText title = null; private EditText notes = null; private Button saveButton = null; private MediaPlayer mediaPlayer = null;

Android MediaPlayer prepare failed: status = 0x1

£可爱£侵袭症+ 提交于 2019-12-01 14:45:11
问题 I'm building an audio recorder that needs to play back the recorded sound. I'm running into a lot of trouble playing back the audio. I know that the file exists because I isolated it into a folder on my SD Card, but for some reason it can't play it back. Here is my code: public class RecorderEditActivity extends SherlockActivity implements DatabaseHelper.MetadataListener { private long position; private Button playButton = null; private TextView date = null; private EditText title = null;

php MySqli : How can i rewrite fetch to fetch_assoc? LIKE CONCAT

别来无恙 提交于 2019-12-01 09:42:46
Helo, I using "bind_result", "LIKE CONCAT" ... to reach full text search and pagination by two query string. but how can I change bind_result methods to fetch_assoc? <?php $mysqli = new mysqli("localhost", "", "", "test"); $query_string="hello"; //keywords $sqltxt="SELECT * FROM `table` WHERE text1 LIKE CONCAT('%', ?, '%')"; //first query : for get the total number of data $stmt = $mysqli->prepare($sqltxt); $stmt->bind_param("s",$query_string); $stmt->execute(); $stmt->store_result(); $total =$stmt->num_rows; $lastpage = ceil($total/20);//obtain the last page $page=$_GET["page"]; $startpoint =

MySQL PREPARE statement in stored procedures

﹥>﹥吖頭↗ 提交于 2019-12-01 09:04:09
I have this sql file: USE mydb; DROP PROCEDURE IF EXISTS execSql; DELIMITER // CREATE PROCEDURE execSql ( IN sqlq VARCHAR(5000) ) COMMENT 'Executes the statement' BEGIN PREPARE stmt FROM sqlq; EXECUTE stmt; DEALLOCATE PREPARE stmt; END // DELIMITER ; When I try to run it with # cat file.sql | mysql -p I get ERROR 1064 (42000) at line 6: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlq; EXECUTE stmt; DEALLOCATE PREPARE stmt; END' at line 5 What am I doing wrong? you can only prepare and execute sql that's

MySQL PREPARE statement in stored procedures

﹥>﹥吖頭↗ 提交于 2019-12-01 07:10:21
问题 I have this sql file: USE mydb; DROP PROCEDURE IF EXISTS execSql; DELIMITER // CREATE PROCEDURE execSql ( IN sqlq VARCHAR(5000) ) COMMENT 'Executes the statement' BEGIN PREPARE stmt FROM sqlq; EXECUTE stmt; DEALLOCATE PREPARE stmt; END // DELIMITER ; When I try to run it with # cat file.sql | mysql -p I get ERROR 1064 (42000) at line 6: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sqlq; EXECUTE stmt;