At first please excuse my bad English. I have a final version of my App (school work) - it is taking photos and after that photos are being stitched using c++ code. I tested the app on my phone Xperia mini API 15 where everything is OK on this device. But I borrowed school Nexus 5 API 21 and there are two problems.
First problem is frustrating. Today, I was debugging all day without solution. I have no idea, which part of code can make this error. Whenever the app is running - don't matter if it's taking photo or stitching, LogCat shows thousands of these error:
Tag: BufferQueueProceducer Text: [unnamed-3046-0] dequeueBuffer: Bufferqueue has been abandoned
The code is stopped after this error. Unfortunately I can be more specific, because I don't know. where the cause can be.
Second problem is only in process of stitching photos, when suddenly Application not responding (ANR) shows. But when I click on Wait, app continues with stitching photos. Result is good, but the dialog is annoying. I found solution on this page - problem is in runtime environment ART. I wanted to change runtime environment from ART to Dalvik, but Nexus 5 don't have option for change. Is there another choise? Error in LogCat:
Tag: art Thread[5,tid=6270, `WaitingInMainSignalCatcherLoop,Thread*=0xf60e40,peer=0x12c00080,"Signal Catcher"]: reacting to signal 3`
Thanks for every advice, LS
I'm being simplified the code (it's the main part), so you can analyze easily, but if you want, I can write all codes here.
// button for stitching photo in folder 'img'
public void onlyStitchButtonClicked(View button)
{
File root = new File(urlStorage + "img");
if (!root.exists()){
toaster("Folder '" + urlStorage + "img' doesnt exist");
}else{
// show message on TextView
tOutput.append("Stitching.\n");
choosenResultSize = getUsersSize();
// without delay text dont show in TextView
new Handler().postDelayed(new Runnable() {
public void run() {
Stitching(urlStorage, "img", choosenResultSize);
tOutput.append("End stitching.\n");
}
}, 500);
}
return;
}
// Button for taking photo and stitching them
public void startButtonClicked(View button){
// Get users settings
tOutput.setText("App is running. Start taking photo.\n");
// Wait delay before taking first photo
new Handler().postDelayed(new Runnable() {
public void run() {
StartShot();
}
}, DelayBeforeStart*1000);
}
// Take collection of photos
private void StartShot(){
new CountDownTimer(((1+NumOfPhoto)*DelayBetweenShot)*1000, DelayBetweenShot*1000) {
private int Photo = 0;
@Override
public void onTick(long millisUntilFinished) {
tOutput.append("Photo num. " + ++Photo );
try{
camera.takePicture(null, null, mPicture);
}
catch(Exception e){}
}
@Override
public void onFinish() {
tOutput.append("Stop taking photo. Start stitching");
// Wait delay before taking first photo
new Handler().postDelayed(new Runnable() {
public void run() {
Stitching(urlStorage, FolderName, choosenResultSize);
tOutput.append("Stitching done.");
scrollview.fullScroll(ScrollView.FOCUS_DOWN);
}
}, 500);
}
}.start();
}